Throw exception when viewing jsp pages generated by X-Applic

Hi,

The following is the detail of my scenario:

X-Application Version: 3.1.3
Tamino Version : 3.1.1.1
Platform : NT
WebContainer : Tomcat 4.0.1
JDK Version : 1.4.0_01
JAXP Version : 1.2_01 (I did NOT install it as a Java extension, but I set the “classpath” environment variable pointing to the jar files for use of other existing applications)


I did the following actions:

Tips for Using Tomcat 4 – To configure Tomcat 4.x
1. Edit the TOMCAT_HOME variable in the file xapplication.properties to point to your Tomcat 4 directory.
2. Run build.cmd setup.tomcat. A file Tomcat/conf/apps-xapplication.xml is created which contains a list of context elements.
3. Open the file Tomcat/conf/server.xml and insert the contents of the generated file directly below the entry “Tomcat Manager Context”

Configuration Tips – Speeding Up JSP Processing
JDK version 1.3 is recommended for use with Tamino X-Application. However, if you prefer to use JDK 1.4, you must set the TOMCAT_OPTS variable to “-server”.

To configure Tamino X-Application
1. Open the file xapplication.properties in a text editor.
2. Adjust the variables to suit your environment, using the comments in the file as a guide.
3. Open a command prompt.
4. Enter setup.cmd.

After I did the above actions, I successfully generated an X-Application for a Tamino schema by executing “generate” command in command line, however, I cannot run the application through web browser, say for example, http://localhost:8080/test/search.jsp. Would you please give me a solution to solve the problem? Thanks a lot.

The error message is as follow:

========================================================================================
StandardWrapperValve[jsp]: Allocate exception for servlet jsp
javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:871)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
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:201)
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:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
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.valves.AccessLogValve.invoke(AccessLogValve.java:462)
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:163)
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.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
----- Root Cause -----
java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:103)
at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:183)
at org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCache.java:165)
at org.apache.jasper.compiler.TldLocationsCache.(TldLocationsCache.java:138)
at org.apache.jasper.EmbededServletOptions.(EmbededServletOptions.java:324)
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.init(IDEJspServlet.java:213)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
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:201)
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:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
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.valves.AccessLogValve.invoke(AccessLogValve.java:462)
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:163)
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.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
========================================================================================

Hello,

did you try out the simple examples? After starting Tomcat invoke the following URL via Browser:

http://localhost:8080/xapp

Then follow the link to the simple examples and invoke one of them. In this way, we test whether it’s a general problem or a problem of the generated application.

Thanks,
Christian.

Hi,

Actually, I could NOT go to the following link through web browser:

http://localhost:8080/xapp

It just said that the link is NOT available…

Please start Tomcat and try again.

Michael

Software AG Germany, Darmstadt

Hi,

I tried to restart Tomcat, however, same result came out…

Thanks for your kind help.

Andy

Hello,

could you post the server.xml file of your Tomcat where you made the changes?

Than we could check if the Context is correctly set. I could invoke this server.xml on my machine.

Bye,
Christian.

Hi,

This is the content of the server.xml file.
Thanks for your kind help.

========================================================
















<Connector className=“org.apache.catalina.connector.http.HttpConnector”
port=“8080” minProcessors=“5” maxProcessors=“75”
enableLookups=“true” redirectPort=“8443”
acceptCount=“10” debug=“0” connectionTimeout=“60000”/>
























<Logger className=“org.apache.catalina.logger.FileLogger”
prefix=“catalina_log.” suffix=“.txt”
timestamp=“true”/>




















<Valve className=“org.apache.catalina.valves.AccessLogValve”
directory=“logs” prefix=“localhost_access_log.” suffix=“.txt”
pattern=“common”/>


<Logger className=“org.apache.catalina.logger.FileLogger”
directory=“logs” prefix=“localhost_log.” suffix=“.txt”
timestamp=“true”/>







<Context path=“/manager” docBase=“manager”
debug=“0” privileged=“true”/>

























<Context path=“/examples” docBase=“examples” debug=“0”
reloadable=“true”>
<Logger className=“org.apache.catalina.logger.FileLogger”
prefix=“localhost_examples_log.” suffix=“.txt”
timestamp=“true”/>
<Ejb name=“ejb/EmplRecord” type=“Entity”
home=“com.wombat.empl.EmployeeRecordHome”
remote=“com.wombat.empl.EmployeeRecord”/>


<Environment name=“maxExemptions” type=“java.lang.Integer”
value=“15”/>
<Parameter name=“context.param.name” value=“context.param.value”
override=“false”/>
<Resource name=“jdbc/EmployeeAppDb” auth=“SERVLET”
type=“javax.sql.DataSource”/>

usersa
password
driverClassName
org.hsql.jdbcDriver
driverName
jdbc:HypersonicSQL:database

<Resource name=“mail/Session” auth=“Container”
type=“javax.mail.Session”/>


mail.smtp.host
localhost















<Connector className=“org.apache.catalina.connector.warp.WarpConnector”
port=“8008” minProcessors=“5” maxProcessors=“75”
enableLookups=“true”
acceptCount=“10” debug=“0”/>


<Engine className=“org.apache.catalina.connector.warp.WarpEngine”
name=“Apache” debug=“0” appBase=“webapps”>


<Logger className=“org.apache.catalina.logger.FileLogger”
prefix=“apache_log.” suffix=“.txt”
timestamp=“true”/>










========================================================

Andy

Hello,

after installing JSDK 1.4 and Tomcat 4.0.1 I could reprocude your problem.

What I did to make X-Application running is to modify the rt.jar file:

It contains the package

javax.xml

e.g.

javax.xml.DocumentBuilderFactory.java

When I revomed the files of javax.xml from the rt.jar, Tomcat could compile and evaluate the JSP pages.

I know it is not a good way to change jar files, but currently I don’t no other way.

Bye,
Christian.

Hi,

Thanks for your kind help. Maybe I try to use Tomcat 3.3 and JDK 1.3 to avoid those unpredictable problems…

Andy

Hi Andy,

maybe - if it is possible - you could try Tomcat 4 and JDK 1.3.1.
It is rather strange that JavaSoft decided to put the Parser classes directly into rt.jar with JDK 1.4. Perhaps there is some hidden wisdom to it!

Cheers,
Trevor.

Does this problem happen with Tomcat 4.0.4?
I’ve tested X-Application with 4.0.4 and didn’t encounter anything like this …

Michael

Software AG Germany, Darmstadt