I recently "solved" a somewhat common problem in OC4J regarding the use of Xerces rather than OC4J's built-in parser. The problem was solved by adding this line to global-web-application.xml:
<web-app-class-loader search-local-classes-first="true"/>
Unfortunately, this was too much of a big-hammer approach that could cause problems on the app server, so I tried to resolve it via creating the following orion-web.xml file in the WEB-INF directory of the app:
<?xml version="1.0"?>
<orion-web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd">
<web-app-class-loa开发者_如何学Pythonder search-local-classes-first="true" include-war-manifest-class-path="true"/>
<web-app/>
</orion-web-app>
Unfortunately, it turns out that using global-web-application.xml worked, using orion-web.xml didn't
OC4J version is 10.1.3.5.
Can anyone advise?
Another way is specify at Deploy Time. Take a look:
Specifying search-local-classes-first at Deployment Time
The following example illustrates how to set the search-local-classes-first attribute in the orion-web.xml file generated for the Web module at deployment time, with Application Server Control.
- Select Applications>Deploy to launch the Application Server Control deployment wizard.
- Supply the path to the application in the first page of the wizard.
- Specify the application name and supply any context URI mappings in the second page.
- Click Configure Class Loading in the third page of the wizard (Deploy: Deployment Settings).
- Under Configure Web Module Class Loaders, check the Search Local Classes First checkbox next to the name of the Web module containing the local JAR file to use.
- Optionally click the Save Deployment Plan button, and save the plan for reuse.
I think you could solve this in a different manner. Using properties, and removing libraries.
There are two properties:
xml.driver.property
xml.driver.impl
One define the parser interface and the other the implementation. You can switch this from one implementation from another.
for example we have:
xml.driver.property=org.xml.sax.driver
xml.driver.impl=org.apache.xerces.parsers.SAXParser
As this is a system properties you can load it in many different ways. We use a special servlet installed in all OC4J instances (containers) that loads this an other properties at runtime.
A "little" bit late but hope it helps.
Finally I'm abble run JAXB2 (used by Spring WS 2.1.4) on my OC4J 10.13 (and 10.13.50). JAXB needs xalan lib.
orion-web.xml
<?xml version="1.0"?>
<!DOCTYPE orion-web-app PUBLIC "-//Evermind//DTD Orion Web Application 2.3//EN"
"http://xmlns.oracle.com/ias/dtds/orion-web.dtd">
<orion-web-app
persistence-path=""
jsp-cache-directory="./persistence"
jsp-cache-tlds="standard"
simple-jsp-mapping="false"
temporary-directory="./temp"
servlet-webdir="/servlet/"
>
<web-app-class-loader search-local-classes-first="true"/>
</orion-web-app>
maven pom.xml
<!-- JAXB implemetation by EclipseLink MOXy-->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.1</version>
<scope>compile</scope>
</dependency>
<!-- Specific dependencies for OC4J v1013 -->
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
精彩评论