aspose file tools*
The moose likes Servlets and the fly likes Is this a servlet problem or a setup problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is this a servlet problem or a setup problem?" Watch "Is this a servlet problem or a setup problem?" New topic
Author

Is this a servlet problem or a setup problem?

t pratt
Greenhorn

Joined: May 20, 2008
Posts: 3
I'm using websphere v 5.1 and the application is working when I run it on the local test server but when it's runs on the production boxes these errors are showing up. The data is coming from the as 400 and the server is running on a win box. If it matters the application first valid user login information with active directory. Then it check the as 400 for the current employee record and display the data.

The error is list below with the code:

[5 20 08 14:49:32:135 MST] 17d6cdf5 SystemOut O TDM: Start Emp BeanTDM: End Emp Bean
[5 20 08 14:49:33:353 MST] 17d6cdf5 WebGroup E SRVE0026E: [Servlet Error]-[Unable to compile class for JSP
C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:3: '.' expected
import EmployeeInfoBean;
^

C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:5: '.' expected
import EmployeeInfoBean;
^


An error occurred between lines: 63 and 79 in the jsp file: EmployeeInfo.jsp

Generated servlet error:
C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:89: cannot resolve symbol
symbol : class EmployeeInfoBean
location: class org.apache.jsp._EmployeeInfo
EmployeeInfoBean bean =(EmployeeInfoBean) request.getAttribute("empBean");
^


An error occurred between lines: 63 and 79 in the jsp file: EmployeeInfo.jsp

Generated servlet error:
C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:89: cannot resolve symbol
symbol : class EmployeeInfoBean
location: class org.apache.jsp._EmployeeInfo
EmployeeInfoBean bean =(EmployeeInfoBean) request.getAttribute("empBean");
^
4 errors
]: org.apache.jasper.JasperException: Unable to compile class for JSP
C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:3: '.' expected
import EmployeeInfoBean;
^

C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:5: '.' expected
import EmployeeInfoBean;
^


An error occurred between lines: 63 and 79 in the jsp file: EmployeeInfo.jsp

Generated servlet error:
C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:89: cannot resolve symbol
symbol : class EmployeeInfoBean
location: class org.apache.jsp._EmployeeInfo
EmployeeInfoBean bean =(EmployeeInfoBean) request.getAttribute("empBean");
^


An error occurred between lines: 63 and 79 in the jsp file: EmployeeInfo.jsp

