Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Help me with a Simple HelloWorld.jsp

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this error when compiling a javax.servlet.ServletException: java.lang.NullPointerException
Please help!!!
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
need more info
 
Tim Smith
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where are you seeing the error?
 
Tim Smith
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see the error in the error.Log file
 
Geoff Tate
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its hard to say whats causing it without seeing the code. Do you see anything in the browser at all.
 
Geoff Tate
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u post the complete code? I think a helloworld.jsp shouldn't be to lengthy.
 
Tim Smith
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's pure html? Are there anyother configuration issues I can look at?
 
Tim Smith
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks anyway.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should check the ISAPI filter. This filter will pass JSP & java from the INETPUB world and pass it to the JRUN environment.
 
Lookout! Runaway whale! Hide behind this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic