• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't access EJB from remote client

 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried to access an EJB via JNDI lookup using Weblogic 10.3.4. The remote client worked fine when both EJB and client were part of same JDeveloper application, but the error happened when I moved the client to another workspace. I deployed the EAR file on the sever, added the classpath for the Client JAR to the new remote client, but still it didn't work. I am posting both code and errors below:

The EJB CalculatorBean.java :

The remote interface Calculator.java :


The remote client CalculatorClient.java :

Code for both the clients I used are the same.

This is the error I get when I try to run the client from a different application:

I'd be really grateful if somebody gives some insight in this matter. Thank You.
 
amit punekar
Ranch Hand
Posts: 544
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Caused by: java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory


Check the Classpath. I have never worked on JDeveloper and hence cannot pinpoint where to check. But this is a classpath issue for certain.

Regds,
Amit
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did. The path for the client JAR is in the classpath fro the project. I also added the libraries for Java EE 1.5 & Java EE 1.5 API to project classpath, but no change. I'm wondering, could this be because of a JNDI lookup failure? I'm not sure myself, but I'm grasping at straws at this point.
 
amit punekar
Ranch Hand
Posts: 544
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
No, this class is part of Weblogic runtime. You need to configure JDeveloper so that you make available Weblogic classes to the Project.

regds,
Amit
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried out your suggestion -- I'm assuming that you mean that I should add the Weblogic 10.3 Thin Client and/or Weblogic 10.3 Remote Client jars to project libraries. I added both of those along with wlclient.jar file in server\lib folder. The error change to the following:

By the way, this is an incomplete error log, I think. I still haven't found out where JDev keeps the complete log. I could post the whole error if I knew.
 
amit punekar
Ranch Hand
Posts: 544
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Have you changed the port number on which Weblogic server runs ?
It seems your ClassNotFound has now gone and your program is not able to communicate with Weblogic using T3 protocol on port 7001.

Regds,
Amit
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I do that? I'm really new to this environment, I'm only learning this because of project requirement. I can't even look up the specific port where an application is deployed. Actually, I think the fault lies with my installation and configuration of sever instance. I'm having problems with a WSDL web service as well, although others say that they were able to run my code smoothly. Any thoughts anyone? If the server config is at fault, I'd be very grateful if any one could point out the proper configuration for WebLogic 10.3.4 for use in personal environment for learning purpose.
 
amit punekar
Ranch Hand
Posts: 544
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can find out this from the admin console of Weblogic.
Also you can check the documentation about your version of weblogic to locate this information.
Usually it is 7001 but in case if you have changed the port while installation , the document would be able to tell you which configuration file to look for.

regds,
Amit
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amit punekar wrote:Hi,
You can find out this from the admin console of Weblogic.
Also you can check the documentation about your version of weblogic to locate this information.
Usually it is 7001 but in case if you have changed the port while installation , the document would be able to tell you which configuration file to look for.

regds,
Amit


Its set at the default port, I'm sure of at least that much.
Actually, I'm starting to think the fault lies with my installation and configuration of sever instance. I'm having problems with a WSDL web service as well, although others say that they were able to run my code smoothly. Any thoughts anyone? If the server config is at fault, I'd be very grateful if any one could point out the proper configuration for WebLogic 10.3.4 for use in personal environment for learning purpose.
 
amit punekar
Ranch Hand
Posts: 544
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can check if you can access the same EJB from within a JSP or Servlet.
There you can just instantiate InitialContext without any environment properties.
Let us know how that test goes?

regds,
Amit
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Debojit Sinha wrote: I'd be very grateful if any one could point out the proper configuration for WebLogic 10.3.4 for use in personal environment for learning purpose.


I use Weblogic all the time. How did you install it? How did you configure your domain? Are you sure Weblogic is running?
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Ess wrote:

I use Weblogic all the time. How did you install it? How did you configure your domain? Are you sure Weblogic is running?


Prestty sure that Webllogic is running. I created a addition web service, and was able to etst it properly from Weblogic test client.

I installed it with deafult options. During configuration of a server instance, I selected all dfault options. Also, when I installed OSB and SOA suite, I create separate domains for each of them and configured them with the developers option for each of them. Would that in any way hamper or otherwise impde the perfomance? I'm sorry I'm still all very new to this environment. That's why I was asking for installation options. I seem to have misread the installation guide at Oracle, and was wondering how people usually configured the server when using it from home.
 
Debojit Sinha
Ranch Hand
Posts: 66
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just deleted my enitre workspace in Jdev, remade the entire workspace from a back up, then manually wrote everything in the client. It works like a charm now. I'd still like configuration pointers for weblogic, though. Optionally, those for OSB and SOA 11g.
 
nick mk
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Debojit Sinha wrote:I just deleted my enitre workspace in Jdev, remade the entire workspace from a back up, then manually wrote everything in the client. It works like a charm now. I'd still like configuration pointers for weblogic, though. Optionally, those for OSB and SOA 11g.


Check the following tag in your build.xml

property name="WLS_HOME" value="${env.WLS_HOME}"

where WLS_HOME=c:\weblogic\wls\wlserver if running on windows i kept trying to run a simple hello world program and it kept throwing

run: [echo] Executing client class
[java] javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]

once i changed the above mention tag it in the build.xml it worked fine
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic