Link to home
Start Free TrialLog in
Avatar of Ryan Chong
Ryan ChongFlag for Singapore

asked on

Urgent: org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated

Hi,

I facing a weird problem and need urgent solution. The error is:


Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error

--------------------------------------------------------------------------------

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.


An error occurred between lines: 16 and 998 in the jsp file: /parseutimportlist.jsp

Generated servlet error:
/shared/home/tomcat4/work/Apache/play.mydomain.com/unittrust/parseutimportlist$jsp.java:534: Variable myPool may not have been initialized.
                            conn = myPool.getConnection();
                                   ^

...

Generated servlet error:
/shared/home/tomcat4/work/Apache/play.mydomain.com/unittrust/parseutimportlist$jsp.java:669: Variable displist_yyyymmdd may not have been initialized.
                                        if (displist_yyyymmdd.equalsIgnoreCase("")) { //File 1 is Range
                                            ^

...

An error occurred between lines: 16 and 998 in the jsp file: /parseutimportlist.jsp

Generated servlet error:
/shared/home/tomcat4/work/Apache/play.mydomain.com/unittrust/parseutimportlist$jsp.java:900: Variable vecbuy may not have been initialized.
                                              buyx = (vecbuy.get(b) == null?"":vecbuy.get(b).toString());
                                                      ^

...

An error occurred between lines: 16 and 998 in the jsp file: /parseutimportlist.jsp

Generated servlet error:
/shared/home/tomcat4/work/Apache/play.mydomain.com/unittrust/parseutimportlist$jsp.java:1269: Variable conn may not have been initialized.
                            myPool.freeConnection(conn);            
                                                  ^

An error occurred between lines: 1,097 and 1,099 in the jsp file: /parseutimportlist.jsp

Generated servlet error:
/shared/home/tomcat4/work/Apache/play.mydomain.com/unittrust/parseutimportlist$jsp.java:1294: Variable isdisplistrange may not have been initialized.
                                                          if ((isfulllistfound ==true) || ((isdisplistfound ==true) || (isdisplistrange==true))) {
                                                                                                                        ^
Note: /shared/home/tomcat4/work/Apache/play.mydomain.com/unittrust/parseutimportlist$jsp.java uses or overrides a deprecated API.  Recompile with "-deprecation" for details.
65 errors, 2 warnings

      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
      at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      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.doFilter(ApplicationFilterChain.java:193)
      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:190)
      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:2347)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
      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:174)
      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.warp.WarpRequestHandler.handle(WarpRequestHandler.java:217)
      at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
      at java.lang.Thread.run(Thread.java:536)


--------------------------------------------------------------------------------

Seems that all variables has been deprecated, any possible reason why this happen? I have declared all the variables at the top of the page, and this problem sometimes resolved after the Server (Apache Tomcat) is restarted.

How can i resolve this?
Avatar of shivsa
shivsa
Flag of United States of America image

if u could post your code it will easy to figure out errors.
Avatar of TimYates
yeah...post your JSP code :-)
Avatar of Ryan Chong

ASKER

Thanks for the help, can help see this file? The file tested ok on my development pc but failed at client production server. Do Need an urgent fix! thks!!

http://www.activefusion.net/temp/unittrust/parseutimportlist.zip

You can send back the file to my to my email (see it from my profile) or at : ryancys at yahoo dot com.

thks a lot!
Will it be the variables declaration problem? What will be the common error when see the error: sun.tools.javac.Main has been deprecated ?
Avatar of vzilka
vzilka

What common libraries do you use? It might be a collision between 2 JAR files.
Also,

conn = myPool.getConnection();

isn't in that file...  it must have been imported by one of the @include directives...

Are you sure the @imports are in the right order?  Do you have all the ones you need?

Is there a similar page that you can check to see that you have all the stuff you want, in the correct order?

Tim
this file does not contain all the variables that are in error...... have you checked that your include files are compiling okay??
or can you provide them??
hey tim sorry to over look your comment....... I just downloaded the file and started typing my comments right away......:-)
My bad... sorry abt that
hee hee :-)  no worries :-)  I got a bit "code blind" after looking at it too ;-)
Will it be better if i pass you guys the war file??
I think that would be helpful, we will still be not running it for the reason that we will not have database to get connected to but it will help atleast figureing out why jsps are not even getting compiled.....
>> Will it be the variables declaration problem?

Could be. It says:

