on 02-22-2006 10:08 AM
Hi,
Iam trying to deploy an ear file which contains some jar files in web-inf/lib such as xerces.jar,soap.jar,saaj-api.jar,dom4j.jar etc.
In the web.xml we are trying to access some Xml api's as an init param.(web.xml attached).
While Deploying for tge very first time it works fine , but next time the deployment always fails
As this a migration frm Weblogic to SAP web AS,in the init method of the servlet we are using system.setproperty for setting these xml files
in the path. <i>Can this cause any issues .</i>
<b>How do we do achieve in SAP Web AS..</b>
-
The code snippet of the init method is below :
static MessageFactory msgFactory = null;
public void initSystemProperties(ServletConfig servletConfig) {
String paramName = null;
String paramValue = null;
Enumeration enum = servletConfig.getInitParameterNames
();
while(enum.hasMoreElements()){
paramName = (String)enum.nextElement();
if(paramName != null){
paramValue =
servletConfig.getInitParameter(paramName);
if(paramValue !=null){
System.setProperty
(paramName,paramValue);
}
}
}
}
//Initialize global variables
public void init(ServletConfig servletConfig) throws
ServletException {
super.init(servletConfig);
try {
initSystemProperties(servletConfig);
// Initialize it to the default.
msgFactory = MessageFactory.newInstance();
} catch (SOAPException ex) {
throw new ServletException("Unable to create
message factory" + ex.getMessage());
}
-
The deployment gets aborted with the following error.
-
<!LOGHEADER[START]/>
<!HELP[Manual modification of the header may cause parsing problem!]/>
<!LOGGINGVERSION[1.5.3.7181 - 630_SP]/>
<!NAME[C:\usr\sap\J2E\JC00\SDM\program\log\sdmcl20060222091333.log]/>
<!PATTERN[sdmcl20060222091333.log]/>
<!FORMATTER[com.sap.tc.logging.TraceFormatter(%24d %s: %m)]/>
<!ENCODING[Cp1252]/>
<!LOGHEADER[END]/>
Feb 22, 2006 2:43:35 PM Info: -
Starting deployment -
Feb 22, 2006 2:43:35 PM Info: Loading selected archives...
Feb 22, 2006 2:43:35 PM Info: Loading archive 'C:\usr\sap\J2E\JC00
\SDM\program\temp\temp52339ComXLApp.ear'
Feb 22, 2006 2:43:37 PM Info: Selected archives successfully loaded.
Feb 22, 2006 2:43:37 PM Info: Actions per selected component:
Feb 22, 2006 2:43:37 PM Info: Update: Selected development
component 'ComXLApp'/'sap.com'/'localhost'/'2006.02.22.14.42.37'
updates currently deployed development
component 'ComXLApp'/'sap.com'/'localhost'/'2006.02.22.14.25.01'.
Feb 22, 2006 2:43:37 PM Error: Unable to compare host[sap09r0] and host
[dev-d-com-09qr] Throwable: java.net.UnknownHostException Throwable
message: dev-d-com-09qr
Feb 22, 2006 2:43:37 PM Info: Saved current Engine state.
Feb 22, 2006 2:43:37 PM Info: Error handling strategy: OnErrorStop
Feb 22, 2006 2:43:37 PM Info: Update strategy: UpdateAllVersions
Feb 22, 2006 2:43:37 PM Info: Starting: Update: Selected development
component 'ComXLApp'/'sap.com'/'localhost'/'2006.02.22.14.42.37'
updates currently deployed development
component 'ComXLApp'/'sap.com'/'localhost'/'2006.02.22.14.25.01'.
Feb 22, 2006 2:43:37 PM Info: SDA to be deployed: C:\usr\sap\J2E\JC00
\SDM\root\origin\sap.com\ComXLApp\localhost\2006.02.22.14.42.37
\temp52339ComXLApp.ear
Feb 22, 2006 2:43:37 PM Info: Software type of SDA: J2EE
Feb 22, 2006 2:43:37 PM Info: ***** Begin of SAP J2EE Engine Deployment
(J2EE Application) *****
Feb 22, 2006 2:43:39 PM Error: Unable to compare host[sap09r0] and host
[dev-d-com-09qr] Throwable: java.net.UnknownHostException Throwable
message: dev-d-com-09qr
Feb 22, 2006 2:44:55 PM Info: Begin of log messages of the target
system:
06/02/22 14:43:37 -
***********************************************************
06/02/22 14:43:39 - Start updating EAR file...
06/02/22 14:43:39 - start-up mode is lazy
06/02/22 14:43:43 - EAR file updated successfully for 3547ms.
06/02/22 14:43:43 - Start updating...
06/02/22 14:43:46 - EAR file uploaded to server for 2906ms.
06/02/22 14:44:55 - ERROR: Not updated. Deploy Service returned ERROR:
java.rmi.RemoteException: Cannot deploy application sap.com/ComXLApp..
Reason: Exception during generation of components of application
sap.com/ComXLApp in container servlet_jsp.; nested exception is:
com.sap.engine.services.deploy.exceptions.ServerDeploymentException:
Exception during generation of components of application
sap.com/ComXLApp in container servlet_jsp.
at com.sap.engine.services.deploy.server.DeployServiceImpl.update
(DeployServiceImpl.java:592)
at
com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch
(DeployServiceImplp4_Skel.java:1278)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal
(DispatchImpl.java:294)
at com.sap.engine.services.rmi_p4.DispatchImpl._run
(DispatchImpl.java:183)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request
(P4SessionProcessor.java:119)
at
com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at
com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run
(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute
(SingleThread.java:94)
at com.sap.engine.core.thread.impl3.SingleThread.run
(SingleThread.java:162)
Caused by:
com.sap.engine.services.deploy.exceptions.ServerDeploymentException:
Exception during generation of components of application
sap.com/ComXLApp in container servlet_jsp.
at
com.sap.engine.services.deploy.server.application.UpdateTransaction.makeComponents(UpdateTransaction.java:391)
at
com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:379)
at
com.sap.engine.services.deploy.server.application.UpdateTransaction.begin(UpdateTransaction.java:148)
at
com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:290)
at
com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:323)
at
com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3033)
at com.sap.engine.services.deploy.server.DeployServiceImpl.update
(DeployServiceImpl.java:580)
... 10 more
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.SAXParserFactoryImpl not found
at javax.xml.parsers.SAXParserFactory.newInstance
(SAXParserFactory.java:93)
at com.sap.dictionary.database.dbs.XmlExtractor.createXmlExtractor
(XmlExtractor.java:49)
at com.sap.dictionary.database.dbs.XmlExtractor.<init>
(XmlExtractor.java:30)
at com.sap.dictionary.database.catalog.DbGeneralStructure.<init>
(DbGeneralStructure.java:84)
at com.sap.dictionary.database.catalog.XmlCatalogReader.getTable
(XmlCatalogReader.java:90)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable
(BufferedCatalogReader.java:126)
at com.sap.sql.catalog.impl.BufferedCatalogReader.getTable
(BufferedCatalogReader.java:89)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.checkTabs
(CheckColAndTabVisitor.java:247)
at com.sap.sql.sqlparser.CheckColAndTabVisitor.performCatalogChecks
(CheckColAndTabVisitor.java:170)
at com.sap.sql.sqlparser.CommonSQLStatement.checkSemantics
(CommonSQLStatement.java:183)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.check
(StatementAnalyzerImpl.java:42)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement
(StatementAnalyzerImpl.java:126)
at com.sap.sql.jdbc.common.StatementAnalyzerImpl.preprepareStatement
(StatementAnalyzerImpl.java:109)
at com.sap.sql.jdbc.common.CommonPreparedStatement.<init>
(CommonPreparedStatement.java:155)
at com.sap.sql.jdbc.common.CommonConnectionImpl.prepareStatement
(CommonConnectionImpl.java:314)
at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement
(ConnectionHandle.java:81)
at
com.sap.engine.services.failover.db.SessionPersistentStorageImpl.deleteAllSessions(SessionPersistentStorageImpl.java:280)
at
com.sap.engine.services.failover.storage.DatabasePersistentStorage.deleteAllSessions(DatabasePersistentStorage.java:151)
at
com.sap.engine.services.servlets_jsp.server.container.RemoveAction.remove(RemoveAction.java:68)
at
com.sap.engine.services.servlets_jsp.server.container.WebContainer.makeUpdate(WebContainer.java:218)
at
com.sap.engine.services.deploy.server.application.UpdateTransaction.makeComponents(UpdateTransaction.java:376)
... 16 more
For detailed information see the log file of the Deploy Service.
06/02/22 14:44:55 -
***********************************************************
-
regards
rajesh kr
Hi Rahesh,
the containers (servlet_jsp and ejb) have already a lot of predefined lib references esp. to the "system stuff" like j2ee and xml libs. Therefore, you can use them out of the box. It appears, that removing the xml related libs from your ear helped to to resolve issues, which may arrise, if there are class duplicates on the classpath.
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
I have not remove these libraries from the WEb-inf Libraries . Its there in the EAR and the SDA also .
Was wondering how did u access all the xml related libraries only from the EAR .
Not only that these xml libraries in Web-inf/lib are used in some other code also and it was working fine .
.But now it deploys once and again throwing the same erro log
Regards
rajeshkr
Rajesh,
you code is pretty generic .. it would help to list thé content of web.xml's init properties to spot critical stuff ...
I also use dom4j, and other xml related libs .. but relay on the the SAP xmltoolkit .. works fine, no need to use xerces in NW.
To use xalan as xslt, I use the following method, there for a short time a JAXP system property is changed, but then it is restored to its original value.
public TransformerFactory getTransformerFactory() {
if (transformerFactory == null) {
synchronized( this ) {
String sysJaxpXsltFactory = System.getProperty( JAXP_XSLT_FACTORY );
Properties sysProperties = System.getProperties();
try {
sysProperties.setProperty( JAXP_XSLT_FACTORY, getTransformerFactoryClass() );
transformerFactory = TransformerFactory.newInstance();
} finally {
if ( sysJaxpXsltFactory != null ) {
sysProperties.setProperty( JAXP_XSLT_FACTORY, sysJaxpXsltFactory );
} else {
sysProperties.remove( JAXP_XSLT_FACTORY );
}
}
}
}
return transformerFactory;
}
protected TransformerFactory transformerFactory;
protected static final String JAXP_XSLT_FACTORY = "javax.xml.transform.TransformerFactory";
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor
I have put all the Xml related jars as an SDA project and deployed that as a library
Then I deployed my Ear with the same libraries mentioned above . Now its working
Any idea whats happening since its wrking now , is it that since i have deployed as an SDA library its loading all the libraries , Also i havent given hard/ weak references of this deployed J2ee Library . still its wrking .
Since my Servlet is using System.setProperty()not undertsanding as to how its loading the classes
regards
rajesh kr
Rajesh,
if by chance, you are changing some of the JAXP System Properties (for parsing or transformation) .. this is a nono in the NW world .. you do it and brake the deployment infrastructure of NW ..
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor
Nio i am not changing it ,In weblogic we are trying to set in the classpath using Sytem.setProperty() ( see the code snippet ),as weblogic also has its own SAP xml toolkit , we wanted to by pass that .
Will it work the same way for the SAP WEB AS , what can we do for this ???
regards
rajesh kr
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.