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

ejbc error

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
can any body help me..
i have trying to deploy the ejb since yesterday..
but bad luck..
i an able to create the deployment des,i compiled all the source files.i set the environment variable.
but when i try ejbc command it says
"unable to load class (the bean class) from u r ejb-jar.xml file."
error:ejbc error found.
can anybody tell me where i am wrong??
thanks & regards,
aslesha
 
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unable to load a class means WL can't find the class. Either it is spelled incorrectly in the ejb-jar.xml or is not in you classpath.
 
aslesha choudhari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i checked the spelling.nothing is wrong.
but it doesn't create the output .jar file when i try ejbc command in the "ebjcgen" folder.
Is there any thing other than above that should be looked into??
thanks & regards
aslesha
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And you verified that the class is in your classpath?
 
aslesha choudhari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when u say class is in u r classpath ,it means it is under correct directory/subdirectory..where all other related classes have been saved??
i am really very sorry to ask the basic question..but how do i verify that the related class is in the classpath..
at this time i think my brain has stopped working..
regards
aslesha
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ClassPath is the path, which the compiler will look for the classes. That means after putting your compiled classes in the correct directory, u have to set the classpath in u'r OS, such a way that the directory in which u have put u'r classes, should be included.
To include the classpath in u'r system, if it is Windows, go to environment settings and create a property classpath(if it is not there) and include the directory.

[This message has been edited by Saran Vel (edited April 26, 2001).]
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear aslesha,
Never be sorry to ask questions. I do it all the time
I seems like the ejb compiler cannot see the class specified in you ejb-jar.xml. This class is specified within the < ejb-class > tag. I have one that looks like:

On my machine the .class file is located in:
C:\xpresstrade\classes\com\xpresstrade\server\ejb\user
The class is in a package named com.xpresstrade.server.ejb.user
So my classpath must include c:\xpresstrade\classes for a Java program to see it, the ejb compiler is a Java program.
One can verify the classpath (Win32) by typing echo %classpath% in the command prompt.
I hope this helps. If you can't successfully run the ejb compiler, it would help if you posted:
The relevant section of you ejb-jar.xml
Your classpath right before you run the ejb compiler
The package your bean class is in
I do believe you only have a simple problem. I'm sure your brain is working fine, at least you're smart enough to hang out in a saloon
 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you try using a deployment tool which does all the annoying things either automatically or by just letting you
fill in some parameters AND such a tool comes with documentation.
I have no difficulties up to now with the 'deploytool' from Sun, to be downloaded from there : the J2EE package.
 
aslesha choudhari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi michael,
thanks for u r reply..
i could understand properly what exactly is happening..
but still i am getting the ejbc error...
i will tell u in detail..the steps & directory structure i have got..may be then i think u can tell me what is the exact problem.
currently i am using weblogic6.0
i tried 2 examples that comes along with weblogic6.0..
now i have written my own "helloworld" bean & related classes.
i am not using any deplyoment tool.
the weblogic server example comes with build.cmd file & ejb-jar.xml file.
i copied those file & changed it according to my requirements.
i have created all my java source files in c:/bea/wlserver6.0/samples/examples/ejb/basic/myexample1 directory.
the build.cmd file is also in the same direcotory.
the bean related classes r in the package "examples.ejb.basic.myexamples.helloworld"
To deplyo the bean first i set the environment.
then i run the build .cmd file which compiles all the java classes create the .jar file.
all the compiled classes r kept in build folder under myexample1 directory.
i think the above explanation is enoug to figure out the problem.
as u told i checked the spelling of the classes,set the classpath which is "c:/bea/wlserver6.0/samples"
thanks & regards
aslesha
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think we're getting closer...
If I read this correctly, you have your compiled classes in c:/bea/wlserver6.0/samples/examples/ejb/basic/myexample1/build, yet these classes are in a package named examples.ejb.basic.myexamples.helloworld. This is a problem.
Try this:
- Rename your package to reflect your directory structure, i.e. examples.ejb.basic.myexample1
- Make sure the compiled classes are in the myexample1 directory.
Your classpath looks good.
Run the ejb compiler.
I hope this makes sense. You see, if your classpath is set to c:/bea/wlserver6.0/samples, and you have classes in a package named examples.ejb.basic.myexample1, then these compiled classes need to be in c:/bea/wlserver6.0/samples/examples/ejb/basic/myexample1 for java to find them.
Give it a try.
 
aslesha choudhari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi michael,
i am able to deploy the ejb successfully..
thanks & regards,
Aslesha
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear aslesha,
Congrats
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i have a problemm deploying a ejb.
when i use weblogic.ejbc to create a .jar file.i get a warning saying
"Network(ejbname) has a class com.scenario.network.NetworkProvider(remote interface) which is in classpath.This class shud only be located in ejb-jar.xml)
the same warning is issued for bean class as well as home interface class.n a message saying
ejbc successful.
when i deploy it a error is thrown on console saying "unable to load class specified in your ejb-jar.xml file "
also i have a ejb-jar.xml file which includes
"<home>com.scenario.network.NetworkProviderHome</home>" where the classpath is d:\classes and
the class files are kept in
d:\classes\com\scenario\network\
Please help me out.I hope i am not doin n e silly mistake here .
Thanks & Regards,
Amit Dabri
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic