Bookmark Topic Watch Topic
  • New Topic

problem in importing package in jsp

 
Arun Maalik
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Report post to moderator

Dear sir in the above code as shown i have created a user defined package test in which there is a public class second. Coding of test package as follow



now when i am trying to access above package in my test.jsp file it is throwing following type of error message




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

exception

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

Generated servlet error:
[javac] C:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-apps\j2ee\war-ic_war\org\apache\jsp\test_jsp.java:6: package test does not exist
[javac] import test.second;
[javac] ^


Generated servlet error:
[javac] C:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-apps\j2ee\war-ic_war\org\apache\jsp\test_jsp.java:48: cannot find symbol
[javac] symbol : class second
[javac] location: class org.apache.jsp.test_jsp
[javac] second p=new second();
[javac] ^


Generated servlet error:
[javac] C:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-apps\j2ee\war-ic_war\org\apache\jsp\test_jsp.java:48: cannot find symbol
[javac] symbol : class second
[javac] location: class org.apache.jsp.test_jsp
[javac] second p=new second();
[javac] ^
[javac] 3 errors




org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:88)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:337)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:442)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:502)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:481)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:469)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

now i would like to know why such types of error is throwing. Although my jsp code is ok to include package.

I am using sun microsystem deployee tools

with regard
Arun kumar maalik
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally posted by Arun Maalik:
[CODE]
...I am using sun microsystem deployee tools


If you'd like, I can move this to the IDEs forum.

Otherwise, you'll need to find out where that tool is putting your class files and let us know. You class files should be under WEB-INF/classes/{your package}/{your classfiles}. If that tool is jarring them up then the jar files need to be under /WEB-INF/lib/{your jar files}.

See if you class files are in the right location.
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator
Didn't we already answer this one?
[ August 15, 2006: Message edited by: Rusty Smythe ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Indeed.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!