Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Still no line number on stack traces in oracle 9i (with JIT off)

0 views
Skip to first unread message

Chris McCluskey

unread,
Feb 5, 2002, 1:41:23 PM2/5/02
to
Need I say more in the subject line? =) I am having a huge problem
with porting my jsp application from an apache-jakarta server and a MS
SQL Server 2000 database. I'm moving it to oracle 9i, and while i'm
having no real problems changing all the SQL Statements to those of
what oracle will accept, I'm running into the always fun
NullPointerException. This isn't a huge problem, except that it
displays no line numbers in the output (like so):

Exception:
java.lang.NullPointerException
at _sony._inside._jspService(_inside.java, Compiled Code)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled
Code)
at oracle.jsp.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
at org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java:479)

Please note, this is AFTER I have turned the JIT Compiler off. It
took away some of the "Compiled Code"'s but did not give line numbers.

I have searched these groups with no avail, and have even considered
workarounds to this, such as using some sort of die function that
would stop all processing of the code and return what's left to the
user. (didn't seem to work to well with commenting all the rest of
the code with /* ... */ either.

*sigh* Can you help me? I would be ever so grateful!

Thank you all in advance

-Chris McCluskey

Jon Skeet

unread,
Feb 5, 2002, 2:26:46 PM2/5/02
to
Chris McCluskey <ch...@netsolutionsllc.com> wrote:
> Please note, this is AFTER I have turned the JIT Compiler off. It
> took away some of the "Compiled Code"'s but did not give line numbers.

Have you definitely compiled your code with line-numbers included?

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Chris McCluskey

unread,
Feb 5, 2002, 5:50:39 PM2/5/02
to
Jon Skeet <sk...@pobox.com> wrote in message news:<MPG.16ca4251...@dnews.peramon.com>...

> Chris McCluskey <ch...@netsolutionsllc.com> wrote:
> > Please note, this is AFTER I have turned the JIT Compiler off. It
> > took away some of the "Compiled Code"'s but did not give line numbers.
>
> Have you definitely compiled your code with line-numbers included?

I don't think i follow your question there.. I have wrote my JSP code
how one would normally, but when I run it, it gives me this error.
(In other words, the compiler I'm working with is run off the server).
I don't use the javac compiler to make my servlets. was that what
you were talking about? I guess if i did use the javac compiler i
could specify -verbose, and that may give me more information, but
since I am using oracle 9i (on a windows 2000 advanced server), the
only way i know how to turn the JIT off is by setting an environmental
variable JAVA_COMPILER = NONE.

*sigh* as you may be able to tell, java isn't my language of choice
nor experiance, thank you for being cooperative. =)

-Chris

Gerald Nunn

unread,
Feb 5, 2002, 10:39:48 PM2/5/02
to

"Chris McCluskey" <ch...@netsolutionsllc.com> wrote in message
news:3fee1d10.02020...@posting.google.com...

> Need I say more in the subject line? =) I am having a huge problem
> with porting my jsp application from an apache-jakarta server and a MS
> SQL Server 2000 database. I'm moving it to oracle 9i, and while i'm
> having no real problems changing all the SQL Statements to those of
> what oracle will accept, I'm running into the always fun
> NullPointerException. This isn't a huge problem, except that it
> displays no line numbers in the output (like so):

Are you using the OC4J container (aka Orion)? If so, not 100% sure this will
do the trick, but try stopping your server, try turning on the debugging
switch, delete any cached pages and start it up again.

Gerald


Jon Skeet

unread,
Feb 6, 2002, 3:44:51 AM2/6/02
to
Chris McCluskey <ch...@netsolutionsllc.com> wrote:
> Jon Skeet <sk...@pobox.com> wrote in message news:<MPG.16ca4251...@dnews.peramon.com>...
> > Chris McCluskey <ch...@netsolutionsllc.com> wrote:
> > > Please note, this is AFTER I have turned the JIT Compiler off. It
> > > took away some of the "Compiled Code"'s but did not give line numbers.
> >
> > Have you definitely compiled your code with line-numbers included?
>
> I don't think i follow your question there.. I have wrote my JSP code
> how one would normally, but when I run it, it gives me this error.
> (In other words, the compiler I'm working with is run off the server).
> I don't use the javac compiler to make my servlets. was that what
> you were talking about? I guess if i did use the javac compiler i
> could specify -verbose, and that may give me more information, but
> since I am using oracle 9i (on a windows 2000 advanced server), the
> only way i know how to turn the JIT off is by setting an environmental
> variable JAVA_COMPILER = NONE.

Not -verbose - that wouldn't help - you need to turn debugging on in the
compiled classes. With normal javac, that's the "-g" parameter. You
should probably be able to tweak your servlet container to compile your
JSPs with that - although then your line numbers will come from the
synthetic .java file, not from your JSP itself anyway... I don't know
whether you'll be able to see that synthetic .java file or not :(

Chris McCluskey

unread,
Feb 6, 2002, 2:26:43 PM2/6/02
to
"Gerald Nunn" <gn...@workbrain.com> wrote in message news:<8A188.105216$I8.21...@news4.rdc1.on.home.com>...

WHOA! This is why i stick to PHP. Ok, so i'm not totally sure why
this is such a big deal with oracle.. It reported line numbers just
fine in apache-jakarta, why not here? *sigh*. Even if i can get line
numbers to the servlets, that would help me out quite a bit.

Jon >> Without sounding like a total newbie (i'm not, honest).. I
guess i don't know what you mean by recompiling the servlet
container.. you mean downloading the javax.servlet.* source files,
hunting in there somewhere to find "javac" and changing it to "javac
-g" then recompiling them? (does that include me actually making
physical contact with my fingers and the keyboard? =] )

