Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing weblogic ejb from jboss  RSS feed

 
mat bour
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am currently trying to access an EJB Session deployed in a Weblogic server from JBOSS.

The client code looks like this :

When I run this code from a standalone java program it executes ok, but when I try to run it from an application deployed in JBOSS, the line (5) which creates the InitialContext object throws this Exception :

In order to be able to use weblogic naming factory I put the archive weblogic-8.1.6.0.jar in jboss's /server/default/lib directory.
But I think it has to do with JNDI conflicts between JBOSS and weblogic.

If someone has already done this or has an idea about the problem ... thank you for your help.
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mat,
I think the mistake which you are making is in the context line.Please change it and check if it works.



Please try to use the above and see if it works.

Let me know if it worked correctly or not after you made the change.

--
Deepak Lal
 
mat bour
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Deepak,

Thanks for your answer.
I tried to replace InitialContext with Context but unfortunatly I still get the same error.
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Never needed to go between two different containers like that myself but surely that's a remote lookup required and that doesn't look right. Apologies if I've miss read the question.
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry that post doesn't scan right, I'm querying are you trying to hit the local home rather than remote interface of the ejb.
 
mat bour
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Chris,

Thanks for your help.
Indeed I'm trying to hit the remote interface of the ejb.
But again this code works well in a java standalone application.
The issue seem to be related to the integration in JBOSS application server...
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does explicitly adding java:comp/env help ...



 
mat bour
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Chris but as I said it is the following line which throws the exception :



The rest of the code isn't even executed so it can not provide from the lookup of the object.

As a matter of fact I noticed that this behaviour is very unstable : sometimes I get the ThreadDeath error, sometimes it works fine. It can change between 2 deployements of my application in jboss, without having even changed a single line of code !!

It's really hard finding a solution for that.

If someone can help ...
 
nilkaush shah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please let me know if you were able to resolve the issue, and how it was resolved. Facing same set of problem while connecting to weblogic EJB from JBOSS. The error i get is


Caused by: java.net.ConnectException: t3://10.184.153.165:7799: Bootstrap to: xxxx over: 't3' got an error or timed out while trying to connect to xxxx
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:241)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:169)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:177)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:350)
... 85 more
Caused by: java.rmi.ConnectException: Bootstrap to:xxxx over: 't3' got an error or timed out while trying to connect to xxxx
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:373)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:300)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:204)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:263)
at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:225)

Any pointers would be of great help.

Regards
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like it can't even connect. Have you made sure that port is open on that machine, and that it's WebLogic listening on that port?
 
Mitesh Manani
Greenhorn
Posts: 5
Java Redhat Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clearly its a Communication problem.
i;m attaching a sample code for EJB on Weblogic 12c and EjbServletClient on Jboss EAP 6.2.
just build the code and execute the servlet..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!