Hi Jean-Louis,

thanks! I tried this (with a simplified version of your regex) and now weblogic.jar is in fact no longer loaded as client app. But the problem is still there, because nevertheless weblogic.jar remains in the classpath and so the SAXParser still interferes. The cause of the exception now looks like this:

Caused by: org.xml.sax.SAXParseException: Premature end of file.
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1189)
   at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
   at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
   at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:194)
   ... 48 more

The OpenEJB startup has shown the following lines so you can see that the regex has been applied:

....
INFO - Using 'openejb.deployments.classpath.exclude=.*/weblogic.*'
INFO - Using 'openejb.deployments.classpath.filter.descriptors=true'
INFO - Inspecting classpath for applications: 48 urls. Consider adjusting your exclude/include. Current settings: openejb.deployments.classpath.exclude='.*/weblogic.*', openejb.deployments.classpath.include=''
....

I have already tried to start tailoring the weblogic.jar (removing the SAXParser) but this lead to other errors. I think I would need a way to define, that the OpenEJB XML Parsing classes come before the weblogic.jar in the classpath. Is there a way to achieve this? Or are there any other ideas?

Many thanks in advance,
Stephan



Jean-Louis MONTEIRO schrieb:
Hi Stephan,

Could you try excluding this jar?
Actually, OpenEJB looks for Java EE components for each jars.
I guess it's not required for weblogic.jar so you could exclude this jar
(bootstrap will also be faster).

Have a look to http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
openejb.deployments.classpath.exclude=.*/weblogic(-[\\d.]+)?.jar(!/)?
openejb.deployments.classpath.filter.descriptors=true

Can you give it a try?

Jean-Louis



Stephan Bauer wrote:
Hi,

I am just wondering if anybody has ever had the same problem, that he had to access a remote EJB deployed on a Weblogic (here 8.1.6) Server. My problem is, that as soon as I put the evil weblogic.jar (which I need for communicating with that remote EJB via the t3 protocol) into the build path of my eclipse jee5 projects, then OpenEJB doesn't come up anymore. The problems seems to be, that there is a SAXParser in weblogic.jar that comes into play when OpenEJB wants to read the persistence.xml from my ejb/jpa module (see the cause of the stacktrace below).
Has anyone managed to get rid of that or an idea how it could be solved?

INFO - Found ClientModule in classpath: C:\eclipse-workspaces\workspace-xxx\xxx-ejb\lib\weblogic.jar
....
....
INFO - Beginning load: C:\eclipse-workspaces\workspace-xxx\xxx-ejb\lib\weblogic.jar
INFO - Configuring enterprise application: classpath.ear
ERROR - Unable to load Persistence Unit from EAR: classpath.ear, module: /C:/eclipse-workspaces/workspace-xxx/xxx-ejb/build/classes/. Exception:
null
javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: Premature end of file.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:476) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:198) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:167) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:120) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:103) at org.apache.openejb.jee.jpa.unit.JaxbPersistenceFactory.getPersistence(JaxbPersistenceFactory.java:69) at org.apache.openejb.config.ReadDescriptors.deploy(ReadDescriptors.java:103) at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247) at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601) at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551) at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380) at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299) at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)
    at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
    at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
    at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36) at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71) at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53) at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
at com.bmw.sf.xxx.facade.AbstractOpenEJBLocalFacadeTestCase.setupInitialContext(AbstractOpenEJBLocalFacadeTestCase.java:59) at com.bmw.sf.xxx.facade.AbstractOpenEJBLocalFacadeTestCase.setUp(AbstractOpenEJBLocalFacadeTestCase.java:23)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
    at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1189)
    at
weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
    at
weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
    at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:194)
    ... 51 more

any help would be extremely appreciated...
Many thanks in advance,
Stephan






Reply via email to