New to J2EE

I have downloaded J2EE and I am trying to get started with it. I got the tutorial and I am using it to start learning how to use J2EE. There is a problem though. I am at the first application, the conversion stuff. I didn't manage to useant to compile my files, but I did it with javac. Everything seems to work just fine until I get to load the JSP file and click on submit.

It should show me the sum I entered in the form converted into EURO and YEN. However I get a NullPointerException.

Can you please help ?

Calin

[560 byte] By [calin23] at [2007-9-26 12:38:36]
# 1
Some code, to have a look at, as well as something about the setup you use, would be helpfull information. Especially the exact error message and stack trace, might make diagnosing what is going wrong much easier.With regards, rh
bezalib at 2007-7-2 11:58:04 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

Have you got the tutorial from J2ee ? If so, it's the code in the ejb/src/converter dir. If not, i will paste it or you can get the tutorial which ever is easier for you. I will also post the error message if you agree to help me.

I will award more duke dollars to anyone who comes up with a decent answer to my question.

Calin

calin23 at 2007-7-2 11:58:04 > top of Java-index,Other Topics,Patterns & OO Design...
# 3

Could you paste the Stack trace of the exception? Because it would show where to look for the error. Also your setup might be important, because if this is an example from the tutorial, I am pretty sure that it will be rather a deployment problem, than a bug within the example. No offense meant, but the guys here normally put only working code on their website. (At least all I tried so far. :) )

With regards,

rh

bezalib at 2007-7-2 11:58:04 > top of Java-index,Other Topics,Patterns & OO Design...
# 4

Yes, I also think the code should work. So here is what I get:

java.lang.NullPointerException

at org.apache.jsp._0002findex_jsp._jspService(_0002findex_jsp.java:113)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:458)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:197)

at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:215)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2314)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:368)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:995)

at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1088)

at java.lang.Thread.run(Thread.java:484)

You should know that:

I was following the instructions in the GettingStarted9.html and GettingStarted10.html pages of the J2EE tutorial. I have set the APPCPATH environment variable to ConverterAppClient.jar (step 3) and I did run the command at step 4, getting the lines I should have (step 6).

The only thing wrong is that after loading the jsp page, I get this exception instead of the result.

Thank you,

Calin

calin23 at 2007-7-2 11:58:04 > top of Java-index,Other Topics,Patterns & OO Design...
# 5
I got the problem. It was just a typo. by mistake I typed TheCOnverter instead of TheConverter. I didn't think a typo would lead to an exception being thrown, though.Thanks for all the trouble, anyway.Calin
calin23 at 2007-7-2 11:58:04 > top of Java-index,Other Topics,Patterns & OO Design...
# 6
Well, it was no trouble at all. :) I am glad you found the bug. congratulations and thanks. :) With regards, rh
bezalib at 2007-7-2 11:58:04 > top of Java-index,Other Topics,Patterns & OO Design...