leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
434 stars 21 forks source link

NPE when creating CheerpJInputStream #176

Closed jlafourc closed 6 months ago

jlafourc commented 6 months ago

Hello,

We are benchmarking CheerpJ (looks cool !) with one of our java application. The application starts but it encounters a NPE when CheerpJHttpConnection is instantiating a CheerpJInputStream

Exception in thread "Thread-0" 
cheerpOS.js:1940 java.lang.NullPointerException
cheerpOS.js:1940 

cheerpOS.js:1940    at com.leaningtech.handlers.http.CheerpJInputStream.<init>(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.leaningtech.handlers.http.CheerpJHttpConnection.getInputStream(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.leaningtech.handlers.http.CheerpJHttpConnection.getHeaderField(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.webobjects.eodistribution.client.CktlHTTPSChannel._responseToMessageNew(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.webobjects.eodistribution.client.CktlHTTPSChannel.doEstablishConnectionNew(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.webobjects.eodistribution.client.CktlHTTPSChannel.establishConnection(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.webobjects.eoapplication.client.EOClientApplicationSupport.channelWithParameters(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.webobjects.eoapplication.client.EOClientApplicationSupport.prepareClasses(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.webobjects.eoapplication.EOApplication.startApplication(Unknown Source)
cheerpOS.js:1940 

cheerpOS.js:1940    at com.webobjects.eoapplication.client.CktlClientApplicationSupport2.main(Unknown Source)

I can't check the source myself. Could you please hint me on what is going wrong ?

Thanks a lot

Julien

alexp-sssup commented 6 months ago

We need to have access to the application to debug the problem, with just the stack trace there is not much we can do.

To clarify, we don't need the source code, just the compiler version

jlafourc commented 6 months ago

I could send you an archive but that would not help because you need the server side to make it run. But my question was more what could cause the NPE in CheerpJInputStream constructor ?

I hope I'm clear :)

alexp-sssup commented 6 months ago

There is no obvious reason. Please share a reproducible example and consider joining our Discord for further help. https://discord.gg/X9ruPkchM5

jlafourc commented 6 months ago

Sorry mt bad. Wrong cookie. Found the issue right after I built a sample to reproduce the issue. If you set a cookie with null value, this causes a NPE.

Thank you for your quick ansers.