• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing weblogic ejb from jboss

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 603
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 443
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does explicitly adding java:comp/env help ...



 
mat bour
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ...
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 5
Spring Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic