• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4390
  • Last Modified:

Struts 1.2.9 on OC4J 10.1.2 Not working

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
MehtaJasmin
Asked:
MehtaJasmin
1 Solution
 
MehtaJasminAuthor Commented:
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
 
anand_2000vCommented:
simple question:
Have you deployed your .war files too?
0
 
MehtaJasminAuthor Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
bpeterseCommented:
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
 
bpeterseCommented:
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
 
MehtaJasminAuthor Commented:
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
 
AnnieModCommented:
PAQed with points refunded (500)

AnnieMod
Cleanup Admin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now