Gerald >> I don't think i am using the OC4J container, although being
a non-native jsp developer, i might very well be.. All i know is that
it's just the default installation of oracle 9i. I have not heard of
a "debugging switch" however.

Thanks guys for being paicent (sp?)

-Chris

Jon Skeet

unread,
Feb 6, 2002, 2:47:19 PM2/6/02
to
Chris McCluskey <ch...@netsolutionsllc.com> wrote:

> Jon >> Without sounding like a total newbie (i'm not, honest).. I
> guess i don't know what you mean by recompiling the servlet
> container.. you mean downloading the javax.servlet.* source files,
> hunting in there somewhere to find "javac" and changing it to "javac
> -g" then recompiling them? (does that include me actually making
> physical contact with my fingers and the keyboard? =] )

I didn't suggest recompiling the servlet container - I suggested telling
your servlet container to compile your JSPs with debugging turned on.

In case you weren't aware: JSPs are usually (always?) converted into
Java source files which are basically servlets. They are then compiled
by the container, and run just as if they were normal servlets (but with
some checking for more recent JSP versions, usually). So, tweaking the
container to turn on debugging information for the servlet source->
servlet bytecode would give you line numbers - though as I said, they
wouldn't give you terribly *useful* line numbers, probably.

Chris McCluskey

unread,
Feb 6, 2002, 6:27:11 PM2/6/02
to
Jon Skeet <sk...@pobox.com> wrote in message news:<MPG.16cb98a31...@dnews.peramon.com>...

Right! ok, i see what you're saying now. I understand how jsp goes
from the java source code to the servlet code to the compiled
servlet.. just not too sure HOW to tell my servlet container to
comiple the jsps with debugging turned on. Any ideas?

Thanks,

-Chris

Neil Campbell

unread,
Feb 6, 2002, 7:16:32 PM2/6/02
to
Jon Skeet wrote:

> So, tweaking the
> container to turn on debugging information for the servlet source->
> servlet bytecode would give you line numbers - though as I said, they
> wouldn't give you terribly *useful* line numbers, probably.
>


In my (somewhat limited) experience, the generated servlet code will
still be available somewhere on the system, so if a line from that is
referred to, you can look it up and easily work out which part of the
JSP it comes from.

This much is true with the version of Tomcat I was using (3.2.x I think).

--
Neil Campbell

batneil[AT]lineone[DOT]net

Chris Smith

unread,
Feb 7, 2002, 8:13:22 AM2/7/02
to
Neil Campbell wrote ...

> In my (somewhat limited) experience, the generated servlet code will
> still be available somewhere on the system, so if a line from that is
> referred to, you can look it up and easily work out which part of the
> JSP it comes from.
>
> This much is true with the version of Tomcat I was using (3.2.x I think).

That's true, but it's still a royal pain. One of the many reasons I
prefer Resin... they've somehow managed to make their stack traces report
line numbers in the JSP file itself, maybe by faking the debug info in
the compiled class file.

Chris Smith

Chris McCluskey

unread,
Feb 7, 2002, 12:20:46 PM2/7/02
to
Neil Campbell <no....@spam.com> wrote in message news:<3C61C760...@spam.com>...

Yes, so here's my dilema, I write jsp code, hit save, then go to the
page to test it out... the java language "compiles" it into java
servlet code which on an oracle installation resides inside the _pages
directory inside the htdocs directory. This java servlet code is
compiled into a java servlet class.. on my browser, when my code is
available, and runs on the server, i get an error reported back to me.
"NullPointerException".

No problem, those are annoying but generally easy to fix, so i look
for the line numbers, but there are none whatsoever. NOT EVEN TO THE
"compiled" Java Servlet Source code! At this point, it would even be
nice for me to have line numbers to the compiled binary .class files,
and for me to pick-up binary as a second langauge.

So the other possible solution I have is the method i can use when i
code PHP.. I can just put a die(); statement right before the error
and see if it displays the error message or not. I assume since java
is a non-linear language, I cannot simply stop proccessing the
document.

I guess why this problem is so important to me is that this jsp page
has over 800 lines of code, and another one which may turn out to have
the same error message has over 3000 lines of code.

Here's another interesting fact however, In my jsp code, when I try to
accomplish the same thing as a die(); statement, (in other words
commenting out the code i don't want it to process) i do get some line
numbers, but those that are reporting a totally different problem:

Exception:
oracle.jsp.provider.JspCompileException: Errors
compiling:d:\oracle\apache\apache\htdocs\_pages\_site\_inside.javad:\oracle\apache\apache\htdocs\_pages\_site\_inside.java:784:
Missing term.
displayPageContent = true;
^
d:\oracle\apache\apache\htdocs\_pages\_site\_inside.java:785: Missing
term.
*/
^
d:\oracle\apache\apache\htdocs\_pages\_site\_inside.java:785: Invalid
expression statement.
*/
^
3 errors

at oracle.jsp.app.JspJavacCompiler.compile(JspJavacCompiler.java)
at oracle.jsp.app.JspAppLoader.reloadPage(JspAppLoader.java)
at oracle.jsp.app.JspAppLoader.loadPage(JspAppLoader.java)
at oracle.jsp.app.JspAppLoader.getPage(JspAppLoader.java, Compiled
Code)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java,
Compiled Code)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java, Compiled Code)


at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled
Code)
at oracle.jsp.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)

at org.apache.jserv.JServConnection.processRequest(JServConnection.java,
Compiled Code)
at org.apache.jserv.JServConnection.run(JServConnection.java,
Compiled Code)
at java.lang.Thread.run(Thread.java:479)

Here you can see that it does return line numbers, but when i remove
the comments...:

Exception:
java.lang.NullPointerException
at _site._inside._jspService(_inside.java, Compiled Code)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java,
Compiled Code)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java, Compiled Code)
at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled
Code)
at oracle.jsp.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java,
Compiled Code)
at org.apache.jserv.JServConnection.run(JServConnection.java,
Compiled Code)
at java.lang.Thread.run(Thread.java:479)

"Compiled Code" Egads!! This doesn't help!!

And that is why I posted here. I have never had this problem with
apache-tomcat-jakarta, but I am having it with Oracle. Perhaps I
should post this to the oracle group as well?

Anyway thanks for all your help so far, and thanks for anyone who
helps me in the future! =)

-Chris

Neil Campbell

unread,
Feb 7, 2002, 1:39:33 PM2/7/02
to
Chris Smith wrote:

I've recently started using Tomcat 4.0.1, and I think that does the same
- gives line numbers that refer to the JSP file. It's pretty handy,
but unfortunately I only upgraded after I'd pretty much debugged all my
pages!

Neil

Neil Campbell

unread,
Feb 7, 2002, 1:45:34 PM2/7/02
to
Chris McCluskey wrote:

> Neil Campbell <no....@spam.com> wrote in message news:<3C61C760...@spam.com>...

>>In my (somewhat limited) experience, the generated servlet code will
>>still be available somewhere on the system, so if a line from that is
>>referred to, you can look it up and easily work out which part of the
>>JSP it comes from.
>

> Yes, so here's my dilema, I write jsp code, hit save, then go to the
> page to test it out... the java language "compiles" it into java
> servlet code which on an oracle installation resides inside the _pages
> directory inside the htdocs directory. This java servlet code is
> compiled into a java servlet class.. on my browser, when my code is
> available, and runs on the server, i get an error reported back to me.
> "NullPointerException".
>
> No problem, those are annoying but generally easy to fix, so i look
> for the line numbers, but there are none whatsoever. NOT EVEN TO THE
> "compiled" Java Servlet Source code! At this point, it would even be
> nice for me to have line numbers to the compiled binary .class files,
> and for me to pick-up binary as a second langauge.
>


In the 'platform independent' spirit of Java, would it be possible to
test your code in a different environment, then go back to Oracle to
deploy it when it's closer to production code?

>
> at oracle.jsp.app.JspJavacCompiler.compile(JspJavacCompiler.java)
> at oracle.jsp.app.JspAppLoader.reloadPage(JspAppLoader.java)
> at oracle.jsp.app.JspAppLoader.loadPage(JspAppLoader.java)
> at oracle.jsp.app.JspAppLoader.getPage(JspAppLoader.java, Compiled
> Code)
> at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java,
> Compiled Code)
> at oracle.jsp.JspServlet.doDispatch(JspServlet.java, Compiled Code)
> at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled
> Code)
> at oracle.jsp.JspServlet.service(JspServlet.java)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
> at org.apache.jserv.JServConnection.processRequest(JServConnection.java,
> Compiled Code)
> at org.apache.jserv.JServConnection.run(JServConnection.java,
> Compiled Code)
> at java.lang.Thread.run(Thread.java:479)
>


It looks as though it is just the Oracle compiled code which isn't
generating line numbers, so your best bet is probably to find out how to
set the compilation options as Jon suggested. Maybe an Oracle group
could tell you how that is done.


Cheers,
Neil

Chris McCluskey

unread,
Feb 7, 2002, 2:11:31 PM2/7/02
to
"Neil Campbell" <no....@spam.com> wrote in message
news:3C62CB4E...@spam.com...

*SIGH* ok, so thanks to your idea i've got a plan now. I have moved this
file over to my old jakarta installation, and found the bug.

i guess this will have to work, as i have no clue where to set the
compiliation options. Thank you all.. While it's a hack, it will have to
work..

Thanks again,
Chris


0 new messages