wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes basic ejb problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "basic ejb problem" Watch "basic ejb problem" New topic
Author

basic ejb problem

Lokesh Mahajan
Greenhorn

Joined: Feb 01, 2001
Posts: 22
Dear Friends
I have some basic problem with ejb.
created three .class files & than .ser files.
now the question is how to deploy them.
i am working on weblogic 5.1.0.
steps i had taken
1>Compile the .java Files (i compiled all the three file)
a>one is interface HelloHome extending EJBHome
b>second is interface Hello extending EJBObject.
c>third is HelloBean implementing SessionBean.
2>Create the DeploymentDescriptor
now i dont have DDCreator to create .ser files,so i had write down the program to create .ser file.
3>Create the ejb-jar file
created this jar file at the dos prompt.
created a Hello.jar file contents of it are shown bellow.

META-INF/MANIFEST.MF
ejb/demo/Hello.class
ejb/demo/HelloBean.class
ejb/demo/HelloHome.class
ejb/demo/HelloBeanDD.ser
4>now next step is BEA Weblogic Deployment
steps to undertake.
a>Generate the implementations
java weblogic.ejbc -d /export/weblogic/classes
ejb/demo/HelloBeanDD.ser
This utility creates classes with names similar to those below and puts them
under the /export/weblogic/classes directory.
i am not getting through this step its not working.so i struck here.
b>Put the Demo.jar into the CLASSPATH of the Weblogic server
i am working on windows nt os. so i have to modify the file
startWebLogic batch file ,but here in this file two types of variable are given pre & post so what to do which one to modify.
c>Edit the weblogic.properties file to include the new Enterprise
JavaBean
with this part no problem.
d>Stop and restart the Weblogic server
I procced with this half complete & started weblogic server.
than started ejb deployer while generating the container i get the following
error
java.io.FileNotFoundException: META-INF/ejb-jar.xml XML file not found in
jar file
at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:93)
at
weblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.java:151)
at
weblogic.ejb.ui.deployer.DeployerFrame.loadDeploymentUnit(DeployerFrame.java:1123)
at
weblogic.ejb.ui.deployer.AbstractProjectRootNode.loadDeploymentUnit(AbstractProjectRootNode.java:161)
at
weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNode.java:120)
at
weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNode.java:101)
at
weblogic.ejb.ui.deployer.ProjectLoaderWorker$LoaderThread.run(ProjectLoaderWorker.java,
Compiled Code)

Unable to load 'E:\weblogic\classes\Demo.jar'
Failed to load E:\weblogic\classes\Demo.jar

please try to guide me in this situation.
thanking you in advance.
love
lokesh
Saran Vel
Ranch Hand

Joined: Nov 03, 2000
Posts: 111
Hi,
I suggest u to start with trying the examples provided by weblogic.. so that u will get some clear idea.
U will find build.cmd in examples.. Explore it and do the same for u'r code for describing and deploying beans.
Deploymnet descriptors r no more ser files, which is now xml files.. (though u can convert ser files to xml using DDConvertor).

Saran
Sun Certified Java2 Programmer
Venugopal nandikolla
Greenhorn

Joined: Feb 02, 2001
Posts: 22
Hi lokesh,
first read the weblogic doc completely.You can do by creating the .ser files but it is difficult.What you are using is weblogic4.5.X version,but ejb1.1 specifies that you must use xml deployment descriptor,so copy the two xml files from your weblogic examples directory if you are working with session beans or three xml files for entity beans and make the necessary changes as per you bean requirement.create a sub-directory META-INF and put those xml files in that directory
next step
then use jar -cvf bean.jar *.class META-INF/your xml files

you will get bean.jar file.
then use the ejbc command as
java weblogic.ejbc bean.jar c:\weblogic\myserver\bean.jar
you will be getting stub and skeleton classes in the weblogic\myserver dir(you can unjar it ans see them)
change your weblogic.properties include this jar file thats it your bean will be deployed.
c:\weblogic\myserver\bean.jar
if you have any further questions send me a mail to venugopal.n@mailcity.com
I am there to help.
have a good day.bye bye.

cheers,
venu
Originally posted by Lokesh Mahajan:
Dear Friends
I have some basic problem with ejb.
created three .class files & than .ser files.
now the question is how to deploy them.
i am working on weblogic 5.1.0.
steps i had taken
1>Compile the .java Files (i compiled all the three file)
a>one is interface HelloHome extending EJBHome
b>second is interface Hello extending EJBObject.
c>third is HelloBean implementing SessionBean.
2>Create the DeploymentDescriptor
now i dont have DDCreator to create .ser files,so i had write down the program to create .ser file.
3>Create the ejb-jar file
created this jar file at the dos prompt.
created a Hello.jar file contents of it are shown bellow.

