EJB and WebLogic
I am quite new to weblogic. I created very simple application, stockonline using ejb in weblogic. The compilation and package were OK. But when I deploy ejb jar name stockonline-core-1.0.jar in weblogic, I always got the same error
Exception:weblogic.management.ApplicationException: prepare failed for stockonline-core-1.0 Module: stockonline-core-1.0 Error: Exception preparing module: EJBModule(stockonline-core-1.0,status=NEW) Unable to deploy EJB: Account from stockonline-core-1.0.jar: java.lang.AssertionError: Unable to find expected methods. Please check your classpath for stale versions of your ejb classes and re-run weblogic.ejbc at stockonline.bean.ejb.Account_hzbwy8_LocalHomeImpl.<clinit>(Account_hzbwy8_LocalHomeImpl.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.prepare(ClientDrivenBeanInfoImpl.java:1026) at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:1004) at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1345) at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:498) at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:3142) at weblogic.j2ee.J2EEApplicationContainer.prepareModules(J2EEApplicationContainer.java:1583) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1227) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1070) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2513) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2463) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2379) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
* [Deployer:149033]preparing application stockonline-core-1.0 on myserver
* [Deployer:149033]failed application stockonline-core-1.0 on myserver
* [Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application stockonline-core-1.0 on myserver.: Exception:weblogic.management.ApplicationException: prepare failed for stockonline-core-1.0 Module: stockonline-core-1.0 Error: Exception preparing module: EJBModule(stockonline-core-1.0,status=NEW) Unable to deploy EJB: Account from stockonline-core-1.0.jar: java.lang.AssertionError: Unable to find expected methods. Please check your classpath for stale versions of your ejb classes and re-run weblogic.ejbc at stockonline.bean.ejb.Account_hzbwy8_LocalHomeImpl.<clinit>(Account_hzbwy8_LocalHomeImpl.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.prepare(ClientDrivenBeanInfoImpl.java:1026) at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:1004) at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1345) at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:498) at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:3142) at weblogic.j2ee.J2EEApplicationContainer.prepareModules(J2EEApplicationContainer.java:1583) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1227) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1070) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2513) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2463) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2379) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) .
When I looked at the come of Account_hzbwy8_LocalHomeImpl.java, the error was with create method. I don't why. I don't think any problem with the application logic since I deployed the same code in JBoss and it worked. Could anyone help me? I really appreciate. I use weblogic with oracle in a remote machine.
I used maven to package.
<postGoal name="ejb:ejb">
<ant:java classname="weblogic.ejbc" fork="yes" failonerror="yes">
<!--ant:sysproperty key="weblogic.home" value="${WL_HOME}/server"/-->
<ant:arg line="-compiler javac ${maven.build.dir}/${maven.final.name}.jar" />
<ant:classpath>
<ant:pathelement path="${WL_HOME}/server/lib/weblogic.jar" />
<ant:pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
<ant:pathelement location="${USER_MAVEN}/stockonline/jars/stockonline-common-1.0.jar"/>
</ant:classpath>
</ant:java>
</postGoal>
Thanks
Betty
Hi,guys, I am new to EJB. when i want to deploy the EJB,I got the problem,which is similar yours:
Exception:weblogic.management.ApplicationException: prepare failed for HelloEJB Module: HelloEJB Error: Exception preparing module: EJBModule(HelloEJB,status=NEW) Unable to deploy EJB: HelloWorld from HelloEJB.jar: java.lang.AssertionError: Unable to find expected methods. Please check your classpath for stale versions of your ejb classes and re-run weblogic.ejbc at hello.HelloWorld_ap17lf_HomeImpl.<clinit>(HelloWorld_ap17lf_HomeImpl.java:55) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:306) at java.lang.Class.newInstance(Class.java:259) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.prepare(ClientDrivenBeanInfoImpl.java:921) at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:983) at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1283) at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:477) at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:2847) at weblogic.j2ee.J2EEApplicationContainer.prepareModules(J2EEApplicationContainer.java:1534) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1188) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[Deployer:149033]preparing application HelloEJB on admin
[Deployer:149033]failed application HelloEJB on admin
[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application HelloEJB on admin.: Exception:weblogic.management.ApplicationException: prepare failed for HelloEJB Module: HelloEJB Error: Exception preparing module: EJBModule(HelloEJB,status=NEW) Unable to deploy EJB: HelloWorld from HelloEJB.jar: java.lang.AssertionError: Unable to find expected methods. Please check your classpath for stale versions of your ejb classes and re-run weblogic.ejbc at hello.HelloWorld_ap17lf_HomeImpl.<clinit>(HelloWorld_ap17lf_HomeImpl.java:55) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:306) at java.lang.Class.newInstance(Class.java:259) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.prepare(ClientDrivenBeanInfoImpl.java:921) at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:983) at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1283) at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:477) at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:2847) at weblogic.j2ee.J2EEApplicationContainer.prepareModules(J2EEApplicationContainer.java:1534) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1188) at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2634) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2584) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2506) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Is somebody can help me to fix , thanks !!
Similar Messages
-
SLL, EJB, and WebLogic
We are using WebLogic 5.1 with EJB and jsp pages and want to encrypt
specific pages. How is this done in the jsp page with a jsp tag such as
<jsp:forward page="/index.jsp" />? Or is there something we can put in
the header of the specific jsp page we want encrypted?
-ChrisWith Weblogic you need to use their samples. Follow the instructions to run the samples and look at the code then you can mimick their approach to write your own.
-
Servlets and EJBs in weblogic 5.1
Me somebody can say like communicating servlet that this in a machine with Weblogic 5,1 with a EJB in another machine also with weblogic5.1
When trying gives it to me Comunication Exception .
But if I have the 2 in the same machine it works well
We have the same scenario and had the same CommunicationException.
We had the remote & home interfaces of the ejb and the helper classes
avaliable
to the server#1 , and still encountered the following CommunicationException
Tue Feb 06 17:53:54 GMT+05:30 2001:<I> <ServletContext-General>
scripInfoServletWAP25:
ScripInfoServlet.init()javax.naming.CommunicationException [Root exception
is weblogic.rmi.UnmarshalException: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class
ITS.beans.order.ScripInfoSessionEJBHomeImpl_ServiceStub previously not
found]]
Tue Feb 06 17:53:54 GMT+05:30 2001:<E> <ServletContext-General> Servlet
failed with Exception
javax.servlet.ServletException: javax.naming.CommunicationException [Root
exception is weblogic.rmi.UnmarshalException: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class
ITS.beans.order.ScripInfoSessionEJBHomeImpl_ServiceStub previously not
found]]
at ITS.wap.ScripInfoServletWAP25.init(ScripInfoServletWAP25.java:83)
at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
:390)
at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
va, Compiled Code)
at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
a:338)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:16
4)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:99)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:742)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:686)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:247)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Only when the jar file was made available to the server#1(i.e. present in
weblogicclasspath but not deployed) was the servlet on server#1 able to call
the ejb on server#2.
When calling the ejb through a Java Application or through a servlet
deployed on the same server as the ejb,
the stub classes are not required to be specified in the weblogicclasspath.
Has anybody else encountered a similar situation?
Thanks in advance.
Aparna
"Cameron Purdy" <[email protected]> wrote in message
news:[email protected]...
> You can have a Servlet on server #1 talk to an EJB on server #2. It is
> accomplished by having the client classes for the EJB available to the
> Servlet on server #1 and using JNDI on server #1 to get initial context
for
> server #2 and using that to look up the EJB.
>
> (Sorry, no habla espanol.)
>
> --
> Cameron Purdy
> Tangosol, Inc.
> http://www.tangosol.com
> +1.617.623.5782
> WebLogic Consulting Available
>
>
> "Javier Fdez" <[email protected]> wrote in message
> news:[email protected]...
> >
> > Me somebody can say like communicating servlet that this in a machine
with
> Weblogic 5,1 with a EJB in another machine also with weblogic5.1
> > When trying gives it to me Comunication Exception .
> > But if I have the 2 in the same machine it works well
>
>
-
EJB references in deployment descriptors and weblogic heuristic on resolving links
There are two different ways to lookup home interfaces using JNDI.
1. Query JNDI tree at runtime using some initial context.
2. Use <ejb-ref> in deployment descriptor for all the refrenced EJBs and then
use initCtxt.lookup(java:comp/env/BeanHomeName).
The second approach is recommended as most of the EJB vendors resolve these referenced
EJBs at deployment time and it becomes much faster as compare to lookup in JNDI
as EJB refrences or links can bypass querying the JNDI.
Does anyone know if Weblogic (5.1 sp9 or higher) resolves these links at deployment
time or not?Hi Sami,
Run your question by the folks in the EJB newsgroup and see if they can
offer some assistance:
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=xover&group=weblogic.developer.interest.ejb
Thanks,
Bruce
sami titi wrote:
>
Bruce,
Thanks for your prompt reply. We have resorted to using a startup servlet much
like we do in CA. However, we're still faced with the second issue which is related
to not being able to lookup the EJB after it has been included in an EAR file
now. Is there any setting we're missing?
Thanks
Sami
Bruce Stephens <[email protected]> wrote:
Hello,
Please correct me if I'm not understanding your question, but you are
looking for an easy way to pass initialization parameters to your
webservice? This is not currently supported, however it is on the wish
list for the next major release.
The workaround is to use a handler or read your init params from a
file. If you backend is java class, then you can put file loading:
1. in the constructor
2. in init() method if you java class implement
javax.xml.rpc.server.ServiceLifecycle
Regards,
Bruce -
OC4J's servlet and Weblogic's EJB problem
Hi all,
Is it possible to look up the weblogic.jndi.WLInitialContextFactory from servlet deployed into OC4J ?
I copied weblogic.jar and MyEJB.jar to \j2ee\home\lib and re-started OC4J.
When the servlet runs for the first time, I can see the following displayed:
java.lang.InternalError: error initializing kernel
at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:86)
at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at myServlet.doGet(myServlet.java:41)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
Next time servlet's response is as follows:
500 Internal Server Error
weblogic.common.internal.VersioningError: No WebLogic packages defined in CLASSPATH
at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:39)
at weblogic.common.internal.VersionInfo.initialize(VersionInfo.java:77)
at weblogic.common.internal.VersionInfo.theOne(VersionInfo.java:63)
at weblogic.rjvm.t3.T3JVMConnection.connect(T3JVMConnection.java:106)
at weblogic.rjvm.t3.T3JVMConnection.createConnection(T3JVMConnection.java:164)
at weblogic.rjvm.Protocol.createConnection(Protocol.java:206)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.java:999)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:285)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:242)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:220)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:188)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:178)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:149)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:311)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:211)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at myServlet.doGet(myServlet.java:41)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
The 41th line of myServlet.java is as follows:
Context jndiContext = new InitialContext(env);
OC4J and Weblogic ara installed on the different computers.
The same myServlet.class deployed into other Weblogic (installed on the same computer as OC4J) works correctly.
What I did miss ?
SY,
Oleksandr Bozhykyes....if you are using only hibernate3.jar and no other jars from hibernate then you need this jars for hibernate to work.
antlr-2.7.6rc1.jar
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
ehcache-1.1.jar
hibernate3.jar
jaas.jar
jaxen-1.1-beta-7.jar
jdbc2_0-stdext.jar
jta.jar
log4j-1.2.11.jar
ojdbc14.jar
xerces-2.6.2.jar
xml-apis.jar
if you are missing any of those, hibernate won't work.
You can check in MyEclipse which jars hibernate needs to run successfully. Just go under Window/Preferences, and there go under MyEclipse/Project Capabilities/Hibernate and select tab Hibernate 3.1 and under Library modules select Hibernate 3.1 Core Libraries, and you will see which jars hibernate need. ;) -
How to get datasources to work on both JBoss and Weblogic?
We have an EJB3 application that needs to be deployed both on JBoss 4 and WebLogic 10.
JBoss creates datasources with JNDI names "java:dsName" , WebLogic uses a pattern "dsName" (and trying to add "java:" to that leads to nasty errors). Despite what the EJB3 books say, looking up that DS using "java:comp/env/dsName" does not work from WebLogic, it simply doesn't register the datasource in that namespace.
The @Resource annotation takes a mappedName argument as the JNDI name for the datasource, but this is required to be a fixed String (so we can't inject the actual name at runtime depending on the deployment environment).
All data access is through session beans, so using an @PersistenceContext is no option.
At the moment we're trying to get around this by creating a special EJB whose only job it is to figure out what server it's running on and find a datasource the hard way (using JNDI lookups), returning that to the EJBs that need it, but that's not supposed to be the way the EJB3 model is supposed to work.All Java EE implementations are required to support the private component namespace -- java:comp/env/. It's there for the express purpose of providing portable access to resources needed by the code. What is not specified is the way in which a particular Java EE implementation allows the mapping between a component namespace entry, e.g. java:comp/env/dsName, and the corresponding physical datasource to be expressed.
Unfortunately, mappedName is not required to be supported. However, even if you don't use mappedName each vendor must have a way to resolve a component environment dependency to the corresponding datasource. In SUN's implementation, this is done via sun-{ejb | web | application-client}.xml. The key is that the source depends on the java:comp/env/... name and the mapping to a physical resource can be changed as part of the application assembly or deployment process without touching the code.
Here's a presentation describing some of these issues in more detail : https://glassfish.dev.java.net/javaee5/ejb/compdependencies_xmlforum_nov15.pdf
--ken -
Error deploying EJB in weblogic 7.0
Hello
I am trying to deploy EJB 2.0, to Weblogic 7.0 server on IBM machine and i am
getting this following error. Previously I have tested deploying the same EJB
to weblogic 7.0 server on my local PC which based on Windows, and everything seems
Ok.
Unable to deploy EJB: DACEJB.jar from DACEJB.jar:
Compiler failed executable.exec(java.lang.String[javac, -nowarn, -classpath, /bea/weblogic700/server/bin/tmp_ejbsmeap01ibm7001myserver/-1spvbzuqlvq3z:/bea/weblogic700/server/bin/DACEJB.jar:/usr/java131/jre/lib/rt.jar:/usr/java131/jre/lib/i18n.jar:/usr/java131/jre/classes:/CMS/CORP/config/:/bea/weblogic700:/bea/weblogic700/server/lib/crack.jar:/bea/weblogic700/server/lib/classes12_g.jar:/bea/weblogic700/server/lib/HostMsgDriverV2.1_oracle.jar:/bea/weblogic700/server/lib/aal2wrap.jar:/bea/weblogic
700/server/lib/log4j.jar:/bea/weblogic700/server/lib/Opta2000.jar:/bea/weblogic700/server/lib/xmlx.jar:/bea/weblogic700/server/lib/VelisAuth.jar:/bea/weblogic700/server/lib/jython.jar:/usr/java131/lib/tools.jar:/bea/weblogic700/server:/bea/weblogic700/server/lib/weblogic_sp.jar:/bea/weblogic700/server/lib/weblogic.jar:,
-d, tmp_ejbsmeap01ibm7001myserver/-
at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java(Compiled
Code))
at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)
at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:490)
at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:793)
at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1242)
at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:242)
at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java(Compiled
Code))
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java(Compiled
Code))
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java(Compiled
Code))
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java(Compiled
Code))
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java(Compiled
Code))
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
This may happen because javac is not available to weblogic.
Make sure that PATH environment variable used to start the server includes path to Java SDK bin dir with javac in it.
Regards,
Slava Imeshev
"Jennifer" <[email protected]> wrote in message news:[email protected]...
>
Hello
I am trying to deploy EJB 2.0, to Weblogic 7.0 server on IBM machine and i am
getting this following error. Previously I have tested deploying the same EJB
to weblogic 7.0 server on my local PC which based on Windows, and everything seems
Ok.
Unable to deploy EJB: DACEJB.jar from DACEJB.jar:
Compiler failed executable.exec(java.lang.String[javac, -nowarn, -classpath,
/bea/weblogic700/server/bin/tmp_ejbsmeap01ibm7001myserver/-1spvbzuqlvq3z:/bea/weblogic700/server/bin/DACEJB.jar:/usr/java131/jre/lib/rt.jar:/usr/java131/jre/lib/i18n.jar:/usr/java131/jre/classes:/CMS/CORP/config/:/bea/weblogic700:/bea/weblogic700/server/lib/crack.jar:/bea/weblogic700/server/lib/classes12_g.jar:/bea/weblogic700/server/lib/HostMsgDriverV2.1_oracle.jar:/bea/weblogic700/server/lib/aal2wrap.jar:/bea/weblogic>700/server/lib/log4j.jar:/bea/weblogic700/server/lib/Opta2000.jar:/bea/weblogic700/server/lib/xmlx.jar:/bea/weblogic700/server/lib/VelisAuth.jar:/bea/weblogic700/server/lib/jython.jar:/usr/java131/lib/tools.jar:/bea/weblogic700/server:/bea/weblogic700/server/lib/weblogic_sp.jar:/bea/weblogic700/server/lib/weblogic.jar:,> -d, tmp_ejbsmeap01ibm7001myserver/->>> at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java(Compiled> Code))> at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:396)> at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:490)> at weblogic.ejb20.deployer.EJBDeployer.compileEJB(EJBDeployer.java:793)> at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1242)> at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:242)> at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java(Compiled> Code))> at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java(Compiled> Code))> at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java(Compiled> Code))> at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java(Compiled> Code))> at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java(Compiled> Code))> at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:24)> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)> -
WLS 8.1 two domains with EJB and webapp deployed has JVM conflicts?
Test configuration environment:
Windows 2003 server installed with weblogic 8.1 server and oracle 9i.
This weblogic server have two domains, one is for EJB deployment, the other is a webapp that implements accessing to oracle through EJB.
The issue is when we tested a method provided by the EJB that uses double to calculate some total value, the result was correct. But when we tested it using webapp that was deployed on the same server of EJB, it's result was negative or zero.
I think the reason is that the JVM which both EJB and webapp used for calculation was the same and may made some conflicts when they run at the same time.
Any suggestion would be greatly appreciated.
Thank you in advance!
Shuaibing
Message was edited by:
linuxappleThis morning I deployed that webapp to the Domain that deployed the EJB, The results of calculating in webapp's jsp was correct.
Any one be kind enough to tell me what the calling JVM differences between single domain(deployed by EJB and webapp) and two domains (deployed EJB and webapp separately)? -
How to set classpath to EJB and Servlets
Hi all,
How can I add a classpath to EJB and Servlets in Weblogic 6.1, so that that classpath
can be achieved by both EJB jar and war file? I have deployed a .ear file having
the jar and war files. Now the EJBs inside the jar file are not reaching the class
files of the war file and the class files in the war file are not reaching to
the EJBs. Please let me know at the earliest.
AtanuHi.
You might try looking at the petstore example which combines webapps (war files) with
ejbs in an ear file to see how to do this. It may be a simple config problem.
Regards,
Michael
Atanu Dey wrote:
Hi all,
How can I add a classpath to EJB and Servlets in Weblogic 6.1, so that that classpath
can be achieved by both EJB jar and war file? I have deployed a .ear file having
the jar and war files. Now the EJBs inside the jar file are not reaching the class
files of the war file and the class files in the war file are not reaching to
the EJBs. Please let me know at the earliest.
Atanu--
Michael Young
Developer Relations Engineer
BEA Support -
Including utility jar when packing ejb in weblogic
Hi,
I am new to j2ee programming. I have an ejb which uses some utility jars. I followed the bea documents to structure the directory. The directory structure is, like,
EjbProject
- classes
--com
---mine
----projectTracking --> has the class files of the ejb and supporting java files
- src
--com
---mine
----projectTracking --> contains the source files of the ejb and the supporting java files
META-INF > contains ejb-jar.xml and weblogic-ejb-jar.xml
The source java files are dependent on an utility jar file.
so when I try the java weblogic.appc src, it throws me exception saying the utility file is missing. My question , is where should I put this utility jar file. Please send me your thoughts.
Thanks in advanceHi,
you can put your utility jar in the ear file along with the EJBs and make a classpath entry to these files in the EJB jar's META-INF\Manifest.mf file. As you said if you are working with weblogic you can put these files any where in the directory structure and place the entry in the startWeblogic.cmd file. But i recomend first option.
Ashok. -
Urgent!!!!How to deploy only an EJB from Weblogic to oc4j.
Hi
How can i deploy only EJB from Weblogic into oc4j without any web application or client coming into pitcture as my client access bean remotely....
regards,
SapthapathiIf you are migrating from ejb1.1->ejb1.1 you shouldn't have many changes - your ejb-jar.xml file should be the same (I assume you are still talking about ejbs). Once you pull over the base ejb - then if you want to, mess around with the automatically generated orion-ejb-jar.xml file. Obviously - those are all app server specific. I go back and forth between wls6.1 and oc4j all the time. When going from wls5.1 to oc4j - what particular issues do you run into. What do you mean, in particular, by configuration changes?
Curious -
Ray
hi,
EJBs and other applications can be migrated from weblogic to oc4j but many changes are required.These changes are mainly configuration changes rather than code changes.Infact there are many problems in effect while migrating and delloyment.Hope oracle is a bit more attentive to this issue.
regards,
chennai -
Session Beans and TIBCO E4JMS and Weblogic JMS 8.1
Setup:-
Weblogic Server 8.1 SP2 on Linux
TIBCO E4JMS 3.1.2
I have a two Staeless Session Beans which are deployed in both sides of the cluster
- Cluster is made up of two servers(ManagedServer1 and ManagedServer2) on the
same machine. The beans have container managed transaction and trans-type set
to required. The JMS Server is on ManagedServer1. The session bean publishes 100
messages to TIBCO JMS and Weblogic JMS and calls the second bean which again publishes
100 messages to TIBCO JMS and Weblogic JMS .
The connection factories used are XAQueueConnectionFactories.
This seems to work under the following conditions:-
a) The session beans are deployed just in ManagedServer1
b) The WL load balancing scheme manages to run both the beans on ManagedServer1
c) If I don't publish onto Weblogic JMS( It runs successfully on ManagedServer1
and ManagedServer2)
It does not seems to work :-
When the The WL load balancing scheme manages to run both the beans on ManagedServer2.I
put debug statements on the beans and it seems to publish everything but fails
during the commit
murali@dbuslinux1:~/SessionBeanExample> ant run
Buildfile: build.xml
run:
[java] Run : 0
[java] InitialContextFactory weblogic.jndi.WLInitialContextFactory
[java] Provider Url t3://myhost.mycompany.com:18003,myhost.mycompany.com:18005
[java] javax.transaction.TransactionRolledbackException: Exception while
commiting Tx : Name=[EJB Case463495.StatelessBean.sendMessageWrap(java.lang.Integer,java.lang.Integer,java.lang.String,boolean,boolean)],Xid=BEA1-000649EC8876A0032A5E(160401684),Status=Rolled
back. [Reason=javax.transaction.xa.XAException],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
since begin=3,seconds left=30,XAServerResourceInfo[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEAN1TCF]=(ServerResourceInfo[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEAN1TCF]=(state=rolledback,assigned=ManagedServer2),xar=weblogic.deployment.jms.WrappedXAResource_com_tibco_tibjms_TibjmsXAResource@a0181b0),XAServerResourceInfo[JMS_MyJMS
File Store]=(ServerResourceInfo[JMS_MyJMS File Store]=(state=rolledback,assigned=ManagedServer1),xar=null),XAServerResourceInfo[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEAN2TCF]=(ServerResourceInfo[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEAN2TCF]=(state=rolledback,assigned=ManagedServer2),xar=weblogic.deployment.jms.WrappedXAResource_com_tibco_tibjms_TibjmsXAResource@98f6821),SCInfo[E4JMSDOMAIN+ManagedServer1]=(state=rolledback),SCInfo[E4JMSDOMAIN+ManagedServer2]=(state=rolledback),properties=({weblogic.transaction.name=[EJB
Case463495.StatelessBean.sendMessageWrap(java.lang.Integer,java.lang.Integer,java.lang.String,boolean,boolean)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=ManagedServer2+myhost.mycompany.com:18005+E4JMSDOMAIN+t3+,
XAResources={},NonXAResources={})],CoordinatorURL=ManagedServer2+myhost.mycompany.com:18005+E4JMSDOMAIN+t3+):
javax.transaction.xa.XAException
[java] at com.tibco.tibjms.TibjmsXAResource.end(Ljavax.transaction.xa.Xid;I)V(TibjmsXAResource.java:157)
[java] at weblogic.deployment.jms.WrappedXAResource_com_tibco_tibjms_TibjmsXAResource.end(Ljavax.transaction.xa.Xid;I)V(Unknown
Source)
[java] at weblogic.transaction.internal.XAServerResourceInfo.end(Lweblogic.transaction.internal.ServerTransactionImpl;Ljavax.transaction.xa.Xid;I)V(XAServerResourceInfo.java:1124)
[java] at weblogic.transaction.internal.XAServerResourceInfo.internalDelist(Lweblogic.transaction.internal.ServerTransactionImpl;I)V(XAServerResourceInfo.java:325)
[java] at weblogic.transaction.internal.XAServerResourceInfo.delist(Lweblogic.transaction.internal.ServerTransactionImpl;IZ)V(XAServerResourceInfo.java:255)
[java] at weblogic.transaction.internal.ServerTransactionImpl.delistAll(IZ)V(ServerTransactionImpl.java:1408)
[java] at weblogic.transaction.internal.ServerTransactionImpl.delistAll(I)V(ServerTransactionImpl.java:1396)
[java] at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare()V(ServerTransactionImpl.java:1932)
[java] at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:252)
[java] at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:221)
[java] at weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic.ejb20.interfaces.InvocationWrapper;Ljava.lang.Throwable;)V(BaseEJBObject.java:289)
[java] at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(Lweblogic.ejb20.interfaces.InvocationWrapper;Ljava.lang.Throwable;)V(StatelessEJBObject.java:141)
[java] at Case463495.Stateless_soycq8_EOImpl.sendMessageWrap(Ljava.lang.Integer;Ljava.lang.Integer;Ljava.lang.String;ZZ)V(Stateless_soycq8_EOImpl.java:112)
[java] at Case463495.Stateless_soycq8_EOImpl_WLSkel.invoke(ILweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;Ljava.lang.Object;)Lweblogic.rmi.spi.OutboundResponse;(Unknown
Source)
[java] at weblogic.rmi.internal.BasicServerRef.invoke(Lweblogic.rmi.extensions.server.RuntimeMethodDescriptor;Lweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;)V(BasicServerRef.java:477)
[java] at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(Lweblogic.rmi.extensions.server.RuntimeMethodDescriptor;Lweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;)V(ReplicaAwareServerRef.java:108)
[java] at weblogic.rmi.internal.BasicServerRef$1.run()Ljava.lang.Object;(BasicServerRef.java:420)
[java] at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedExceptionAction;)Ljava.lang.Object;(AuthenticatedSubject.java:353)
[java] at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedExceptionAction;)Ljava.lang.Object;(SecurityManager.java:144)
[java] at weblogic.rmi.internal.BasicServerRef.handleRequest(Lweblogic.rmi.spi.InboundRequest;)V(BasicServerRef.java:415)
[java] at weblogic.rmi.internal.BasicExecuteRequest.execute(Lweblogic.kernel.ExecuteThread;)V(BasicExecuteRequest.java:30)
[java] at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:197)
[java] at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
[java] at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown
Source)
[java] ; nested exception is:
[java] javax.transaction.xa.XAException
[java] at weblogic.rjvm.BasicOutboundRequest.sendReceive()Lweblogic.rmi.spi.InboundResponse;(BasicOutboundRequest.java:108)
[java] at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(Lweblogic.rmi.extensions.server.RemoteReference;Lweblogic.rmi.extensions.server.RuntimeMethodDescriptor;[Ljava.lang.Object;Ljava.lang.reflect.Method;)Ljava.lang.Object;(ReplicaAwareRemoteRef.java:284)
[java] at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(Ljava.rmi.Remote;Lweblogic.rmi.extensions.server.RuntimeMethodDescriptor;[Ljava.lang.Object;Ljava.lang.reflect.Method;)Ljava.lang.Object;(ReplicaAwareRemoteRef.java:244)
[java] at Case463495.Stateless_soycq8_EOImpl_812_WLStub.sendMessageWrap(Ljava.lang.Integer;Ljava.lang.Integer;Ljava.lang.String;ZZ)V(Unknown
Source)
[java] at Case463495.Client.run()V(Client.java:103)
[java] at Case463495.Client.sendMessage()V(Client.java:132)
[java] at Case463495.Client.main([Ljava.lang.String;)V(Client.java:195)
[java] Caused by: javax.transaction.xa.XAException
[java] at com.tibco.tibjms.TibjmsXAResource.end(TibjmsXAResource.java:157)
[java] at weblogic.deployment.jms.WrappedXAResource_com_tibco_tibjms_TibjmsXAResource.end(Unknown
Source)
[java] at weblogic.transaction.internal.XAServerResourceInfo.end(XAServerResourceInfo.java:1124)
[java] at weblogic.transaction.internal.XAServerResourceInfo.internalDelist(XAServerResourceInfo.java:325)
[java] at weblogic.transaction.internal.XAServerResourceInfo.delist(XAServerResourceInfo.java:255)
[java] at weblogic.transaction.internal.ServerTransactionImpl.delistAll(ServerTransactionImpl.java:1408)
[java] at weblogic.transaction.internal.ServerTransactionImpl.delistAll(ServerTransactionImpl.java:1396)
[java] at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTransactionImpl.java:1932)
[java] at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:252)
[java] at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
[java] at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:289)
[java] at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.java:141)
[java] at Case463495.Stateless_soycq8_EOImpl.sendMessageWrap(Stateless_soycq8_EOImpl.java:112)
[java] at Case463495.Stateless_soycq8_EOImpl_WLSkel.invoke(Unknown Source)
[java] at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
[java] at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
[java] at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
[java] at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
[java] at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
[java] at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
[java] at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
[java] at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
[java] at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[java] at java.lang.Thread.startThreadFromVM(Unknown Source)
Apologies in advance if this need to be posted in the JTA news group..
Any ideas?
Murali
Posting to the transaction newsgroup would probably also be helpful.
Can you post the code for the session bean so we can see how you're
enlisting Tibco in the transaction? It looks like you're using the JMS
provider wrappers from 8.1, which do the transaction enlistment for you, so
you shouldn't need to mess with JTA at all in your code. Still, something
weird is going on and it'd be nice to see exactly what your code looks like.
greg
"L Muralidharan" <[email protected]> wrote in message
news:[email protected]...
>
> Setup:-
>
> Weblogic Server 8.1 SP2 on Linux
>
> TIBCO E4JMS 3.1.2
>
> I have a two Staeless Session Beans which are deployed in both sides of
the cluster
> - Cluster is made up of two servers(ManagedServer1 and ManagedServer2) on
the
> same machine. The beans have container managed transaction and trans-type
set
> to required. The JMS Server is on ManagedServer1. The session bean
publishes 100
> messages to TIBCO JMS and Weblogic JMS and calls the second bean which
again publishes
> 100 messages to TIBCO JMS and Weblogic JMS .
>
> The connection factories used are XAQueueConnectionFactories.
>
> This seems to work under the following conditions:-
>
> a) The session beans are deployed just in ManagedServer1
> b) The WL load balancing scheme manages to run both the beans on
ManagedServer1
> c) If I don't publish onto Weblogic JMS( It runs successfully on
ManagedServer1
> and ManagedServer2)
>
> It does not seems to work :-
>
> When the The WL load balancing scheme manages to run both the beans on
ManagedServer2.I
> put debug statements on the beans and it seems to publish everything but
fails
> during the commit
>
> murali@dbuslinux1:~/SessionBeanExample> ant run
> Buildfile: build.xml
>
> run:
> [java] Run : 0
> [java] InitialContextFactory weblogic.jndi.WLInitialContextFactory
> [java] Provider Url
t3://myhost.mycompany.com:18003,myhost.mycompany.com:18005
> [java] javax.transaction.TransactionRolledbackException: Exception
while
> commiting Tx : Name=[EJB
Case463495.StatelessBean.sendMessageWrap(java.lang.Integer,java.lang.Integer
,java.lang.String,boolean,boolean)],Xid=BEA1-000649EC8876A0032A5E(160401684)
,Status=Rolled
> back.
[Reason=javax.transaction.xa.XAException],numRepliesOwedMe=0,numRepliesOwedO
thers=0,seconds
> since begin=3,seconds
left=30,XAServerResourceInfo[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEA
N1TCF]=(ServerResourceInfo[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEAN1
TCF]=(state=rolledback,assigned=ManagedServer2),xar=weblogic.deployment.jms.
WrappedXAResource_com_tibco_tibjms_TibjmsXAResource@a0181b0),XAServerResourc
eInfo[JMS_MyJMS
> File Store]=(ServerResourceInfo[JMS_MyJMS File
Store]=(state=rolledback,assigned=ManagedServer1),xar=null),XAServerResource
Info[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEAN2TCF]=(ServerResourceIn
fo[E4JMSDOMAIN.ManagedServer2.JMSXASessionPool.BEAN2TCF]=(state=rolledback,a
ssigned=ManagedServer2),xar=weblogic.deployment.jms.WrappedXAResource_com_ti
bco_tibjms_TibjmsXAResource@98f6821),SCInfo[E4JMSDOMAIN+ManagedServer1]=(sta
te=rolledback),SCInfo[E4JMSDOMAIN+ManagedServer2]=(state=rolledback),propert
ies=({weblogic.transaction.name=[EJB
>
Case463495.StatelessBean.sendMessageWrap(java.lang.Integer,java.lang.Integer
,java.lang.String,boolean,boolean)]}),OwnerTransactionManager=ServerTM[Serve
rCoordinatorDescriptor=(CoordinatorURL=ManagedServer2+myhost.mycompany.com:1
8005+E4JMSDOMAIN+t3+,
>
XAResources={},NonXAResources={})],CoordinatorURL=ManagedServer2+myhost.myco
mpany.com:18005+E4JMSDOMAIN+t3+):
> javax.transaction.xa.XAException
> [java] at
com.tibco.tibjms.TibjmsXAResource.end(Ljavax.transaction.xa.Xid;I)V(TibjmsXA
Resource.java:157)
> [java] at
weblogic.deployment.jms.WrappedXAResource_com_tibco_tibjms_TibjmsXAResource.
end(Ljavax.transaction.xa.Xid;I)V(Unknown
> Source)
> [java] at
weblogic.transaction.internal.XAServerResourceInfo.end(Lweblogic.transaction
.internal.ServerTransactionImpl;Ljavax.transaction.xa.Xid;I)V(XAServerResour
ceInfo.java:1124)
> [java] at
weblogic.transaction.internal.XAServerResourceInfo.internalDelist(Lweblogic.
transaction.internal.ServerTransactionImpl;I)V(XAServerResourceInfo.java:325
> [java] at
weblogic.transaction.internal.XAServerResourceInfo.delist(Lweblogic.transact
ion.internal.ServerTransactionImpl;IZ)V(XAServerResourceInfo.java:255)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.delistAll(IZ)V(ServerTra
nsactionImpl.java:1408)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.delistAll(I)V(ServerTran
sactionImpl.java:1396)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.globalPrepare()V(ServerT
ransactionImpl.java:1932)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(Server
TransactionImpl.java:252)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransact
ionImpl.java:221)
> [java] at
weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic.ejb20.interfaces.
InvocationWrapper;Ljava.lang.Throwable;)V(BaseEJBObject.java:289)
> [java] at
weblogic.ejb20.internal.StatelessEJBObject.postInvoke(Lweblogic.ejb20.interf
aces.InvocationWrapper;Ljava.lang.Throwable;)V(StatelessEJBObject.java:141)
> [java] at
Case463495.Stateless_soycq8_EOImpl.sendMessageWrap(Ljava.lang.Integer;Ljava.
lang.Integer;Ljava.lang.String;ZZ)V(Stateless_soycq8_EOImpl.java:112)
> [java] at
Case463495.Stateless_soycq8_EOImpl_WLSkel.invoke(ILweblogic.rmi.spi.InboundR
equest;Lweblogic.rmi.spi.OutboundResponse;Ljava.lang.Object;)Lweblogic.rmi.s
pi.OutboundResponse;(Unknown
> Source)
> [java] at
weblogic.rmi.internal.BasicServerRef.invoke(Lweblogic.rmi.extensions.server.
RuntimeMethodDescriptor;Lweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.O
utboundResponse;)V(BasicServerRef.java:477)
> [java] at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(Lweblogic.rmi.extensions.s
erver.RuntimeMethodDescriptor;Lweblogic.rmi.spi.InboundRequest;Lweblogic.rmi
.spi.OutboundResponse;)V(ReplicaAwareServerRef.java:108)
> [java] at
weblogic.rmi.internal.BasicServerRef$1.run()Ljava.lang.Object;(BasicServerRe
f.java:420)
> [java] at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.
subject.AbstractSubject;Ljava.security.PrivilegedExceptionAction;)Ljava.lang
.Object;(AuthenticatedSubject.java:353)
> [java] at
weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.inter
nal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubjec
t;Ljava.security.PrivilegedExceptionAction;)Ljava.lang.Object;(SecurityManag
er.java:144)
> [java] at
weblogic.rmi.internal.BasicServerRef.handleRequest(Lweblogic.rmi.spi.Inbound
Request;)V(BasicServerRef.java:415)
> [java] at
weblogic.rmi.internal.BasicExecuteRequest.execute(Lweblogic.kernel.ExecuteTh
read;)V(BasicExecuteRequest.java:30)
> [java] at
weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(Exe
cuteThread.java:197)
> [java] at
weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
> [java] at
java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown
> Source)
> [java] ; nested exception is:
> [java] javax.transaction.xa.XAException
> [java] at
weblogic.rjvm.BasicOutboundRequest.sendReceive()Lweblogic.rmi.spi.InboundRes
ponse;(BasicOutboundRequest.java:108)
> [java] at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(Lweblogic.rmi.extensions.s
erver.RemoteReference;Lweblogic.rmi.extensions.server.RuntimeMethodDescripto
r;[Ljava.lang.Object;Ljava.lang.reflect.Method;)Ljava.lang.Object;(ReplicaAw
areRemoteRef.java:284)
> [java] at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(Ljava.rmi.Remote;Lweblogic
.rmi.extensions.server.RuntimeMethodDescriptor;[Ljava.lang.Object;Ljava.lang
.reflect.Method;)Ljava.lang.Object;(ReplicaAwareRemoteRef.java:244)
> [java] at
Case463495.Stateless_soycq8_EOImpl_812_WLStub.sendMessageWrap(Ljava.lang.Int
eger;Ljava.lang.Integer;Ljava.lang.String;ZZ)V(Unknown
> Source)
> [java] at Case463495.Client.run()V(Client.java:103)
> [java] at Case463495.Client.sendMessage()V(Client.java:132)
> [java] at
Case463495.Client.main([Ljava.lang.String;)V(Client.java:195)
> [java] Caused by: javax.transaction.xa.XAException
> [java] at
com.tibco.tibjms.TibjmsXAResource.end(TibjmsXAResource.java:157)
> [java] at
weblogic.deployment.jms.WrappedXAResource_com_tibco_tibjms_TibjmsXAResource.
end(Unknown
> Source)
> [java] at
weblogic.transaction.internal.XAServerResourceInfo.end(XAServerResourceInfo.
java:1124)
> [java] at
weblogic.transaction.internal.XAServerResourceInfo.internalDelist(XAServerRe
sourceInfo.java:325)
> [java] at
weblogic.transaction.internal.XAServerResourceInfo.delist(XAServerResourceIn
fo.java:255)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.delistAll(ServerTransact
ionImpl.java:1408)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.delistAll(ServerTransact
ionImpl.java:1396)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTran
sactionImpl.java:1932)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTra
nsactionImpl.java:252)
> [java] at
weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransaction
Impl.java:221)
> [java] at
weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:289)
> [java] at
weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.jav
a:141)
> [java] at
Case463495.Stateless_soycq8_EOImpl.sendMessageWrap(Stateless_soycq8_EOImpl.j
ava:112)
> [java] at
Case463495.Stateless_soycq8_EOImpl_WLSkel.invoke(Unknown Source)
> [java] at
weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
> [java] at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
:108)
> [java] at
weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
> [java] at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:353)
> [java] at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
> [java] at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
> [java] at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
0)
> [java] at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> [java] at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> [java] at java.lang.Thread.startThreadFromVM(Unknown Source)
>
>
> Apologies in advance if this need to be posted in the JTA news group..
>
> Any ideas?
>
> Murali
>
-
Can anyone tell me how to run EJB in weblogic.Or can we run in Tomcat.
javatolearn wrote:
Can anyone tell me how to run EJB in weblogic.Yes.
Create an EJB, package it into an EAR file, and deploy it to your WebLogic domain.
Or can we run in Tomcat.No.
% -
Hi there,
A frontend processing of HTTP request that pass thru WebLogic server that make
API calls thru tuxedo to the application servers that eventually running C, C++
that retrieve data from a backend database of Oracle.
Being the services of EJB and Servlets, EJB is more kind of processes inside the
server but Servlets can handle better in request and respond (talk to the client),
whats your opinions in this kind of integration? Go for pure EJB or Servlets?
Or shall mixed matched? and how should the architecture should looks like?
Thanks
NeoSorry, wrong question, just ignore it.
-
Hi,
I have developed an EJB for sending emails using the javamail api.
My problem is that when i run the same code using the a standalone java application (i have pasted the code from the EJB) and try sending mails outside the my companies domain the mails are going.
However when i try sending the mails using the JSP end EJB the mails are not going.
I noticed that in the standalone java application the protected method getPasswordAuthentication gets called by the system. However the same is not getting called in the EJB.
I am new to this technology. Can anyone please help me out here.
I am sending the code also that i am using:-
// Get all the system properties
Properties props = System.getProperties();
props.put("mail.smtp.host", "HOSTNAME");
props.put("mail.smtp.auth", "true");
SetAuthentication auth = new SetAuthentication();
Session session = Session.getInstance(props, auth);
session.setDebug(true);
// Create a message
Message msg = new MimeMessage(session);
try {
// Set the From Address
Address addrFrom =new InternetAddress("[email protected]");
msg.setFrom(addrFrom);
// Set the TO address
Address addrTo = new InternetAddress(strTo);
msg.setRecipient(MimeMessage.RecipientType.TO, addrTo);
// Set the subject of the mail
msg.setSubject(strSubject);
msg.setContent(strContent, "text/plain");
msg.saveChanges();
Transport.send(msg);
// Code in class SetAuthentication
private PasswordAuthentication auth;
public SetAuthentication() {
super();
auth = new PasswordAuthentication("user", "password");
protected PasswordAuthentication getPasswordAuthentication() {
return auth;Hi,
I have worked on JBoss and Weblogic app servers and one can initialize java mail settings in the app server,.I am sorry, i don't know how its done in the app server you are using.
I would suggest you to try the following :
static {
/* Setting Properties for STMP host */
props = System.getProperties();
props.put("mail.smtp.host", "PUT SMTP SERVER HERE");
props.put("mail.smtp.auth", "true");
session = Session.getDefaultInstance(props, null);
try {
MimeMessage message = new MimeMessage(session);
message.setRecipient(Message.RecipientType.TO,
new InternetAddress(this.to));
message.setFrom(new InternetAddress(this.from));
message.setSubject(this.subject);
message.setText(this.message);
Transport transport = session.getTransport("smtp");
transport.connect("PUT SMTP SERVER HERE", "PUT USERNAME HERE", "PUT PASSWORD HERE");
message.saveChanges();
transport.sendMessage(message, message.getAllRecipients());
transport.close();
} catch (MessagingException e) {
throw new Exception(e.getMessage());
Maybe you are looking for
-
Connecting macbook 4.1 to hd tv
i am trying to watch movies from my macbook on my new hd tv. first i tried to get external hard drive and connect that through usb. did not work. then i bought the audio cables and the mini display->hdmi cord and the mini display part was too small
-
How can i set mouse cursor location in a vi at a particular control button
If there are many string controls on a vi front panel,I want to set my cursor at a particular string control. Whenever i will give an input ,It should be typed in that string control only. How can I do that ? Solved! Go to Solution.
-
Find Command in iCal doesn't work
I have tried to use the Find Command in iCal. It doesn't work either from the Edit pull down command nor the keyboard command. Please try this in your setup and tell me whether it works? I have an Intel Mac Mini running 10.4.9. Bob Gallant
-
I have a VGA adapter that I hooked into my MBA, but the picture is not projecting. What button do I press to project the image?
-
hello. I run windows XP, and the wierdest thing is happening. iTunes wont load. I get the error in this picture http://img401.imageshack.us/img401/8646/itunesbrokenyg9.png Please help. If restarting wont do anything, this stinks. Also, my iPod is set