Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Support: Newly added save status message support method throws error, fails if new strings not in bundle. #7975

Closed
kcondon opened this issue Jun 25, 2021 · 1 comment · Fixed by #7985

Comments

@kcondon
Copy link
Contributor

kcondon commented Jun 25, 2021

While testing #7923 , discovered that creating a dataset was failing and editing and saving worked but ui appeared stuck and in all cases threw a server log error, when languages were configured (eng, fr). After some discussion, it appears that a .concat method throws a null ptr exception rather than just logging inability to find string in bundle.

The new strings that were added at the same time as that method are:
dataset.message.publish.remind.draft=If it's ready for sharing, please publish it.
dataset.message.submit.remind.draft=If it's ready for sharing, please submit it for review.
dataset.message.publish.remind.version=If it's ready for sharing, please publish it so that others can see these changes.
dataset.message.submit.remind.version=If it's ready for sharing, please submit it for review so that others can see these changes.

The stack trace is:

[2021-06-25T19:26:45.318+0000] [Payara 5.2020.6] [WARNING] [] [javax.enterprise.resource.webcontainer.jsf.lifecycle] [tid: _ThreadID=97 _ThreadName=http-thread-pool::jk-connector(2)] [timeMillis: 1624649205318] [levelValue: 900] [[
  #{DatasetPage.save}: java.lang.NullPointerException
javax.faces.FacesException: #{DatasetPage.save}: java.lang.NullPointerException
	at com.sun.faces.application.ActionListenerImpl.getNavigationOutcome(ActionListenerImpl.java:96)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:71)
	at javax.faces.component.UICommand.broadcast(UICommand.java:222)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:847)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1396)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:58)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:76)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
	at javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:707)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:451)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1636)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:331)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
	at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:282)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:757)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:577)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:158)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
	at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:76)
	at com.sun.faces.application.ActionListenerImpl.getNavigationOutcome(ActionListenerImpl.java:82)
	... 45 more
Caused by: java.lang.NullPointerException
	at java.base/java.lang.String.concat(String.java:1937)
	at edu.harvard.iq.dataverse.DatasetPage.save(DatasetPage.java:3523)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:163)
	at com.sun.el.parser.AstValue.invoke(AstValue.java:261)
	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:237)
	at org.jboss.weld.module.web.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
	at org.jboss.weld.module.web.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:65)
	at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:66)
	... 46 more
]]

A few follow on comments from discussion:

In the past, when a bundle key was missing, it wouldn’t stop the user from doing what they are trying to do. It would log something to server.log like this:
logger.warning(“Could not find key \“” + key + “\” in bundle file: “);

right the null vs “Could not find key" is the .concat above ^^^
so we could add our own concat method? that checls for nulls, mayube?

The answer, at least in part would be to have getReminderString return a blank (and maybe write to the log) when it is returning null now.
or what G just mentioned for a more complete response

@pdurbin
Copy link
Member

pdurbin commented Jun 28, 2021

From the conversation in Slack, this might be helpful for whoever picks this up:

@pdurbin pdurbin self-assigned this Jun 30, 2021
@pdurbin pdurbin removed their assignment Jun 30, 2021
kcondon added a commit that referenced this issue Jul 6, 2021
prevent page from blowing up if no remind msg in bundle #7975
janvanmansum added a commit to DANS-KNAW/dataverse that referenced this issue Jul 14, 2021
* initial semantic API endpoint

* merge new fields with existing ones

* differences from IQSS/develop that break compilation

* Add jsonld lib to compact to local context

* use expand/compact, refactor, add :startmigration endpoint

* try fix for parse error

* log value

* return dataset

* manage versionState, add debug output

* move debug ore generation after configuring dataset

* set versionstate, simplify, move terms init outside loop

* parse version number

* fix toStrings

* debug null pointer in DataverseFieldTypeInputLevel

* add support for fields with their own formal URI

* allow non-published to support debugging and future use