>> Variable myPool may not have been initialized.
>> Variable displist_yyyymmdd may not have been initialized.
>> Variable conn may not have been initialized.
>> Variable vecbuy may not have been initialized.
>> Variable isdisplistrange may not have been initialized.

Initialize them to null at the time of declaration.

Connection conn = null ; // and so on....

Mayank.
Hi Mayank,

i did defined as Connection conn = null; previously..


The original war file (remove those unwanted files) is at:

http://www.activefusion.net/temp/unittrust/ee_ut.war

For your information, please note:

1. Do Not use anycode inside in any commercial purpose, however, it's free for reference.

2. The backend database is Oracle, then SID, username and password is encrypted and write into a setting file call dbinit.jsp in the include folder, when a connection is established, it read the SID, username and password from the setting file and decript it to establish the connection.

* The war file link will be removed after the problem is resolved.

Since the SID, username and password is encrypted, if someone really interested to help and research on it, you can pass them by email to me, so that i can generated the encrypted info wanted.

thks!
forget to tell, inside the war file, got a table.sql, it's used to generated the table structure in Oracle database, see the Unit Trust Search Test Planning v1.2.doc inside the war file for more information.
I tried compiling your jsp and was able to successfully do so... only problem I faced was with JDK1.4, I am using 1.3.1_08 so had to change your .split() method and had to comment out the pattern.compile portion in order to get it going.... but after commenting this it compiled just fine... and gave me the class file..

so seeing this I am inclining to believe that it has got something to do with JDK version you are using + the java server
mine was jdk1.3.1_08 +tomcat 4.1.24...

One more thing... after getting the jsp compiled I am getting a white page ( no output ) and also no exception is being thrown any where.........

if your database is open on net I try connecting to it to see the actual results...
Thks Kuldeepchaturvedi for the comment.

>>if your database is open on net I try connecting to it to see the actual results...
Unfortunately, this is out of my control, as the actually client is not allowed us to do it. Even i cant go and FTP the code change (IP restriction and not allowed to do so.., the server is at HK)

Jdk version and Tomcat version? is that possible? My development platform is j2ee1.3.1 plus Tomcat 4.0.6, it works fine here. I need to ask my Client regarding the Jdk and Tomcat version, however, i cannot do anything on it.

I have already make an implicit declaration for all the variables like:

java.sql.Connection conn = null;
java.sql.ResultSet rs = null;      
java.sql.PreparedStatement ps = null;

java.io.BufferedReader indisp = null;

...

i had sent this file to client to test already, hope it will passed!
Get the feedback from client, problem remains with same error! :-(

What i'm gonna to do? i'm a bit frustrated already..

The full error page is shown at:
http://www.activefusion.net/temp/unittrust/Apache%20Tomcat-4_0_4%20-%20Error%20report.htm
okay can you do one thing? can you ask your customer to provide you the java file that tomcat is creating in its work folder??

looking at it may give us some useful hints...

ask them to send the file "parseutimportlist$jsp.java" which should have been created somewhere in the tomcat scratch directory..
we will try to see whats wrong with than generated java source for your jsp
Hi guys,

Any ideas so far?

Kuldeepchaturvedi, seems that the HK admin ignore my mails :'( ..

And one of my friend indicate this may be is the server & javabean component haven't be registered in the http.conf page, is that true? got such thingy??
ASKER CERTIFIED SOLUTION
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

FYI, the target server will be a Unix Server with running both Apache (HTTP) server and Tomcat, so got any clue if i can resolve this problem from the conf file?

And i had cut off the parseutimportlist.jsp that got problem, and migrate parts of codes into an application, to generate the file needed (the parseutimportlist.jsp is used to read sources files, then generate output files and update database). I shorten the code from 1100+ lines to now 300+ lines, hope this will finally resolve my problem!

However, i'm now realised that i got another file contains 1500+ lines of codes, this time i'm affraid i cant cut the scripts as much as possible.. all codes need to be within, so how to cut off the scripts? i heard my another friend said using include files, will it works? Any comments?
Kuldeepchaturvedi,

I think you hit the jackpot! I did give me some idea on solving this weird problem. My solution will be split the 1100+ lines jsp into several jsp, which then i can put the code together by include them.

Hmmm, not truly solution but it did solve my problem, cheers ya! ;-)
Happy to be of any help to you...:-) ans sorry for delayed response.. I was away in new yr parties........:-)