This discussion is archived
9 Replies Latest reply: Jul 15, 2013 11:52 PM by gimbal2 RSS

i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.

Goud Newbie
Currently Being Moderated

please help me some one

  • 3. Re: i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.
    Goud Newbie
    Currently Being Moderated

    it is simple application i m runing in tow server but i m get classsnotfound error pleas solve my problem. i will give my direct structure of application

    i m runing ejb3 in weblogic 10.3 and struts in tomcat server. both communication is not happening pleas help me. i m try from many days

     

    root dir

    onlyenb6

     

    account class

    package ejb3.onlyejb;

    import java.io.Serializable;

    import javax.persistence.Entity;

    import javax.persistence.Id;

    @Entity

    public class account implements Serializable{

    @Id

    int accno;

      public int getAccno() {

        return accno;

    }

    public void setAccno(int accno) {

        this.accno = accno;

    }

    public String getName() {

        return name;

    }

    public void setName(String name) {

        this.name = name;

    }

    public float getBalance() {

        return balance;

    }

    public void setBalance(float balance) {

        this.balance = balance;

    }

    String name;

    float balance;

     

    }

     

    -------------------------------------------------------------------------

    Int6_clss code

     

    package ejb3.onlyejb;

     

    import java.io.Serializable;

     

    public interface Int6_cls extends Serializable {

     

        public void storing(int acc, String name, float amt);

    }

     

    ----------------------------------------------------------------------

    1. Session.class code

    package ejb3.onlyejb;

     

    import javax.ejb.Remote;

    import javax.ejb.Stateless;

    import javax.persistence.EntityManager;

    import javax.persistence.PersistenceContext;

     

    @Stateless(mappedName="saigoud")

    @Remote

    public class Session_ben implements Int6_cls {

        @PersistenceContext

        EntityManager mrg;

        public void storing(int acc, String name, float amt) {

    System.out.println("session="+acc);

    System.out.println("sess="+name);

            account accs=new account();

            accs.setAccno(acc);

            accs.setName(name);

            accs.setBalance(amt);

            mrg.persist(accs);

        }

     

    }

     

    ---------------------------------------------------------

    1. build.xml

     

    <project name="onlyejb5" default="saifile">

    <property name="bea.home" value="C:/bea"/>

    <property name="wl_home" value="${bea.home}/wlserver_10.3"/>

     

    <path id="main.class.path">

    <pathelement path="${bea.home}/modules/com.bea.core.utils_1.4.0.0.jar"/>

    <pathelement path="${bea.home}/modules/com.bea.core.jarbuilder_1.2.0.0.jar"/>

    <pathelement path="${java.class.path}"/>

    </path>

     

    <target name="saifile">

    <echo message="***ANT Script should run from inside the ${wl.home}/server/lib *****" />

    <echo message="***** ********* ********* *****" />

    <java classname="com.bea.jarbuilder.JarBuilder">

    <classpath refid="main.class.path"/>

    <jvmarg value="-d ${wl.home}/server/lib -jar wljarbuilder.jar"/>

    </java>

    </target>

    </project>

    after run with ant i get successfully create wlfullclient.jar

    i m taking this wlfullclient.jar and pasting in tomcat lib directery and run webapplication

     

    my webapplication code

     

    package ejb3.onlyejb;

     

    import java.io.Serializable;

     

    public interface Int6_cls extends Serializable {

        public void storing(int acc, String name, float amt);

    }

    --------------------------------------------------

    package ejb3.onlywed;

     

    import java.io.FileInputStream;

    import java.io.IOException;

    import java.util.Hashtable;

    import java.util.Properties;

     

    import javax.ejb.EJB;

    import javax.naming.Context;

    import javax.naming.InitialContext;

    import javax.naming.NamingException;

    import javax.servlet.http.HttpServletRequest;

    import javax.servlet.http.HttpServletResponse;

    import org.apache.struts.action.Action;

    import org.apache.struts.action.ActionForm;

    import org.apache.struts.action.ActionForward;

    import org.apache.struts.action.ActionMapping;

    import ejb3.onlyejb.Int6_cls;

     

    public class Action_cls extends Action {

            public ActionForward execute(ActionMapping map, ActionForm fm, HttpServletRequest req, HttpServletResponse res)

        throws IOException{

            String respkey="fails";

            Action_form_bean bean=(Action_form_bean)fm;

            int ac=bean.getAccno();

            String na=bean.getName();

            float bal=bean.getAmt();

            System.out.println("accno="+ac);

    System.out.println("na="+na);

    System.out.println("bal="+bal);

               

    System.out.println("enter in to if loop");

               Hashtable p=new Hashtable();

    p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

    p.put(Context.PROVIDER_URL,"t3://localhost:7001");

           

            System.out.println("jndi properties nuderprocess");

               try {

    System.out.println("loading p file="+p);

                InitialContext ic = new InitialContext(p);

    System.out.println("loading p file over="+ic);

            System.out.println("jndi file is  loaded");

          //System.out.println("wrs="+wrs);

    System.out.println("entry in try block");

    Int6_cls wrs=(Int6_cls)ic.lookup("saigoud#ejb3.onlyejb.Int6_cls");

           System.out.println("lookup susfull");

              wrs.storing(ac, na, bal);

        respkey="ok";

       

              } catch (NamingException e1) {

    // TODO Auto-generated catch block

    e1.printStackTrace();

                }

               

            catch (Exception e) {

                // TODO: handle exception

            }

     

            ActionForward fw=map.findForward(respkey);

           

            return fw;

        }

     

    }

    -------------------------------------------------------------------------------------

    get error

     

    accno=44

    na=hjhjhj

    bal=777.0

    enter in to if loop

    jndi properties nuderprocess

    jndi properties nuderprocess22

    loading p file={java.naming.provider.url=t3://localhost:7001, java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory}

    loading p file over=javax.naming.InitialContext@12f9bcd

    jndi file is  loaded

    entry in try block

    Jul 5, 2013 1:36:22 PM org.apache.catalina.core.StandardWrapperValve invoke

    SEVERE: Servlet.service() for servlet action threw exception

    1. java.lang.ClassNotFoundException: ejb3.onlyejb.Int6_cls

        at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.getClassBytes(RemoteBizIntfClassLoader.java:151)

        at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.loadClass(RemoteBizIntfClassLoader.java:96)

        at weblogic.ejb.container.internal.RemoteBusinessIntfGenerator.generateRemoteInterface(RemoteBusinessIntfGenerator.java:54)

        at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:205)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)

        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)

        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)

        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)

        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)

        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

        at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:197)

        at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:564)

        at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:193)

        at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)

        at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:240)

        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)

        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)

        at weblogic.jndi.internal.ServerNamingNode_1030_WLStub.lookup(Unknown Source)

        at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:392)

        at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)

        at javax.naming.InitialContext.lookup(InitialContext.java:392)

        at ejb3.onlywed.Action_cls.execute(Action_cls.java:62)

        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)

        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)

        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

        at java.lang.Thread.run(Thread.java:619)

  • 4. Re: i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.
    PhHein Guru Moderator
    Currently Being Moderated

    Goud, I have locked all other multiposted instances of this question. If you do it again, admins will have to deal with your account.

  • 5. Re: i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.
    Goud Newbie
    Currently Being Moderated

    what . what is mean by (If you do it again, admins will have to deal with your account). i could not get u.

  • 6. Re: i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.
    rukbat Guru Moderator
    Currently Being Moderated

    Goud wrote:

     

    what . what is mean by (If you do it again, admins will have to deal with your account). i could not get u.

    You posted this same question over and over again.

    That is the same behavior as if you were posting spam to the forums.

    The words used in a post are not important.  It is the action that tells us you would be acting as a spammer.

     

    Do not do that.

    If you are perceived as being a spammer, your posts are all isolated away, the site Administrators are shown what you have done and your user account can possible be banned from the site.

     

    That is nothing unusual.   All legitimate forum web sites treat spammers the same way.

  • 7. Re: i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.
    Goud Newbie
    Currently Being Moderated

    ok.i did not known. l m new to this sit. ok thank u

  • 8. Re: i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.
    Goud Newbie
    Currently Being Moderated

    Hi Mr.PhHein can u open my lock because. i did not got any answer. I m wait from many days for this answer.

    please open my lock.

  • 9. Re: i have problem in ejb 3 . i m run ejb 3 in weblogic 10.3 and struts in tomcat. i m call ejb remote from tomcat.
    gimbal2 Guru
    Currently Being Moderated

    This thread is not locked so no need to unlock any of your duplicate ones.

     

    And in stead of waiting for someone to do the work for you, you should be reading a book and studying up on this stuff so you might solve something yourself. This is not Oracle tech support you know, you are the one doing the work and MAYBE you get some assistance from someone else IF they know what is going on. But assume that you have to fix this yourself. Good luck with your research.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points