Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to compile class for JSP

Status
Not open for further replies.

pisth

Programmer
Mar 18, 2003
43
US
Hell0 All,
I am trying to create an application in JSP which inturn calls a java file.

However when i execute the JSP page(using Tomcat webserver) i am getting an error which says...

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting

I think the following line in the JSP page is the one which causes the problem:

<jsp:useBean id=&quot;MATRIX&quot; scope=&quot;page&quot; class=&quot;MatrixBlast.MatrixBlastC&quot; />

MatrixBlastC is the name of the java file/class i am having.

if i take this line off in the jsp file...i get an o/p page...however i need to call the java file too for the program to work.

Kindly suggest how do i resolve this issue.

Thanks!

Regards,
Karthik.



 
Check that the package that you are referencing is jarred up in the WEB-INF/lib dir, or unjarred in the WEB-INF/classes dir.

Also try changing your scope from &quot;page&quot; to &quot;session&quot; - just to test !
 
Hell0 sedj,
Thanks for your e-mail.

I tried changing the line to &quot;session&quot; instead of &quot;page&quot;
I still get the same error.

Check that the package that you are referencing is jarred up in the WEB-INF/lib dir, or unjarred in the WEB-INF/classes dir

what do i need to do to check the package?. i dont have alib direcotry under web-inf...or classes under web-inf.?

Can you kindly explain...i have the lib directory in differen tfolders...not here...do i need to copy the class files n paste it somewhere?

Thanks!

Regards,
Karthik.
 
When you use your own classes or packages in tomcat you need to put them into a jar file and then into WEB-INF\lib, or put them (unjarred) into WEB-INF\classes.

So, if you don't have a classes directory under WEB-INF - then make one. Then compile your MatrixBlast.MatrixBlastC class, and put it into the classes dir. So your class MatrixBlastC should be sitting in a directory structure as follows - WEB-INF\classes\MatrixBlast.

If they were not in a package then they could just sit in the classes directory.
 
Karthik,

I see you're still not reading the documentation: thread695-546146

Makes being a programmer kind of rough eh?

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top