* refactor, use expanded version directly

* add modification time

* expanded has array with 1 val - handle it

* log compound values to start

* compact with no context for decontextualize

* handle appending and compound fields

* sort compound field children by display order

* parse date/time correctly

* Revert "sort compound field children by display order"

This reverts commit 8596ac8.

* typo

* now use Uri instead of label when matching terms

* set dsfield of dsfvalue

* additional debug, always set display order

* generate URIs for child types to match current ore maps

* allow oremap to work w/o modified date for debug

* null check on date itself

* fix compound value iteration

don't replace existing value - always add a new value, but, if not
appending, clear the list of values to start

* fix ttype map for terms with no uri - use title not name

as is done currently in generating the ORE map

* handle date format variations, including DV internal ones

see note in Dataverses - using Date() versus Timestamp() causes a
difference in precision and, perhaps surprisingly, a difference in the
response from version.getLastUpdateTime().toString() in creating the
OREmap.

* and the format in current published bags

* initial endpoint to release a migrated dataset

* create metadataOnOrig field

* add metadataOnOrig to solr

* use Finalize Publication command

Curate is for cases with an existing published version and migrated
datasets only have 1 version

Also - don't want to go through Publish command since it creates new
version numbers, etc.

* add debug, allow more details in 400 responses

* fix date-time issue

* typos

* create transfer bag type with orig files

handle no checksums on orig files

* missing tab

* add type param

* add semantic metadata api call only

* remove OREMap parameter

* fix error handling

FWIW: We have an error handler for the
edu.harvard.iq.dataverse.util.json.JsonParseException class but not for
javax.json.stream.JsonParsingException which was getting caught by the
Throwable handler and returned as a 500 error with json message {}

* append to current terms

* add replace param

* handle append on terms - fix cut/paste errors

* fix logic

* specify default

* make replace still append for multiple val fields

* add migrating switch

* expose uri in datasetField api

* track defined namespaces

and avoid having contexts with specific entries for terms that are in a
namespace already

* define equals, avoid duplicates in list

* replace string with const

* constant for CC0_URI

* GET/DELETE endpoints

* 7130-handle missing contact name

* Fix multiple description logic for info file

* put is always for :draft version

* don't cast to String[]

* add more logging

* handle unpublished versions

* add method that can return JsonObjectBuilder

which can be used with existing AbstractApiBean.ok()

* log details on failure

* multiple updates/fixes, added logging

* fix terms retrieval

* date test fixes for locale

* Java 11 update and test fixes inc. for different exception mesg

* update pom for v11 and running tests under 11

* fix for edu.harvard.iq.dataverse.api.AdminIT test fail in Java 11

The DV code tested in testLoadMetadataBlock_ErrorHandling assumed it
could parse the message of an ArrayOutOfBounds exception as an it to
determine the column that fails. This message is now a String. Rather
than parse it (and fail if it changes), I modified the code so that the
length of the values array is visible in the catch and can be sent
directly (the first out of bounds index is if/when the index is
values.length).

* flyway script adding the new constraint (IQSS#7451)

* A diagnostics script, to check and fix any duplicated harvested storageidentifiers, and re-check the local ones for any new dupes, just in case. (IQSS#7451)

* A pre-release text for the new diagnostics script (will discuss the approach in the PR/dv-tech) (IQSS#7451)

* Arming the script bomb... (IQSS#7451)

* switched to a conditional constraint. (IQSS#7451)

* Update PRE-RELEASE-INFO.txt

* update StringUtils package

* Do not count thumbnails and prep downloads, when redirecting to S3 (similarly to how these downloads are treated when done internally, without redirecting to the remote bucket, in line 457). IQSS#7924

* Implement usage of user supplied handle for authentication. This is an optional parameter.

* Fix mising ";" coding error.

* move metadataOnOrig out of citation block

which makes it optional

* IQSS#7431 remove XML prolog from the individual records of OAI-PMH ListRecords response

* IQSS#7431 adding integration tests

* Bump httpclient from 4.5.5 to 4.5.13

Bumps httpclient from 4.5.5 to 4.5.13.

---
updated-dependencies:
- dependency-name: org.apache.httpcomponents:httpclient
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* More forceful language in the "pre-release note" about the dvobject constraint
being enforced on existing databases in the next release. (IQSS#7451)

* renamed the flyway script for the dvobject constraint (since it didn't make it into 5.5) (IQSS#7451)

* Better check HandleAuthHandle for default value of null. If unequal to null then use it.

* Change "string" to "String" with uppercase first character

* build(ci): atempt to fix coveralls report. IQSS#7977

* Change parameter "HandleAuthHandle" so it start with a lower case character when it is being assigned.

* Update 5.3-release-notes.md

Removed incorrect statement: (If you are using a PostgreSQL server on `localhost:5432`, you can omit `dataverse.db.host` and `dataverse.db.port`.)

* sync with migration api branch (tests, docs, bug fixes)

* rename SQL update script IQSS#7451

* prevent page from blowing up if no remind msg in bundle IQSS#7975

* get "create dataset" working again IQSS#7986

* remove TODO IQSS#7986

Per comment from Jim: "This works and doesn't break the anonymized
access functionality as I thought it might."

* add anonymized access methods

* fix test

* Update doc/release-notes/6497-semantic-api.md

Co-authored-by: Philip Durbin <philipdurbin@gmail.com>

* Update doc/sphinx-guides/source/developers/dataset-semantic-metadata-api.rst

Co-authored-by: Philip Durbin <philipdurbin@gmail.com>

* add create example, remove solr schema copies file

* removed debug logging

* missing header

* Added an extra clause for some IQSS-specific harvested identifiers.
Extremely unlikely to be encountered anywhere else; but need to be
included to be able to QA on a copy of the prod. db.
Plus some extr diagnostics. (IQSS#7451)

* IQSS#7893 link Rserve documentation to necessary files in Dataverse repo

* IQSS#7893 remove redundant script mention per feedback from Leonid

* Adding -H + API token to curl commands

Without ``-H`` and the API token in these curl commands, the native API rejects the user's requests on the ground that they are a 'guest'.

* remove metadataOnOrig per review

* IQSS#7893 use fixedwidthplain text instead, clone master instead of develop

* fixes the small formatting issue with the link (IQSS#7893)

* Update doc/sphinx-guides/source/api/native-api.rst

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update doc/sphinx-guides/source/api/native-api.rst

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update doc/sphinx-guides/source/api/native-api.rst

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update doc/sphinx-guides/source/api/native-api.rst

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

* Update documentation to be more consise about the handle and give a better example.

* IQSS#7936 append deaccessionDialog.reasons with periods for proper display

* add missing create method (in migrate PR)

* No "@id" npe fix

* avoid npe in logging

* only require "@id" when migrating

* fix logging in create case

* WIP

* Temporary conflict solution

* Added marker comments where code must be revised/fixed later '// TODO: FIX FOR MULTI-LICENSE'

Co-authored-by: qqmyers <qqmyers@hotmail.com>
Co-authored-by: Leonid Andreev <leonid@hmdc.harvard.edu>
Co-authored-by: Gustavo Durand <scolapasta+github@gmail.com>
Co-authored-by: Robert Verkerk <robert.verkerk@surfsara.nl>
Co-authored-by: pkiraly <pkiraly@gwdg.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oliver Bertuch <o.bertuch@fz-juelich.de>
Co-authored-by: Kevin Condon <kcondon@hmdc.harvard.edu>
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Co-authored-by: Philip Durbin <philipdurbin@gmail.com>
Co-authored-by: Don Sizemore <don.sizemore@gmail.com>
Co-authored-by: Benjamin Peuch <benjamin.peuch@gmail.com>
Co-authored-by: Jan van Mansum <janvanmansum@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants