Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Struts 1.2.9 on OC4J 10.1.2 Not working

Posted on 2006-11-22
8
4,366 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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