Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Help Package,Deploy and Run EJB in Weblogic6.1

  Asked By: Sebastion    Date: May 16    Category: Java    Views: 1330

I am having problem while running my ejb in weblogic 6.1. I dont know where i made a mistake (I compiled all the java files without error). I used the weblogic console and deployed my bean it says deployment ture. I packaged all the .class files and .xml files using jar cvf TemperatureEJB.jar com\deg\*.* command.
I am herewith pasted my coding and the error message. If anyone working in weblogic please let me know the steps to package and deploy the bean as well as how to run the client files.
(Note: My application server and client files are in the same mc. purpose of the program is to convert FahrenheitToCelsius it accepts the Fahrenheit from the user and displayed the Celsius value. if the user enter 'q' it will quit the program)

-----Remote Interface----
package com.deg;
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
public interface Temperature extends EJBObject
public double FahrenheitToCelsius(double degree) throws RemoteException;
-----------Home Interface----
package com.deg;
import java.io.Serializable;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;

public interface TemperatureHome extends EJBHome
Temperature create() throws RemoteException, CreateException;
-----------Ejb Class------
package com.deg;
import java.rmi.RemoteException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
public class TemperatureEJB implements SessionBean
public double FahrenheitToCelsius(double F)
double c;
return c;
public TemperatureEJB(){}
public void ejbCreate(){}
public void ejbRemove(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void setSessionContext(SessionContext sc){}
----------Client class----------
package com.deg;
import com.deg.Temperature;
import com.deg.TemperatureHome;
import javax.naming.Context;
import java.io.*;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class TemperatureClient
public static void main(String[] args)
TemperatureHome home;
BufferedReader stdin;
Context initial = new InitialContext();
Object objref = initial.lookup("MyTemperature");
home = (TemperatureHome)PortableRemoteObject.narrow(objref,TemperatureHome.class);
Temperature degreeConverter = home.create();
double F=0;
stdin = new BufferedReader(new InputStreamReader(System.in));
System.out.print("\n\n Enter the temperature in Fahrenheit (Type 'q' to quit):");
F= Double.parseDouble(stdin.readLine());
double Cel = degreeConverter.FahrenheitToCelsius(F);
System.out.println("The temperature in Celsius:" + String.valueOf(Cel));
}catch(Exception e){System.out.println("Thank you!");}
}catch(Exception ex){System.err.println("Caught an unexpected exception!");
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "www.bea.com/.../weblogic-ejb-jar.dtd">

----------Exception while running the client program--------
Caught an unexpected exception!
javax.naming.NameNotFoundException: Unable to resolve MyTemperature. Resolved: '
' Unresolved:'MyTemperature' ; remaining name ''
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundR
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy0.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at TemperatureClient.main(TemperatureClient.java:21)



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Help Package,Deploy and Run EJB in Weblogic6.1 Or get search suggestion and latest updates.