Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Null pointer exception in multilanguage Dataverse 6.4 after migration.

182 views
Skip to first unread message

juan...@gmail.com

unread,
Nov 18, 2024, 10:19:53 AM11/18/24
to Dataverse Users Community

Hello, 

  We are migrating e-cienciaDatos from Dataverse v5.10.1 to v6.4 and we get a null pointer exception in the languages Field.

It works in v5.10.1, but fails in v6.4

The database :Languages setting entry is filled.
dvndb=> select  * from setting where name =':Languages';
   name    |                                                content                                                 | id | lang  
------------+--------------------------------------------------------------------------------------------------------+----+------
:Languages | [{"locale":"es","title":"Spanish"},{"locale":"en","title":"English"},{"locale":"fr","title":"French"}] | 40 |  

The dataverse.lang .directory value in domain.xml file is set
grep dataverse.lang $PAYARA/glassfish/domains/domain1/config/domain.xml
       <jvm-options>-Ddataverse.lang.directory=/usr/local/dataverseLang</jvm-options>

The log trace is long, but we have checked that the Dataverse.initLocale method is called and all languages are read:
The server.log trace shows:
[2024-11-18T11:05:40.772+0100] [Payara 6.2024.10] [WARNING] [AS-EJB-00056] [jakarta.enterprise.ejb.container] [tid: _ThreadID=198 _ThreadName=http-thread-pool::http-listener-1(2)] [timeMillis: 1731924340772] [levelValue: 900] [[
 A system exception occurred during an invocation on EJB DatasetFieldServiceBean, method: public java.lang.String edu.harvard.iq.dataverse.DatasetFieldServiceBean.getFieldLanguage(java.lang.String,java.lang.String)]]
[2024-11-18T11:05:40.773+0100] [Payara 6.2024.10] [WARNING] [] [jakarta.enterprise.ejb.container] [tid: _ThreadID=198 _ThreadName=http-thread-pool::http-listener-1(2)] [timeMillis: 1731924340773] [levelValue: 900] [[

jakarta.ejb.EJBException: Cannot invoke "String.split(String)" because "languages" is null
       at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:723)
       at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:652)
       at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:482)
       at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4601)
       at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2134)
       at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2104)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
       at jdk.proxy74/jdk.proxy74.$Proxy373.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.__EJB31_Generated__DatasetFieldServiceBean__Intf____Bean__.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.DatasetPage.getFieldLanguage(DatasetPage.java:6207)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[.................]

at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.NullPointerException: Cannot invoke "String.split(String)" because "languages" is null
       at edu.harvard.iq.dataverse.DatasetFieldServiceBean.getFieldLanguage(DatasetFieldServiceBean.java:856)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.base/java.lang.reflect.Method.invoke(Method.java:569)
[.................]

... 96 more
]]
[2024-11-18T11:05:40.775+0100] [Payara 6.2024.10] [SEVERE] [] [jakarta.enterprise.resource.webcontainer.faces.application] [tid: _ThreadID=198 _ThreadName=http-thread-pool::http-listener-1(2)] [timeMillis: 1731924340775] [levelValue: 1000] [[
 Error Rendering View[/dataverse.xhtml]
jakarta.el.ELException: /search-include-fragment.xhtml @390,208 value="#{DatasetPage.getFieldLanguage(cvocConf.get(SearchIncludeFragment.getFieldTypeId(friendlyNames.get(0))).getString('languages'))}": jakarta.ejb.EJBException: Cannot invoke "String.split(String)" because "languages" is null
       at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:77)
       at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.getAttributeValue(HtmlResponseWriter.java:1137)
       at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.flushAttributes(HtmlResponseWriter.java:1097)

[.................]

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:83)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:101)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
       at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: jakarta.el.ELException: jakarta.ejb.EJBException: Cannot invoke "String.split(String)" because "languages" is null
       at jakarta.el.ELUtil.invokeMethod(ELUtil.java:221)
[.................]
       at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:73)
       ... 80 more
Caused by: jakarta.ejb.EJBException: Cannot invoke "String.split(String)" because "languages" is null
       at com.sun.ejb.containers.EJBContainerTransactionManager.processSystemException(EJBContainerTransactionManager.java:723)
       at com.sun.ejb.containers.EJBContainerTransactionManager.completeNewTx(EJBContainerTransactionManager.java:652)
       at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:482)
       at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4601)
       at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2134)
       at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2104)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
       at jdk.proxy74/jdk.proxy74.$Proxy373.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.__EJB31_Generated__DatasetFieldServiceBean__Intf____Bean__.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.DatasetPage.getFieldLanguage(DatasetPage.java:6207)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       ... 87 more
Caused by: java.lang.NullPointerException: Cannot invoke "String.split(String)" because "languages" is null
       at edu.harvard.iq.dataverse.DatasetFieldServiceBean.getFieldLanguage(DatasetFieldServiceBean.java:856)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[.................]
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
       ... 96 more
]]
[2024-11-18T11:05:40.783+0100] [Payara 6.2024.10] [WARNING] [] [jakarta.enterprise.web.core] [tid: _ThreadID=198 _ThreadName=http-thread-pool::http-listener-1(2)] [timeMillis: 1731924340783] [levelValue: 900] [[
 Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException: Cannot invoke "String.split(String)" because "languages" is null
       at edu.harvard.iq.dataverse.DatasetFieldServiceBean.getFieldLanguage(DatasetFieldServiceBean.java:856)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[.................]
90)
       at jdk.proxy74/jdk.proxy74.$Proxy373.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.__EJB31_Generated__DatasetFieldServiceBean__Intf____Bean__.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.DatasetPage.getFieldLanguage(DatasetPage.java:6207)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[.................]
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
       at java.base/java.lang.Thread.run(Thread.java:840)
]]
[2024-11-18T11:05:40.784+0100] [Payara 6.2024.10] [WARNING] [] [jakarta.enterprise.web] [tid: _ThreadID=198 _ThreadName=http-thread-pool::http-listener-1(2)] [timeMillis: 1731924340784] [levelValue: 900] [[
 StandardWrapperValve[default]: Servlet.service() for servlet default threw exception
java.lang.NullPointerException: Cannot invoke "String.split(String)" because "languages" is null
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[.................]
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
       at jdk.proxy74/jdk.proxy74.$Proxy373.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.__EJB31_Generated__DatasetFieldServiceBean__Intf____Bean__.getFieldLanguage(Unknown Source)
       at edu.harvard.iq.dataverse.DatasetPage.getFieldLanguage(DatasetPage.java:6207)
[.................]
       at java.base/java.lang.Thread.run(Thread.java:840)
]]

Someone has found some similar issue?

Best,

Juan

ap.m...@gmail.com

unread,
Nov 18, 2024, 11:17:53 AM11/18/24
to Dataverse Users Community

Hello,

We've seen that you've encountered an error, which we also experienced.

If we’re not mistaken, it seems mandatory to define the languages in which the metadata is filled. In our case, we use English, Catalan, and Spanish.

However, it’s not working exactly as we’d like because the dropdowns don’t translate automatically; instead, we must refresh the page. For this reason, we’ve set English as the default for now.

Do you happen to have any additional insights or guidance?

Thank you in advance 🙂

Mireia
El dia dilluns, 18 de novembre del 2024 a les 16:19:53 UTC+1, juan...@gmail.com va escriure:

James Myers

unread,
Nov 18, 2024, 1:08:29 PM11/18/24
to dataverse...@googlegroups.com

Juan,

 

The method in the error log is called when you are using External Controlled Vocabulary scripts. The values come from the languages entry in the configuration you use, e.g. https://github.com/gdcc/dataverse-external-vocab-support/blob/dc71bd59197074d8ba0df79a45c0e4ac3778a164/examples/config/authorsOrcidAndRor.json#L11, that indicates which languages the script/service supports. According to the schema, it should be non-null. It’s possible that older config examples did not have a languages value.

 

FWIW: That’s separate from the :Languages setting which determines which languages the overall Dataverse user interface will use and from the :MetadataLanguages setting, which defines which languages a Dataverse instance will accept when people enter dataset metadata.

 

Mireia,

I’m not sure I understand which setting and which page you are talking about, but my guess would be that if something is not refreshing immediately and you have to reload the page, it’s a bug. If you can provide more details, please submit an issue at https://github.com/QualitativeDataRepository/TechnicalTeam/issues.

 

 

-- Jim

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dataverse-community/b7e82087-9ea0-49b2-9bbe-d83bfd223ef8n%40googlegroups.com.

Alfredo Cosco

unread,
Nov 18, 2024, 4:32:42 PM11/18/24
to dataverse...@googlegroups.com
I'm not sure if this will be helpful, but I encountered a similar issue and the most likely cause was that I was deploying to the wrong Payara version. For Dataverse 6.4, the manual states that Payara-6.2024.6 is still in use. However, based on the log you've shared, I see that you're using version 6.2004.10.

Regards,
Alfredo

juan...@gmail.com

unread,
Nov 19, 2024, 5:22:42 AM11/19/24
to Dataverse Users Community
Hi,

  And thank you Mireia, Jim and Alfredo.

  Alfredo, you are right, our problem was that we were using a wrong Payara version. Now Dataverse 6.4 is running in our testing environment. We will continue with our testing and customization.

  Regards,

Juan
Reply all
Reply to author
Forward
0 new messages