jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes Help me with a Simple HelloWorld.jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Help me with a Simple HelloWorld.jsp" Watch "Help me with a Simple HelloWorld.jsp" New topic
Author

Help me with a Simple HelloWorld.jsp

Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
I get this error when compiling a javax.servlet.ServletException: java.lang.NullPointerException
Please help!!!
Geoff Tate
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
need more info


<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR> fantastic, a towel? <HR></BLOCKQUOTE>
Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
Using IIS 4.0 and JRun 2.3
It works if I place it under Jrun/jsm-default/services/jse/servlets/jsp however if I place it under inetpub/wwwroot/anydir/helloworld.jsp it will not compile. What is required in the classpath to compile a jsp.
Geoff Tate
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
servlet.jar must be in your classpath - its from the JSDK.
I haven't used 2.3 for a while now - I am trying to remember how it worked - I am so used to new api structure w/JRun 3.0. I know you could run jsps out of the web server directory (I think you still can) but I don't remember if there was something extra to do. Somewhere in the 2.3 configuration applet (I think it was on the Java tab) there is a place to enter classpath information. It sounds like its finding the servlet classes if its giving you a ServletException error. Where are you seeing this error? in the browser?
[This message has been edited by Geoff Tate (edited March 07, 2001).]
Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
It is d:/JRun/lib/sun/jsdk2.1/servlet.jar;
The entire classpath is as follows:
d:/JRun/classes;
d:/JRun/classes/jsafe.jar;
d:/JRun/classes/FTPProtocol.jar;
d:/JRun/jsm-default/classes;
d:/JRun/lib/apache/xerces_1_0_3.jar;
d:/JRun/lib/apache/xalan_1_0_0.jar;
d:/JRun/lib/sun/jsdk2.1/servlet.jar;
d:/JRun/lib/sun/jdk1.2.2/rt.jar;
d:/JRun/lib/sun/jdk1.2.2/i18n.jar;
d:/JRun/lib/sun/jdk1.2.2/tools.jar;
d:/JRun/lib/jrun.jar;
d:/JRun/lib/jrunadmin/jrunadmin.jar;
d:/JRun/lib/jrunadmin/swing.jar;
d:/JRun/lib/jsp.jar;
d:/JRun/classes/mail.jar;
d:/JRun/classes/activation.jar;
d:/JRun/classes/pop3.jar;
d:/JRun/classes/Smtp.jar;
d:/oracle/ora81/jdbc/lib/classes12.zip;
d:/oracle/ora81/jdbc/lib/nls_charset12.zip;
d:/JRun/classes/ChartWorks.jar;
d:/JRun/lib/sun/jsse1.0.2/jsse.jar;
d:/JRun/lib/sun/jsse1.0.2/jnet.jar;
d:/JRun/lib/sun/jsse1.0.2/jcert.jar;
d:/ibm/db2/java/db2java.zip;
d:/ibm/db2/java/sqlj.zip;
d:/ibm/db2/java/runtime.zip;
d:/JRun/lib/xt.jar;
Geoff Tate
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
where are you seeing the error?
Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
I see the error in the error.Log file
Geoff Tate
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
Its hard to say whats causing it without seeing the code. Do you see anything in the browser at all.
Geoff Tate
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
can u post the complete code? I think a helloworld.jsp shouldn't be to lengthy.
Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
It's pure html? Are there anyother configuration issues I can look at?
Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
Here is the copy of the code.
<HTML>
<HEAD>
<TITLE>
myFirstJsp
</TITLE>
</HEAD>
<BODY>
<H1>
JBuilder Generated JSP
</H1>
</BODY>
</HTML>
Geoff Tate
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
hmmmm works ok for me (Jrun 3.0).
have you taken a look at the JRun-generated .java file? maybe you can get a clue from there as to what is null. I was in the middle of a big project when I had to convert from JRun 2.3 to 3.0 and there were some major differences.
Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
The funny thing is the .java file is blank however the xml file looks good. Here is the copy of the xml file.
<?xml version="1.0" ?>
<jsp:root xmlns:jsp="http://java.sun.com/products/jsp/dtd/jsp_1_0.dtd" package="jsp.calcs" name="index"><![CDATA[<HTML>
<HEAD>
<TITLE>
myFirstJsp
</TITLE>
</HEAD>
<BODY>
<H1>
JBuilder Generated JSP
</H1>
</BODY>
</HTML>
]]></jsp:root>
Geoff Tate
Ranch Hand

Joined: Feb 06, 2001
Posts: 55
So it runs fine out of the Jrun structure but not out of the inetpub structure? You may want to post this to the allaire site, although they may never answer it. I just can't recall if there was anything additional that had to be done in the 2.3 configuration. The only thing I remember was having to configure that classpath. You should probably upgrade to the new version since it supports the WAR file structure now prescribed by the servlet API. I wish I could be more help.
Tim Smith
Greenhorn

Joined: Mar 07, 2001
Posts: 19
Thanks anyway.
Steve Campbell
Ranch Hand

Joined: Dec 18, 2000
Posts: 41
You should check the ISAPI filter. This filter will pass JSP & java from the INETPUB world and pass it to the JRUN environment.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help me with a Simple HelloWorld.jsp
 
Similar Threads
octal, hex
Majji Exm1 :
return value
what is your dream?
Need Guidance