• Post Reply Bookmark Topic Watch Topic
  • New Topic

Deploy EJB Web Client to Glassfish  RSS feed

 
R Jng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am very new to Java. Right now, I am having a little problem deploying ejb web client to glassfish using Eclipse.
These are the steps I have done.
1.Create EJB project (say testEJB)
2.Create a dynamic web project (say testClient)
3. Add testEJB to testClient, (right click testClient=>properties=>Java Build Path=>Projects(tab)=>Add "testEJB".
4.Create a servlet in testClient

When I hit the servlet, it show me 404 error.
Then I checked the deployment log, this is what I found
SEVERE: Class [ Lservice/HelloWorldLocal; ] not found. Error while loading [ class client.testservlet ]

Please help.

 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like a class which is expected to be part of the deployment is missing.

Since you say you are learning Java EE (and Java), I suggest that you use the IDE only for writing code and not for building the deployment (jars) and not for deploying them to the server from the IDE. Instead use a build tool like Ant where you can write the command to build the jar yourself and then manually deploy it to your server so that you understand how all of this works. Once you understand these basics, you could use the IDE if you wanted to.

 
R Jng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai wrote:It looks like a class which is expected to be part of the deployment is missing.

Since you say you are learning Java EE (and Java), I suggest that you use the IDE only for writing code and not for building the deployment (jars) and not for deploying them to the server from the IDE. Instead use a build tool like Ant where you can write the command to build the jar yourself and then manually deploy it to your server so that you understand how all of this works. Once you understand these basics, you could use the IDE if you wanted to.


After a whole day work and hair loss, I kinda manually deploy this to glassfish.
This is what I did.
1.Create the EJB project, write the bean code
2.Build the project, copy the xxxbean.jar (EJB jar file) to some c:\temp
3.Create a web project, add EJB bean project to webproject, ALSO in build path libraries, Add c:\temp\xxxbean.jar,
4.Copy bean class to webproject\build\classes
5.Build the webproject and ONLY deploy the webproject.


I am not sure if this is right or wrong. The only thing I can make sure is at least it works....
Now my question is, isn't EJB a little limitted? can EJB be shared with other clients? What if multilple clients using the same bean?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!