META-INF/MANIFEST.MF
ejb/demo/Hello.class
ejb/demo/HelloBean.class
ejb/demo/HelloHome.class
ejb/demo/HelloBeanDD.ser
4>now next step is BEA Weblogic Deployment
steps to undertake.
a>Generate the implementations
java weblogic.ejbc -d /export/weblogic/classes
ejb/demo/HelloBeanDD.ser
This utility creates classes with names similar to those below and puts them
under the /export/weblogic/classes directory.
i am not getting through this step its not working.so i struck here.
b>Put the Demo.jar into the CLASSPATH of the Weblogic server
i am working on windows nt os. so i have to modify the file
startWebLogic batch file ,but here in this file two types of variable are given pre & post so what to do which one to modify.
c>Edit the weblogic.properties file to include the new Enterprise
JavaBean
with this part no problem.
d>Stop and restart the Weblogic server
I procced with this half complete & started weblogic server.
than started ejb deployer while generating the container i get the following
error
java.io.FileNotFoundException: META-INF/ejb-jar.xml XML file not found in
jar file
at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:93)
at
weblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.java:151)
at
weblogic.ejb.ui.deployer.DeployerFrame.loadDeploymentUnit(DeployerFrame.java:1123)
at
weblogic.ejb.ui.deployer.AbstractProjectRootNode.loadDeploymentUnit(AbstractProjectRootNode.java:161)
at
weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNode.java:120)
at
weblogic.ejb.ui.deployer.DeployerProjectRootNode.load(DeployerProjectRootNode.java:101)
at
weblogic.ejb.ui.deployer.ProjectLoaderWorker$LoaderThread.run(ProjectLoaderWorker.java,
Compiled Code)

Unable to load 'E:\weblogic\classes\Demo.jar'
Failed to load E:\weblogic\classes\Demo.jar

please try to guide me in this situation.
thanking you in advance.
love
lokesh

durai senthil
Greenhorn

Joined: Jan 15, 2001
Posts: 5
hai lokesh
follow the steps below to run ejb
create a folder namely stateless and put all your java files and classfiles there then create a folde named META-INF(caps) and put your ejb-jar.xml file ther the name of the directory should be META-INF
if dont know to write the ejb-jar.xmlfile see the examples in welogic\examples\ejb\basic\
then come to the root dir the type as follos
d:\ejb\>jar cvfm myejb.jar META-INF/manifest stateless
d:\ejb\>jar vf myejb.jar META-INF/ejb-jar.xml
dont fail to put your manifest file in your META-INF dir.
then run the ejb deployer and open the jar file .set the jndi name and save it then edit the properties file then start the server u will see a message "ejb deployed to the jndi ame ......"
then run the client program
before runing the client program dont forget to give the class path to weblogic\classes;,;

durai senthil
Greenhorn

Joined: Jan 15, 2001
Posts: 5
hai lokesh
follow the steps below to run ejb
create a folder namely stateless and put all your java files and classfiles there then create a folde named META-INF(caps) and put your ejb-jar.xml file ther the name of the directory should be META-INF
if dont know to write the ejb-jar.xmlfile see the examples in welogic\examples\ejb\basic\
then come to the root dir the type as follos
d:\ejb\>jar cvfm myejb.jar META-INF/manifest stateless
d:\ejb\>jar vf myejb.jar META-INF/ejb-jar.xml
dont fail to put your manifest file in your META-INF dir.
then run the ejb deployer and open the jar file .set the jndi name and save it then edit the properties file then start the server u will see a message "ejb deployed to the jndi ame ......"
then run the client program
before runing the client program dont forget to give the class path to weblogic\classes;,;

NageswaraRao Karra
Ranch Hand

Joined: Nov 12, 2000
Posts: 34
hi!
there is a class file called DDConverter in weblogic.ejb.utils ...package.
you may write a deployment descriptor.txt and give this as argument to this class file which creates ejb-jar.xml and weblogic-jar.xml files and you can place these files into META-INF directory.then jar them.and compile with ejbc

java weblogic.ejb.utils.DDConverter DeploymentDescriptor.txt is the command (u may verify.this is in weblogic 5.1 ver)
then yr.problem may be solved.
 
wood burning stoves
 
subject: basic ejb problem
 
Similar Threads
DeploymentException encountered when trying to deploy an Enterprise Bean in WebSphere
tried to run the weblogic server 5.1
Deployment problem in weblogic 6.0
Need help.. weblogic ejbc error..
ejbc error