Generated servlet error:
C:\WebSphere\AppServer\temp\websphere\server1\CCHREAR\CCHR.war\_EmployeeInfo.java:89: cannot resolve symbol
symbol : class EmployeeInfoBean
location: class org.apache.jsp._EmployeeInfo
EmployeeInfoBean bean =(EmployeeInfoBean) request.getAttribute("empBean");
^
4 errors

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.loadJSP(JspServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at EmployeeInfoServlet.performTask(EmployeeInfoServlet.java:164)
at EmployeeInfoServlet.doGet(EmployeeInfoServlet.java:65)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.InvokerServlet.service(InvokerServlet.java:255)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

The code

!DOCTYPE HTML PUBLIC "- W3C DTD HTML 4.01 Transitional EN"
HTML
HEAD
TITLE Employee Information TITLE
HEAD
BODY
%@ page import="java.util.*" %
%@ page import="EmployeeInfoBean" %
%@ page errorPage = "Error.jsp" %
div align="center"
center
TABLE width="750"
TBODY
TR
TD width="750" colspan="4"
style="border-style: solid; border-width: 1; border-color: black" TD
TR
TR
TD colspan="4" rowspan="3" class="TDClass"
FORM name="EmpDetail" method="post"
TABLE width="750" border="0"
TBODY
TR
TD align="left" class="Heading" colspan="2" B FONT size="3"
color="#bb0102" Employee Information FONT B TD
TR
TR
TD align="left" class="Heading" colspan="2" bgcolor="#bb0102" TD
TR
TR
TD align="left" class="Heading" colspan="2" %
EmployeeInfoBean bean =(EmployeeInfoBean) request.getAttribute("empBean");

String
strEmpCod = "",
strEmpNum = "",
strEmpType = "",
strEmpLName = "",
strEmpFName = "";

int x = 0, pl = 0;
strEmpCod = bean.getEmcCod(x);
strEmpNum = bean.getEmEmp(x);
strEmpType = bean.getEmType(x);
strEmpLName = bean.getEmLnam(x);
strEmpFName = bean.getEmFnam(x);
The second errors happen some times but the JSP can't find the theme, images or java scripts for the ErrorMsg.jsp. Example: when I first login I use a invalid password and the ErrorMsg.jsp will display with no errors but when it hit the above error it can't load anything. Why is it calling theme, images and js as servlet?

[5 20 08 14:49:33:353 MST] 17d6cdf5 WebGroup I SRVE0180I: [CCHR] [ CCHR] [Servlet.LOG]: ErrorMsg.jsp: init

[5 20 08 14:49:33:385 MST] 17ddcdf5 WebGroup E SRVE0020E: [Servlet Error]-[GCMFunctions.js]: Failed to load servlet: java.lang.ClassNotFoundException: GCMFunctions.js
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.beans.Beans.instantiate(Beans.java:201)
at java.beans.Beans.instantiate(Beans.java:62)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:188)
at com.ibm.ws.webcontainer.webapp.WebApp.addServlet(WebApp.java:729)
at com.ibm.ws.webcontainer.webapp.WebAppServletRegistry.addServlet(WebAppServletRegistry.java:48)
at com.ibm.ws.webcontainer.servlet.InvokerServlet.service(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

!DOCTYPE HTML PUBLIC "- W3C DTD HTML 4.0 Transitional EN"
HTML
HEAD
meta http-equiv="Content-Type" content="text html; charset=iso-8859-1"
META name="GENERATOR"
content="IBM WebSphere Page Designer V4.0 for Windows"
LINK href="theme Master.css" rel="stylesheet" type="text css"
TITLE Error Page TITLE
SCRIPT LANGUAGE="JavaScript" SRC="GCMFunctions.js" SCRIPT
SCRIPT LANGUAGE="JavaScript"


Thanks for any help or input.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

First things first: the error messages seem to indicate that you may have some syntax errors in your JSPs, but I am not familiar with WebSphere error messages,

But before doing anything else, you need to place EmployeeInfoBean in a package other than the default. Once that's done, see what errors remain and we'll tackle those.
Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 435
Hi,

The class you are importing should have a package in which it exists in order to be imported. In other case, the class is in the same package as the calling class, so you need not use import statement.


Maki Jav
[ May 20, 2008: Message edited by: Maki Jav ]

Help gets you when you need it!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Originally posted by Maki Jav:
The class you are importing should have a package in which it exists in order to be imported.

Yes, thats the same information that I already posted.

In other case, the class is in the same package as the calling class, so you need not use import statement.

A class can never be in the same package as a JSP so the import is always required in this case.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The specific reasons for this are spelled out in these two FAQ entries.
http://faq.javaranch.com/java/PackageYourBeans
http://faq.javaranch.com/java/BeansNotFound

The same code may be working in one environment but not another if you're using different versions of the JVM in each.
Things tightened up in 1.4.1 (again see the FAQ entry for specifics).

In short, package your beans.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

As the other ranchers mentioned , it is mandatory to have your classes (user defined) be it beans, servlets etc., to keep in under a specific and explicit package rather than letting them belong to default package!

That's what this line shows



Apart from that, there is one more error is shown when the container is trying to load your javascript (.js) file.



Ensure that the .js file is correctly represented and available to the container with the appropriate directory structure.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
t pratt
Greenhorn

Joined: May 20, 2008
Posts: 3
Thanks for the suggestion! Putting the beans into a package did not work. The errors did not change. Also tried putting the servlet and bean into different packages.

Should add I using two other beans with this project and these beans are running find.

Therefore, I placed the DBconnpoolbean into the the EmployeeInfo.jsp and it ran fine. Believe the issues is with the code in the EmployeeInfoBean code.

[ May 21, 2008: Message edited by: t pratt ]
[ May 21, 2008: Message edited by: t pratt ]
Hongli Li
Ranch Hand

Joined: Oct 29, 2006
Posts: 124
make sure the class load policy is correctly specified. (Parent first or children first)


Do you know why this cup is useful? Because it is empty.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Originally posted by t pratt:
Thanks for the suggestion! Putting the beans into a package did not work. The errors did not change. Also tried putting the servlet and bean into different packages.


Did you change the import statement in your JSP accordingly to refer the bean with the correct package?
t pratt
Greenhorn

Joined: May 20, 2008
Posts: 3
Yes, and the errors are the same. This puzzle me because I never had this problem before. I'm going to start over with one jsp and servlet at a time. If I find the problem I'll post it.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

It should be working if you have the things in place.

That's great. That way you can find out where you are missing the stuff!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this a servlet problem or a setup problem?