Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » NullPointerException(Using table default filter mechanism an error occur )
NullPointerException [message #1841763] Fri, 28 May 2021 02:55 Go to next message
Mark Novem Grisola is currently offline Mark Novem GrisolaFriend
Messages: 30
Registered: November 2017
Member
Good day,

I am facing this problem when using the default table filter mechanism.

2021-05-28 02:38:33,312 INFO [scout-model-thread-11] org.eclipse.scout.rt.ui.html.json.MainJsonObjectFactory - Using following object factories: [org.eclipse.scout.rt.ui.html.JsonObjectFactory@619b98a0, adn.gov.ph.govservices.ui.html.ZeroClickJsonObjectFactory@407b0ac] -Ex: MDC[principal=user, httpUri=, uiSession=, clientSession=1qv7hod4dqeeer1d09mn7i03e5i58k0djejsqcmmqhi1alfvpdvd, jobName=Starting JsonClientSession, cid=pB4az8vF2qv/1]
2021-05-28 02:38:33,407 INFO [qtp315138752-45] org.eclipse.scout.rt.ui.html.UiSession - UiSession with ID 1:9gmusktgtstfjnohu2avvruuhom26cv99rasg9o9k63mlfl38ko initialized -Ex: MDC[principal=user, httpUri=, uiSession=, clientSession=, jobName=, cid=pB4az8vF2qv/1]
2021-05-28 02:38:33,408 INFO [qtp315138752-45] org.eclipse.scout.rt.ui.html.json.JsonMessageRequestHandler - Created new UI session with ID 1:9gmusktgtstfjnohu2avvruuhom26cv99rasg9o9k63mlfl38ko in 2309.089994 ms [maxIdleTime=14400s, httpSession.maxInactiveInterval=3600s] -Ex: MDC[principal=user, httpUri=, uiSession=, clientSession=, jobName=, cid=pB4az8vF2qv/1]
2021-05-28 02:38:41,557 ERROR [scout-model-thread-22] org.eclipse.scout.rt.platform.exception.ExceptionHandler - NullPointerException:n/a -Ex: java.lang.NullPointerException: null
	at org.eclipse.scout.rt.client.ui.basic.table.AbstractTable$P_TableUIFacade.fireFilterAddedFromUI(AbstractTable.java:4934)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.scout.rt.client.ModelContextProxy.lambda$1(ModelContextProxy.java:49)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxMandatory(TransactionProcessor.java:156)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequired(TransactionProcessor.java:139)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.intercept(TransactionProcessor.java:78)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:158)
	at org.eclipse.scout.rt.client.ModelContextProxy.lambda$0(ModelContextProxy.java:49)
	at com.sun.proxy.$Proxy33.fireFilterAddedFromUI(Unknown Source)
	at org.eclipse.scout.rt.ui.html.json.table.JsonTable.handleUiFilterAdded(JsonTable.java:952)
	at org.eclipse.scout.rt.ui.html.json.table.JsonTable.handleUiEvent(JsonTable.java:629)
	at org.eclipse.scout.rt.ui.html.json.JsonEventProcessor.processEvent(JsonEventProcessor.java:52)
	at org.eclipse.scout.rt.ui.html.json.JsonEventProcessor.processEvents(JsonEventProcessor.java:37)
	at org.eclipse.scout.rt.ui.html.UiSession.processJsonRequestInternal(UiSession.java:817)
	at org.eclipse.scout.rt.platform.util.concurrent.Callables.lambda$0(Callables.java:31)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.job.internal.ExceptionProcessor.intercept(ExceptionProcessor.java:41)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxMandatory(TransactionProcessor.java:156)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequired(TransactionProcessor.java:139)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.intercept(TransactionProcessor.java:78)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.eclipse.scout.rt.platform.security.SubjectProcessor.intercept(SubjectProcessor.java:43)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:158)
	at org.eclipse.scout.rt.platform.context.RunContextRunner.intercept(RunContextRunner.java:38)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.job.internal.CallableChainExceptionHandler.intercept(CallableChainExceptionHandler.java:33)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.lambda$0(JobFutureTask.java:106)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.run(JobFutureTask.java:175)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	at org.eclipse.scout.rt.platform.job.internal.NamedThreadFactory$1.run(NamedThreadFactory.java:63)
 MDC[principal=user, httpUri=, uiSession=1:9gmusktgtstfjnohu2avvruuhom26cv99rasg9o9k63mlfl38ko, clientSession=1qv7hod4dqeeer1d09mn7i03e5i58k0djejsqcmmqhi1alfvpdvd, jobName=Processing JSON request, cid=Xu6KU3FV9Yw/5]
2021-05-28 02:38:41,614 ERROR [scout-model-thread-21] org.eclipse.scout.rt.platform.exception.ExceptionHandler - NullPointerException:n/a -Ex: java.lang.NullPointerException: null
	at org.eclipse.scout.rt.client.ui.basic.table.AbstractTable$P_TableUIFacade.fireFilterAddedFromUI(AbstractTable.java:4934)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.scout.rt.client.ModelContextProxy.lambda$1(ModelContextProxy.java:49)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxMandatory(TransactionProcessor.java:156)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequired(TransactionProcessor.java:139)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.intercept(TransactionProcessor.java:78)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:158)
	at org.eclipse.scout.rt.client.ModelContextProxy.lambda$0(ModelContextProxy.java:49)
	at com.sun.proxy.$Proxy33.fireFilterAddedFromUI(Unknown Source)
	at org.eclipse.scout.rt.ui.html.json.table.JsonTable.handleUiFilterAdded(JsonTable.java:952)
	at org.eclipse.scout.rt.ui.html.json.table.JsonTable.handleUiEvent(JsonTable.java:629)
	at org.eclipse.scout.rt.ui.html.json.JsonEventProcessor.processEvent(JsonEventProcessor.java:52)
	at org.eclipse.scout.rt.ui.html.json.JsonEventProcessor.processEvents(JsonEventProcessor.java:37)
	at org.eclipse.scout.rt.ui.html.UiSession.processJsonRequestInternal(UiSession.java:817)
	at org.eclipse.scout.rt.platform.util.concurrent.Callables.lambda$0(Callables.java:31)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.job.internal.ExceptionProcessor.intercept(ExceptionProcessor.java:41)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:227)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxMandatory(TransactionProcessor.java:156)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.runTxRequired(TransactionProcessor.java:139)
	at org.eclipse.scout.rt.platform.transaction.TransactionProcessor.intercept(TransactionProcessor.java:78)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.eclipse.scout.rt.platform.security.SubjectProcessor.intercept(SubjectProcessor.java:43)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.context.RunContext.call(RunContext.java:158)
	at org.eclipse.scout.rt.platform.context.RunContextRunner.intercept(RunContextRunner.java:38)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.job.internal.CallableChainExceptionHandler.intercept(CallableChainExceptionHandler.java:33)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain$Chain.continueChain(CallableChain.java:222)
	at org.eclipse.scout.rt.platform.chain.callable.CallableChain.call(CallableChain.java:170)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.lambda$0(JobFutureTask.java:106)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.eclipse.scout.rt.platform.job.internal.JobFutureTask.run(JobFutureTask.java:175)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	at org.eclipse.scout.rt.platform.job.internal.NamedThreadFactory$1.run(NamedThreadFactory.java:63)


but on tablepage the default filter mechanism works just fine..

For additional information, i used these properties/settings:

pom.xml
<properties>
<adn.gov.ph.govservices.version>${project.version}</adn.gov.ph.govservices.version>
<jdk.source.version>1.8</jdk.source.version>
<org.eclipse.scout.rt.version>10.0.18</org.eclipse.scout.rt.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Eclipse IDE version: 2021-03 (4.19.0)

Could someone give me a hand please.
Re: NullPointerException [message #1841766 is a reply to message #1841763] Fri, 28 May 2021 05:58 Go to previous messageGo to next message
Mark Novem Grisola is currently offline Mark Novem GrisolaFriend
Messages: 30
Registered: November 2017
Member
I solve the problem.

Before, i use initTableInternal() method to initially load the data into the table itself, like:
before:
@Override
					protected void initTableInternal() {
						// TODO Auto-generated method stub
						deleteAllRows();
						....
						Object[][] result = BEANS.get(IXXService.class).getXXTableData(..); 
						addRowsByMatrix(result);
					}
					*/


Every time i will use the table default filter mechanism it always throws a NullPointerException error, i do not know yet as to how or why, hope someone could give me a hint. But after removing the
initTableInternal()
though the table is empty but the filter mechanism just works fine. So, to initially load the table data i have tried to use
initFieldInternal()
method of the form, like:
after:
@Override
					protected void initFieldInternal() {
						// TODO Auto-generated method stub
						deleteAllRows();
						....
						Object[][] result = BEANS.get(IXXService.class).getXXTableData(..); 
						addRowsByMatrix(result);
					}
					*/

and hollah, it works.. The data is loaded into the table and the filter mechanism works.. SOLVED!
But the question remains, why is it using
initTableInternal()
throw an error exception, is it related to my code within the method? I like to know the exact reason. If you have any idea please share it to me.. Thank you..
Re: NullPointerException [message #1841769 is a reply to message #1841766] Fri, 28 May 2021 06:49 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Mark

When you're building a Scout application, you should never use any methods with "internal" in the method-name. As the name suggests these methods are not part of the Scout API, they may change with every new Scout release and they do handle internal state of the framework. Overriding one of these methods may break your Scout application. So I strongly suggest to use the official Scout API, like the exec* methods and the getConfigured* methods.

In order to load data in an AbstractPageWithTable, use the execLoadData() method.
In order to load data in an AbstractTableField, provide the rows as FormData through a service and use the importFormData() method.

When the Form is already open and your table must reload data (for instance when you click on a button), you call the service again and call importFormFieldData() on the table field you want to update. This should cover almost every use case where you must load data in a table field.

Cheers,
André


Eclipse Scout Homepage | Documentation | GitHub

[Updated on: Fri, 28 May 2021 07:19]

Report message to a moderator

Re: NullPointerException [message #1841817 is a reply to message #1841769] Mon, 31 May 2021 07:12 Go to previous message
Mark Novem Grisola is currently offline Mark Novem GrisolaFriend
Messages: 30
Registered: November 2017
Member
Hello André,

Thank you so much, you provided me more than enough information. So the cause of the error is me being lack of reading and information, haha what a naive i am. So it is really those codes specifically the method i injected/used that cause the error and the missed-use of "internal" method.

I have to review my application now cause i think i did the same approach on some of my forms.

Up to the last word of your reply André is very much helpful to me and you always showed me the right way.

Thank you very much once again.

Sincerely,
Mark
Previous Topic:please help me figure out this error
Next Topic: Could not find "HeatmapFieldAdapter" in namespace ""
Goto Forum:
  


Current Time: Mon Dec 02 21:17:11 GMT 2024

Powered by FUDForum. Page generated in 0.03239 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top