Solved

Struts 1.2.9 on OC4J 10.1.2 Not working

Posted on 2006-11-22
8
4,353 Views
Last Modified: 2013-12-01
Hi All,

I have been trying all sort of different things to deploy my .ear file on OC4J that has struts used in .war file. The same .ear file deploys correctly and works fine on runtime for my Standalone OC4J10.1.2 on windows but when I try to deploy it on UNIX box for Standalone OC4J10.1.2 it does deploy right but it breaks runtime on access to login.jsp as soon as it finds the first struts tag.

Pl help me asap. I have no idea, if this version of struts is not supported by this version of OC4J or what?

Here is the config for web.xml
------------------------------------------

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
---------------------------------------------------------------------------
My all struts related jars are located at WEB-INF/lib

commons-fileupload.jar
commons-logging.jar
commons-digester.jar
commons-beanutils.jar
commons-validator.jar
jakarta-oro.jar
antlr.jar
struts.jar

I am not specifying any classpath as the server should pick up libraries from WEB-INF/lib.

Here is my login.jsp
----------------------------

<%@ page contentType="text/html;charset=windows-1252"%>

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<style type="text/css" media="screen">
@import url(<html:rewrite page="/COES/css/coes.css" />);
</style>

<script type="text/javascript" language="Javascript"
src="/COES/javascript/coes.js">
</script>

<script type="text/javascript" language="Javascript"
src="/COES/javascript/datefunctions.js">
</script>


<title><bean:message key="coes.title"/></title>

<!-- Begin Validator Javascript Function-->
<html:javascript formName="LoginForm"/>
<!-- End of Validator Javascript Function-->

</head>
<body>
<table>
<tr><td class="errors"><html:errors/></td></tr>
<tr>
<td>
<table width="100%" class="headertable" border="0">
<tr>
<td width="1%"><html:image page="/img/nexcomlogo.gif" styleClass="css/headerLogoImage" altKey="coes.build"/></td>
<td align="center"><bean:message key="coes.title"/> - <bean:message key="coes.version"/>


</td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<html:form action="Login" onsubmit="return validateLoginForm(this);">
Enter your location passcode:
<html:password property="passcode"/>
<html:submit property="login"
styleClass="smallblackbutton"
value="Log In"
onmouseover="javascript:goLite(this)"
onmouseout="javascript:goDim(this)"
/>

</html:form>
</td>
</tr>
</table>
</body>
</html>
-------------------------------

It breaks at line
@import url(<html:rewrite page="/COES/css/coes.css" />);
and on browser I see err

java.lang.NullPointerException at org.apache.struts.taglib.TagUtils.pageURL(TagUtils.java:1070) at org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:449) at org.apache.struts.taglib.html.RewriteTag.doStartTag(RewriteTag.java:55) at _jsp._login._jspService(_login.java:51) [SRC:/jsp/login.jsp:12] at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Thread.java:568)

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

The log file always shows below err, no matter what change I make:

[17 Nov 2006 10:22:24] ERROR [Digester] Digester.getParser:
org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:128)
at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
at org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
at org.apache.commons.digester.Digester.getParser(Digester.java:682)
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)
at com.evermind.server.Application.getHttpApplication(Application.java:890)
at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)
at java.lang.Thread.run(Thread.java:568)
[17 Nov 2006 10:22:24] ERROR [ActionServlet] Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
java.lang.NullPointerException
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)
at com.evermind.server.Application.getHttpApplication(Application.java:890)
at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)
at java.lang.Thread.run(Thread.java:568)

Thanks
Jasmin
0
Comment
Question by:MehtaJasmin
8 Comments
 

Author Comment

by:MehtaJasmin
ID: 18011889
This error may be the cause of the problems:

org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
at oracle.xml.jaxp.JXSAXParserFactory.setFeature

The underlying SAX processor is an Oracle implementation's which may be incorrect for the version of Struts, JSTL processing
being used by the project. I had similar problems with non-standard (optimized) SAX/XML processor implementations.

The Oracle XML Parser specifically does not support this feature being referenced in the log:
http://apache.org/xml/features/validation/dynamic

Set system property to whichever parser is required. (at the command line startup for Server)
Try Apache's XML processor for App Server 10.1.2 as shown bellow:

-D javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

There are also other ways to re-assign the SAX processor using config files within OC4j 10.1.2 - need to research.
Make sure that the switch from Oracle SAX processor to Apaches's actually happens by getting the jsp from the following Oracle note: http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html

-Brian M.
0
 
LVL 13

Expert Comment

by:anand_2000v
ID: 18017919
simple question:
Have you deployed your .war files too?
0
 

Author Comment

by:MehtaJasmin
ID: 18019288
We have deployed the .ear file which contains the .war file. But we did config for .war file also, like this:

<web-module id="COES" path="../coesdev-applications/COES.war"/>
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 6

Expert Comment

by:bpeterse
ID: 18030639
Brian;
Here are some articles that might help:
Metalink Note 365773.1 - It specifically addresses the org.xml.sax.SAXNotRecognizedException error. It also describes how to upgrade the parser.
(URL)
https://metalink.oracle.com/metalink/plsql/f?p=130:14:6641379800439792338::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,365773.1,1,1,1,helvetica
and
http://www.oracle.com/technology/products/jdev/tips/mills/struts1_2.html
0
 
LVL 6

Expert Comment

by:bpeterse
ID: 18080180
Just re-read all your comments and noticed something:
>There are also other ways to re-assign the SAX processor using config files within OC4j 10.1.2 - need to research.
>Make sure that the switch from Oracle SAX processor to Apaches's actually happens by getting the jsp from the following Oracle note: >http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html

This shared-library mechanism [referenced in the readme.html] applies only to v 10.1.3 and later - and you have 10.1.2.
0
 

Author Comment

by:MehtaJasmin
ID: 18085519
All,

Thank you so much for all your responses.

I got my issue resolved by answer from Brain M. By putting

-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

in Java command in the startup script of the app server for the project.

Thanks
Jasmin
0
 

Accepted Solution

by:
AnnieMod earned 0 total points
ID: 19387467
PAQed with points refunded (500)

AnnieMod
Cleanup Admin
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now