'm using WLS8.1, actually I wrote advice bean, after build, I got the AdviceApp.jar in that i got these files...Adiveremote, AdviceHome, ejb-jar.xml, weblogic-ejb-jar.xml.
while am trying to rewrite the weblogic xml file for naming JNDI, it says this is not rewritable file.
client code Object o = ic.lookup("Advisor"); // replace with YOUR JNDI name for the bean AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class); Advice advisor = home.create();
geting error here. D:\Weblogic\user_projects\AdviceApp\AdviceApp\headfirst>javac -classpath "C:\Program Files\j2sdkee1.3.1\lib\j2ee.jar";"D:\Weblogic\user_projects\AdviceApp\Advic eApp\AdviceApp.jar" AdviceClient.java AdviceClient.java:28: cannot resolve symbol symbol : class Advice location: class headfirst.AdviceClient Advice advisor = home.create(); ^ 1 error
Please guys.. help me how and where to give JNDI name in weblogic8.1 and how to rectify this problem
Patience Is A Virtue It sounds like you have two problems. If weblogic xml is read-only, make it writable. Simple enough. The other error is a simple classpath problem. The release notes for the JVM describe how classes are found. Did you try specifying the classpath without quotes? Did you examine your JAR to make sure the classes are in the correct place? How about the path to the JAR. I notice AdviceApp is repeated. Edited to add: I just noticed that you don't say that your JAR contains the Advice class. If it doesn't, then that's your problem. [ October 04, 2006: Message edited by: Joe Ess ]
Actually I got only one problem, am suppose to give JNDI name in weblogic***.xml file, while am trying to give in xml it says not rewritable, becoz its under jar. this weblogic-ejb-jar.xml file is created by WLS.
how can I make it to writable file, in Weblogic workshop, if I choose that file it shows only 2 options which are save as and close. I cant able to acces that file directly, coz its under jar.
If I solve this one pb the other one will be resolved automatically.
Cheers [ October 04, 2006: Message edited by: Frederik Ericsson ]
You can set the JNDI name of the EJB on the property palette. the weblogic-ejb-jar.xml will be updated automatically when it is compiled. Acutally it is using a doclet embedded in the source code to specify the JNDI name.
The methods of a bean are declared in the remote interface. According to the naming convention of EJB's, your remote interface should be named Advice.java. Since you are using Weblogic Workshop it is likely that this class is being generated by some property. BTW, you should use the interface name, not the generated class name, in your create() call (i.e. Advice instead of AdviceRemote).