jQuery in Action, 2nd edition*
The moose likes JBoss/WildFly and the fly likes difference between POJO client and web-app client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "difference between POJO client and web-app client" Watch "difference between POJO client and web-app client" New topic
Author

difference between POJO client and web-app client

Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Hi all,

i have got an EJB application deployed on JBoss 5.1 EAP at the remote location.

I can access the same using a standalone POJO client that calls the EJB in main() method.

Using the same code, when I try to access the same from my another client web-app, it gives the error 'unable to load user.properties'??

If I am able to access it from a stand-alone POJO client program, why can't i access it from the web-app client??? Are the 2 cases different i.e. web-app client and POJO client??
What am i missing here??
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10066
    
163

Please post the relevant exception stacktrace and more details about the code.

[My Blog] [JavaRanch Journal]
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Hey Jaikiran... thanks for replying...

I've got 3 files in a POJO java project and it rus fine. But when I do the same in a servlet (in a simple helloWorld kind of an application, it gives the error stacktrace)



These are the 3 files :

AppServerLogin.java




JBossLogin.java



TestClient.java

Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
the Remote EJBs are on JBOSS EAP 5.1

my client web-app is on JBOSS 5.1 (Community version)

I am not very comfortable with Security configurations and have no clue about this

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10066
    
163

See my answer to a similar question here https://community.jboss.org/thread/233896
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Thank you so much Jaikiran... I understand your point....
But the login-config.xml is on the JBOSS server where the EJBs are deployed. While I am just trying to access these EJBs from my local JBOSS (which again has its own copy of login-config). Will I need to make nay changes in any of the files???

I am just trying your solution now.... Will update
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
It did resolve the users.prop file not found issue.

But it gives another one now :

Update : I already have this file "com.convergys.geneva.j2ee.config.ConfigSessionHome" on my BuildPath. What to do???

Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Going through some other queries, i found that this may be because of java.rmi.server.codebase. I don't understand what this is about??/

I've got the EJB-Jars supplied by the vendor on my client path... does it need to access some code on the server???

Plus it said something about 'doing it both ways'. How do i know if server needs some client code or the client needs some server code??

Also, how is the same code working on a standalone POJO Project on the same client machine (not deployed in the Jboss ofcourse)???
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10066
    
163

22:27:15,686 ERROR [STDERR] javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: com.convergys.geneva.j2ee.config.ConfigSessionHome (no security manager: RMI class loader disabled)]
22:27:15,686 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:845)
22:27:15,686 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
22:27:15,686 ERROR [STDERR] at javax.naming.InitialContext.lookup(Unknown Source)
22:27:15,686 ERROR [STDERR] at com.netcracker.testclient.TestingWebApp.doPost(TestingWebApp.java:91)
22:27:15,686 ERROR [STDERR] at com.netcracker.testclient.TestingWebApp.doGet(TestingWebApp.java:48)


Where exactly is the com.convergys.geneva.j2ee.config.ConfigSessionHome class located and where is com.netcracker.testclient.TestingWebApp located? What does the application packaging look like?
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
Hello...

com.convergys.geneva.j2ee.config.ConfigSessionHome : this class is a deployed as a remote web-app (JAR in an EAR on the remote JBOSS). Also, the same class is in a jar at my local client's Build Path.


com.netcracker.testclient.TestingWebApp : This is my local client servlet. This is in an Eclipse dynamic web project, deployed on my local machine's JBOSS. Eclipse deploys the app as a WAR on my local JBOSS.


Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
It worked

I just added the jars in the Web-INF\lib folder and the error was gone... previously they were in the Build Path only

Thanks a ton Jaikiran !!!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10066
    
163

Aayush Singhal wrote:

I just added the jars in the Web-INF\lib folder and the error was gone... previously they were in the Build Path only


That's the correct way to do it. The build path is just a IDE thing and plays no role when the application actually gets deployed to the server. So packaging the bean interfaces in the jar and placing that jar in the .war/WEB-INF/lib of the client web application is the right thing to do.

Thanks a ton Jaikiran !!!

You're welcome.
Aayush Singhal
Ranch Hand

Joined: Jan 06, 2011
Posts: 47
will remember this tip Jaikiran
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: difference between POJO client and web-app client