• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

basic ejb problem

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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;,;

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic