-
15. Re: EJB JAR inside EAR
starkc Feb 5, 2008 2:15 PM (in response to starkc)The weblogic.jar is placed in
<servername>/lib
Yes, there is a classes12.jar (oracle drivers) in the same directory.
This is the error I get now, not entirely unexpected given the file it was trying to load:13:47:23,428 ERROR [LogInterceptor] Unexpected Error in method: public abstract com.cybersource.risk manager.decision.strategy.Strategy com.cybersource.riskmanager.decision.strategy.StrategyHome.create (java.lang.String,java.lang.String,java.lang.String,java.sql.Timestamp,byte[],java.lang.String,java.math.BigDecimal,java.lang.String) throws javax.ejb.CreateException,java.rmi.RemoteException java.lang.NoClassDefFoundError: weblogic/jdbc/common/OracleBlob at com.cybersource.riskmanager.decision.strategy.StrategyBeanBMP.ejbCreate(UnknownSource) 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:324) at org.jboss.ejb.plugins.BMPPersistenceManager.createEntity(BMPPersistenceManager.java:205) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:225) at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:772) 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:324) at org.jboss.invocation.Invocation.performCall(Invocation.java:359) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1130) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:203) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:189) at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:105) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134) at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76) at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:43) at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161) at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:145) at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107) at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:514) at org.jboss.ejb.Container.invoke(Container.java:975) 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:324) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169) at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118) at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:206) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:192) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70) at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100) at $Proxy161.create(Unknown Source) at com.cybersource.riskmanager.decision.strategy.StrategyDeploy.deployStrategy(UnknownSource) at com.cybersource.riskmanager.decision.external.AdminFunctionsImpl.deployStrategy(UnknownSource) at com.cybersource.riskmanager.decision.external.AdminHandler.execute(UnknownSource) at org.apache.xmlrpc.XmlRpcServer$Worker.executeInternal(XmlRpcServer.java) at org.apache.xmlrpc.XmlRpcServer$Worker.execute(XmlRpcServer.java) at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java) at com.cybersource.riskmanager.decision.external.ExternalXMLRPCServlet.doPost(UnknownSource) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:534)
Strangely, there were no warnings or errors that I noticed about missing a logger, as there were before. Since I dont have access to the sourcecode, when it asks for a specific class from a jar like weblogic.jar, I dont have much choice other than to try and bring that over to jboss. Some things in this jar will be needed for other parts of this webapp, but perhaps not everything, so some files might be expendable? -
16. Re: EJB JAR inside EAR
starkc Feb 5, 2008 2:16 PM (in response to starkc)Sorry for double post =/
-
17. Re: EJB JAR inside EAR
starkc Feb 6, 2008 9:06 AM (in response to starkc)Forgot to add that there ARE javax.sql.* classes included in weblogic.jar
-
18. Re: EJB JAR inside EAR
jaikiran Feb 6, 2008 9:11 AM (in response to starkc)I believe this is the reason for the ClasscastException. You are having 2 separate jar file containing the same classes (and some additional ones). I guess, you have configured a datasource (*-ds.xml) file for accessing the DB. What driver are you using there? Can you post it's contents? If you are using weblogic driver then you dont need the classes12.jar in the lib folder.
-
19. Re: EJB JAR inside EAR
starkc Feb 6, 2008 11:48 AM (in response to starkc)The driver class is specified in the -ds.xml file as the following:
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
I am connecting to an Oracle 10g database, if that helps. I will remove classes12.jar and try again shortly and repost more info. -
20. Re: EJB JAR inside EAR
starkc Feb 6, 2008 1:29 PM (in response to starkc)Removing the classes12.jar did not seem to HURT anything per se, but it did not resolve the ClassCastException
-
21. Re: EJB JAR inside EAR
jaikiran Feb 7, 2008 11:41 AM (in response to starkc)Well, i'm puzzled now. You mentioned that you are using oracle.jdbc.driver.OracleDriver class as the driver in which case removing the classes12.jar should have caused ClassNotFoundExceptions, unless this class is contained in some other jar in the classpath.
I have been thinking about your deployment usecase and to be honest, i am not yet sure why there's a ClassCastException (even if you have weblogic.jar and classes12.jar in the lib folder of the server - they will finally be loaded by a single classloader).
Can you try configuring classloader isolation for your application and package the weblogic.jar inside your EAR instead of placing it in the lib folder of the server? You can find the instructions here:
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
Also, this wiki article http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases explains how classloading works in JBoss. You might want to read through it to understand what's the best way to package your application.
Let us know how it goes. If you are still running into that issue then let's see if there's any other way we can debug this. -
22. Re: EJB JAR inside EAR
starkc Feb 8, 2008 9:42 AM (in response to starkc)If you want, I can post the jar contents of weblogic.jar. It is rather large, and does contain its own version of oracle.jdbc.driver.OracleDriver, so a ClassNotFoundException might be avoided this way I suppose.
ClassLoading Isolation is set up, I can see the different repositories in my jmx-console. I set it through the ear-deployer.war value:<attribute name="Isolated">true</attribute>
...which, if I read correctly, should cause all ears to have their own isolated loader by default? If not, I also created a jboss-app.xml file:<!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd"> <jboss-app> <loader-repository> myserver:archive=myserver.ear </loader-repository> </jboss-app>
I have spent at least a week or more trying different configurations and combinations without much work. (not trying to be curt, just informing you)
By placing the weblogic.jar file in the EAR only, JBoss cant find OracleDriver. This seems to confirm that the OracleDriver from the weblogic.jar could have been loaded in conjunction with the one from classes12.jar.
Note: I placed the weblogic.jar in //lib/weblogic.jar
By placing weblogic.jar in both places, the server starts up but throws the following error:09:38:32,352 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.4.GA/server/decisionserver/tmp/deploy/tmp35516weblogic.jar-contents/console.war org.jboss.ws.WSException: java.lang.ClassNotFoundException: weblogic.management.console.webapp._index at org.jboss.ws.server.WebServiceDeployerJSE.isWebserviceDeployment(WebServiceDeployerJSE.java:161) at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:101) at org.jboss.ws.server.WebServiceDeployerJSE.create(WebServiceDeployerJSE.java:66) at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180) at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy37.create(Unknown Source) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771) at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterce ptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy8.deploy(Unknown Source) at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy4.start(Unknown Source) at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755) 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:324) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy5.deploy(Unknown Source) at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482) at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362) at org.jboss.Main.boot(Main.java:200) at org.jboss.Main$1.run(Main.java:464) at java.lang.Thread.run(Thread.java:534) Caused by: java.lang.ClassNotFoundException: weblogic.management.console.webapp._index at java.net.URLClassLoader$1.run(URLClassLoader.java:199) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at org.jboss.ws.server.WebServiceDeployerJSE.isWebserviceDeployment(WebServiceDeployerJSE.java:151) ... 77 more
Does this help at all? -
23. Re: EJB JAR inside EAR
jaikiran Feb 10, 2008 11:20 AM (in response to starkc)OK, a bit of digging, led me to this http://support.bea.com/application_content/product_portlets/support_patterns/wls/CLOBBLOBDataTypeHandlingIssuesPattern.html. Going by what is mentioned in that article, i guess, the problem you are having is related to a programming error rather than a classloader issue. Here's the relevant part from that article (you might want to go through that complete article as it recommends some programming techniques to avoid these issues with weblogic driver):
Since the WebLogic driver uses WebLogic wrapper classes, no typecasting is required when using this driver. If typecasting is used, ClassCastException will be thrown
The actual exception that occurs is on the line
os = ((OracleThinBlob)myRegularBlob).getBinaryOutputStream();"
To resolve this issue, the above code needs to be modified.
Replace
os = ((OracleThinBlob)myRegularBlob).getBinaryOutputStream();
with
os = myRegularBlob.setBinaryStream(1);
From the code that you posted earlier in this thread, i do see a similar thing being done in the code:Blob blob = resultset.getBlob("xml"); if(blob != null) { OutputStream outputstream = ((OracleBlob)blob).getBinaryOutputStream();
I guess, this line is causing the ClasscastException. To fix this, i guess a code change will be required. Since you don't have access to the code, you might have to bring this to the notice of your developers. -
24. Re: EJB JAR inside EAR
starkc Feb 11, 2008 11:46 AM (in response to starkc)This may very well be correct. On cursory inspection, the database field that this blob corresponds to has been left blank, though the rest of the record has been created properly.
It appears that the process does everything EXCEPT create this blob insertion.
Now, could there be a problem using the Oracle9i mapping that came default with the JBoss install to insert these values? Though it has not encountered any other problems, this is a 10g database using those 9i mappings, perhaps there was a change somewhere? (shot in the dark, just wondering) -
25. Re: EJB JAR inside EAR
jaikiran Feb 12, 2008 8:05 AM (in response to starkc)I don't think this might have to do anything with the mappings. But having never worked with entity beans or blobs, i am not the right person to be commenting on this.
-
26. Re: EJB JAR inside EAR
starkc Feb 12, 2008 9:54 AM (in response to starkc)Thats really unfortunate, you've been very helpful even if the problem still hasnt been solved. I'm trying a few different oracle drivers now to see if possibly the wrong version of the oracle drivers, but I'm on my last legs here!
Perhaps someone else would care to chime in, or does this belong in the Persistence/Database forum for that type of help?