Stateless session Bean - xml and ejb-jar.xml file ???

Dear Experts,
Stateless-session bean
For Creating an ear file
we need ejb-jar.xml and weblogic-ejb-jar.xml files
Is these files are already available
or we have to type these files ??
Advance Thanks
Rengaraj.R

My best advice: surrender to use an IDE.
You wonder sometimes at how much productivity (read as 'time') could be wasted by doing something that could be done automatically. For a learning experience or a once only exercise is fine but as a routine thing, not worth it.
Cheers

Similar Messages

  • Using JMX to read ejb manifest jar and ejb-jar.xml in ejb jar inside ear

    Hello,
    I have an ear deployed on weblogic console. I need to check contents of manifest file and ejb-jar.xml of a jar that is present in the deployed ear.
    Currently I am using below code to access jar inside ear deployed :
    Hashtable env = new Hashtable(5);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    url);
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    mBeanHome = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    String type = "EJBComponentRuntime";
    Set beans = mBeanHome.getMBeansByType(type);
    try{
    for(Iterator it=beans.iterator();it.hasNext();)
    EJBComponentRuntimeMBean rt = (EJBComponentRuntimeMBean)it.next();
    if(rt.getParent().getName().equals("xxx")){
    System.out.println(rt.getName());
    l.add(rt.getName());
    Here xxx is the ear. Now I need to get inside the jar (represented) by variable rt and access its manifest file,ejb-jar.xml
    Does anyone have an idea how to do this?
    regards
    Sameer

    Isn't it possible to put them there manually? :)

  • XDoclet  and ejb-jar.xml - No Entity tags?

    build.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="XDoclet" default="ejbdoclet">
         <property file="build.properties"/>
         <target name="init">
              <property name="dir" value="G:\JAVA Tools"/>
              <property name="lib.dir" value="lib"/>
    <!-- library/jar path -->
              <property name="xdoclet.jar.path" value="${dir}\XDoclet\lib\xdoclet.jar"/>
              <property name="log4j.jar.path" value="${dir}\XDoclet\samples\lib\log4j.jar"/>
              <property name="ant.jar.path" value="${dir}\ANT\lib\ant.jar"/>
              <property name="src.dir" value="src"/>
              <property name="generated.src.dir" value="XDoclet/gen-src-code"/>
              <property name="web.dir" value="${src.dir}/web"/>
         <property name="generated.java.dir" value="${generated.src.dir}/java"/>
              <property name="config.dir" value="config"/>
              <property name="build.dir" value="XDoclet/build"/>
              <property name="dist.dir" value="XDoclet/dist"/>
              <property name="build.compiler" value="modern"/>
              <path id="project.class.path">
                   <fileset dir="${lib.dir}">
                        <include name="**/*.jar"/>
                   </fileset>
                   <!-- append the external classpath lastly -->
                   <pathelement path="${java.class.path};${log4j.jar.path}"/>
              </path>
         </target>
         <!-- Prepare -->
         <target name="prepare" depends="init">
              <mkdir dir="${build.dir}"/>
              <mkdir dir="${build.dir}/ejb"/>
              <mkdir dir="${build.dir}/ejb/META-INF"/>
              <mkdir dir="${build.dir}/web"/>
              <mkdir dir="${build.dir}/web/WEB-INF"/>
              <mkdir dir="${build.dir}/web/WEB-INF/tlds"/>
              <mkdir dir="${build.dir}/web/WEB-INF/classes"/>
              <mkdir dir="${build.dir}/j2ee"/>
              <mkdir dir="${build.dir}/j2ee/META-INF"/>
              <mkdir dir="${build.dir}/jmx"/>
              <mkdir dir="${dist.dir}"/>
              <mkdir dir="${generated.src.dir}"/>
              <mkdir dir="${generated.java.dir}"/>
              <echo message="XDoclet Path = ${xdoclet.jar.path}"/>
              <echo message="Log4J Path = ${log4j.jar.path}"/>
              <echo message="Ant Path = ${ant.jar.path}"/>
              <echo message="ClassPath = ${java.class.path}"/>
              <property name="cp" refid="project.class.path"/>
              <echo message="CLASSPATH/REF ID:${cp}"/>
              <echo message="base dir = ${basedir}/${src.dir}"/>
         </target>
         <target name="delete" >
         <echo message = "Deleting directories"/>
              <delete dir="${build.dir}"/>
              <delete dir="${build.dir}/ejb"/>
              <delete dir="${build.dir}/ejb/META-INF"/>
              <delete dir="${build.dir}/web"/>
              <delete dir="${build.dir}/web/WEB-INF"/>
              <delete dir="${build.dir}/web/WEB-INF/tlds"/>
              <delete dir="${build.dir}/web/WEB-INF/classes"/>
              <delete dir="${build.dir}/j2ee"/>
              <delete dir="${build.dir}/j2ee/META-INF"/>
              <delete dir="${build.dir}/jmx"/>
              <delete dir="${dist.dir}"/>
              <delete dir="${generated.src.dir}"/>
              <delete dir="${generated.java.dir}"/>
         </target>
         <!-- Run EJBDoclet -->
         <target name="ejbdoclet" depends="prepare">
              <taskdef name="ejbdoclet"
                   classname="xdoclet.ejb.EjbDocletTask"
                   classpath="${java.class.path};${log4j.jar.path};${ant.jar.path};${xdoclet.jar.path} "/>
              <ejbdoclet sourcepath="${src.dir}"
    destdir="${generated.java.dir}"
                   classpathref="project.class.path"
                   excludedtags="@version,@author"
                   ejbspec="2.0"
                   >
                   <fileset dir="${src.dir}">
                        <include name="**/*EJB.java"/>
                   </fileset>
                   <dataobject/>
    <!-- <localinterface/>
    <localhomeinterface/> -->
                   <remoteinterface/>
                   <homeinterface/>
                   <entitypk/>
    <!--               <entitycmp/> -->
                   <deploymentdescriptor destdir="${build.dir}/ejb/META-INF" validatexml="true"/>
                   <jboss version="2.4" xmlencoding="UTF-8" validatexml="true" typemapping="Hypersonic
                   SQL" datasource="java:/DefaultDS" destdir="${build.dir}/ejb/META-INF"/>
                   <!--
                   <weblogic xmlencoding="UTF-8" destdir="${build.dir}/ejb/META-INF" validatexml="true"/>
         <webSphere destdir="${build.dir}/ejb/META-INF" />
         <orion/>
                   <apachesoap destdir="${build.dir}/web"/>
         -->
                   <!--
    Have struts form objects generated based on entity beans'
    data objects. Will require struts.jar to compile.
    <strutsform />
    -->
              </ejbdoclet>
         </target>
    </project>
    My Session Bean:
    package com.uniserv.comn.controller.ejb.session.terminalfacade;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    import javax.ejb.*;
    import java.util.*;
    import com.uniserv.comn.util.*;
    import com.uniserv.comn.model.*;
    import com.uniserv.comn.controller.ejb.entity.tenderconfig.*;
    public class TerminalSessionFacadeEJB implements SessionBean {
    private SessionContext ctx = null;
    private ServiceLocator serviceLocator = null;
    public TerminalSessionFacadeEJB() throws ServiceLocatorException {
    try {
    serviceLocator = ServiceLocator.getInstance();
    } catch (Exception e) {
    System.out.println("TerminalSessionFacade Exception : " + e.getMessage());
    * Adds an tenderConfig record
    * @param tenderConfigVO TenderConfig's Value Object
    * @return boolean true if successful, false if not
    public boolean addTenderConfig(TenderConfigVO tenderConfigVO) {
              System.out.println("TerminalSessionFacadeEJB.addTenderConfig - START");
    boolean blnRet = false;
    try {
    LocalTenderConfigHome home = (LocalTenderConfigHome)
    serviceLocator.getLocalHome(ServiceLocator.Services.TENDERCONFIG);
    LocalTenderConfig local = null;
    try {
    TenderConfigPK pk
    = new TenderConfigPK(tenderConfigVO.getTndrID(), tenderConfigVO.getTndrCfgName());
    local = home.findByPrimaryKey(pk);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    } finally {
    if (local == null) {
    home.create(tenderConfigVO);
    blnRet = true;
    } else {
    blnRet = false;
    } catch (Exception e) {
    System.out.println("Error in TerminalSessionFacadeEJB.addTenderConfig "
    + "method (Exception) : "
    + e.getMessage());
    } finally {
    System.out.println("Returned value : " + blnRet);
              System.out.println("TerminalSessionFacadeEJB.addTenderConfig - END");
    return blnRet;
    public void setSessionContext(SessionContext parm1) throws javax.ejb.EJBException, java.rmi.RemoteException {
    this.ctx = parm1;
    public void ejbRemove() throws javax.ejb.EJBException, java.rmi.RemoteException
    public void ejbActivate() throws javax.ejb.EJBException, java.rmi.RemoteException
    public void ejbPassivate() throws javax.ejb.EJBException, java.rmi.RemoteException
    public void ejbCreate() throws javax.ejb.EJBException
    My Entity Bean:
    package com.uniserv.comn.controller.ejb.entity.tenderconfig;
    * @ejb.bean
    * type="CMP"
    * cmp-version="2.x"
    * name="TenderConfigEJB"
    * schema="TenderConfig"
    * view-type="local"
    import javax.ejb.*;
    import com.uniserv.comn.model.*;
    public abstract class TenderConfigEJB implements EntityBean{
    private EntityContext ctx = null;
    * @ejb.pk
    public abstract int getTndrID();
    public abstract void setTndrID(int iTndrID);
    * @ejb.pk
    public abstract String getTndrCfgName();
    public abstract void setTndrCfgName(String strTndrCfgName);
    public abstract int getTndrType();
    public abstract void setTndrType(int iTndrType);
    public abstract String getTndrCfgValue();
    public abstract void setTndrCfgValue(String strTndrCfgValue);
    public abstract String getTndrCfgDataType();
    public abstract void setTndrCfgDataType(String strTndrCfgDataType);
    public abstract String getTndrCfgDesc();
    public abstract void setTndrCfgDesc(String strTndrCfgDesc);
    public TenderConfigVO getTenderConfigVO() {
    TenderConfigVO tenderConfigVO = new TenderConfigVO();
    tenderConfigVO.setTndrID(this.getTndrID());
    tenderConfigVO.setTndrCfgName(this.getTndrCfgName());
    tenderConfigVO.setTndrType(this.getTndrType());
    tenderConfigVO.setTndrCfgValue(this.getTndrCfgValue());
    tenderConfigVO.setTndrCfgDataType(this.getTndrCfgDataType());
    tenderConfigVO.setTndrCfgDesc(this.getTndrCfgDesc());
    return tenderConfigVO;
    public void setTenderConfigVO(TenderConfigVO tenderConfigVO) {
    this.setTndrID(tenderConfigVO.getTndrID());
    this.setTndrCfgName(tenderConfigVO.getTndrCfgName());
    this.setTndrType(tenderConfigVO.getTndrType());
    this.setTndrCfgValue(tenderConfigVO.getTndrCfgValue());
    this.setTndrCfgDataType(tenderConfigVO.getTndrCfgDataType());
    this.setTndrCfgDesc(tenderConfigVO.getTndrCfgDesc());
    * Constructor
    public TenderConfigEJB() {
    * ejbCreate callback method
    * @return int
    public TenderConfigPK ejbCreate(TenderConfigVO tenderConfigVO)
    throws CreateException {
    this.setTenderConfigVO(tenderConfigVO);
    return null;
    * ejbPostCreate
    * @param TerminalConfigTypeVO
    public void ejbPostCreate(TenderConfigVO tenderConfigVO) {
    * setEntityContext callback method
    public void setEntityContext(EntityContext ctx) {
    this.ctx = ctx;
    * unsetEntityContext callback method
    public void unsetEntityContext() {
    this.ctx = null;
    * ejbActivate callback method
    public void ejbActivate() {
    * ejbPassivate callback method
    public void ejbPassivate() {
    * ejbLoad callback method
    public void ejbLoad() {
    * ejbRemove callback method
    public void ejbRemove() {
    * ejbStore callback method
    public void ejbStore() {
    But the generated ejb-jar.xml only contains
    <?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">
    <ejb-jar>
         <description>No Description.</description>
         <display-name>Generated by XDoclet</display-name>
         <enterprise-beans>
              <!-- Session Beans -->
              <session>
                   <description><![CDATA[No Description.]]></description>
                   <ejb-name>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</ejb-name>
                   <home>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeHome</home>
                   <remote>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</remote>
                   <ejb-class>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeEJB</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
              <!--
    To add session beans that you have deployment descriptor info for, add
    a file to your merge directory called session-beans.xml that contains
    the <session></session> markup for those beans.
    -->
              <!-- Entity Beans -->
              <!--
    To add entity beans that you have deployment descriptor info for, add
    a file to your merge directory called entity-beans.xml that contains
    the <entity></entity> markup for those beans.
    -->
              <!-- Message Driven Beans -->
              <!--
    To add message driven beans that you have deployment descriptor info for, add
    a file to your merge directory called message-driven-beans.xml that contains
    the <message-driven></message-driven> markup for those beans.
    -->
         </enterprise-beans>
         <!-- Relationships -->
         <!-- Assembly Descriptor -->
         <assembly-descriptor>
              <!-- finder permissions -->
              <!-- transactions -->
              <!-- finder transactions -->
         </assembly-descriptor>
    </ejb-jar>
    this ejb-jar.xml only contains entries for session beans? where did the entries for entity beans went?Ive written XDoclet tags for the Entity Bean as what ive posted above....help!!!

    you comment the generation of CMP entity beans out :
    build.xml:
    replace
    <!-- <entitycmp/> -->
    with
    <entitycmp/>i've already removed the comments of the tag <entitycmp> and yet the resulting ejb-jar.xml contains no <entity> tags....i'm just wondering how can i include the generation of entity tags (not only session tags) in the resulting ejb-jar.xml
    <ejb-jar>
    <description>No Description.</description>
         <display-name>Generated by XDoclet</display-name>
         <enterprise-beans>
              <!-- Session Beans -->
              <session>
                   <description><![CDATA[No Description.]]></description>
                   <ejb-name>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</ejb-name>
                   <home>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeHome</home>
                   <remote>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacade</remote>
                   <ejb-class>com.uniserv.comn.controller.ejb.session.terminalfacade.TerminalSessionFacadeEJB</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
              <!--
    To add session beans that you have deployment descriptor info for, add
    a file to your merge directory called session-beans.xml that contains
    the <session></session> markup for those beans.
    -->
              <!-- Entity Beans -->
              <!--
    To add entity beans that you have deployment descriptor info for, add
    a file to your merge directory called entity-beans.xml that contains
    the <entity></entity> markup for those beans.
    -->
              <!-- Message Driven Beans -->
              <!--
    To add message driven beans that you have deployment descriptor info for, add
    a file to your merge directory called message-driven-beans.xml that contains
    the <message-driven></message-driven> markup for those beans.
    -->
         </enterprise-beans>
         <!-- Relationships -->
         <!-- Assembly Descriptor -->
         <assembly-descriptor>
              <!-- finder permissions -->
              <!-- transactions -->
              <!-- finder transactions -->
         </assembly-descriptor>
    </ejb-jar>

  • How will be the weblogic-ejb-jar and ejb-jar xml for EJB Local Interface?

    Hi,
    I have one ear application which is using Stateless Session Beans. I don't have any Bean to Bean communication . At present, the client is invoking remote methods thro Home/Remote interfaces. My doubt is , shall I implement EJBLocal home/ local interface to obtain this same functionality cos, in this app, both client and EJb bean have been deployed in same JVM. Can Local interfaces only be applicable to Bean - Bean relation ship?If LocalHome/Local interfaces can be implemented in my scenario, then may I know how will be the ejb-jar.xml and weblogic-ejb-jar.xml?
    thanks and regards,
    Venkat.

    Local interfaces are for communication between ejbs and their clients when both are in the same JVM. The clients can be normal clients, jsps, servlets, and other ejbs. If the client is not in the same JVM you cannot use local interfaces even though your client is another ejb.
    Advantage of using local interface is it reduces the network overhead.
    For more information you can download Mastering Enterprise Java Beans Third Edition by Ed Roman. You can go through 45
    You can download pdf version from.
    http://www.theserverside.com/books/wiley/masteringEJB/index.tss.
    Let me know the URL of the ejb doc that you referred.
    Thanks..

  • Can't create EJB from existing .java AND ejb-jar.xml entries

    I've noticed that I can create the source files for an EJB outside of JDeveloper, then I can do the "Create Entity Bean" thing, and specify the path to the source files, and it will use those source files, instead of forcing me to create them again.
    However, I've noticed that if I manually add the information to the "ejb-jar.xml" file, and then try to add the bean, it won't let me. I've found I have to delete the entry from the ejb-jar.xml file and let JDeveloper control the creation of the fields, even if I know exactly what needs to be set.

    If you are adding/modifying ejb-jar.xml outside JDeveloper and trying to see the changes.
    Save the ejb-jar.xml file which is being modified externally
    Select ejb-jar.xml in JDeveloper
    and do View | Refresh
    This will load in the changes (providing the source path has been set properly)
    raghu
    JDev Team

  • Many EJB's and ejb-jar.xml

    I will have about 20 EJB's who have relationships with each other.
    Now all those EJB's come in the same deployment descriptor, causing it to grow to over 2000 lines.
    Is it possible to split the ejb-jar.xml in several ejb-jar.xml's? One for every EJB or one for every EJB group as a business object pattern.
    Or is there another solution?

    No - this is a case of "what you sow, you reap." In other words, if you have that many relations, you have a large ejb-jar.xml, since all the Entities involved in the relations must be in the same .jar file. What I would try to do is break down the relations into logical groupings and, ideally, those groups would not have relations with each other. Then split those groups out into separate deployments. Or if the relation between two groups is "light" (maybe only one), you can manually handle the relation through remote calls, instead of using CMR.

  • Please check this ejb-jar.xml, weblogic-ejb-jar.xml,weblogic-cmp-rdbms.xml

    i am getting a classcast exception.My Stateless and stateful session bean works
    fine .. problem only with Entity bean. Please check these xml files and let me
    know if i have missed anything.
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>stores</ejb-name>
    <home>Ejb.Stores.storesHome</home>
    <remote>Ejb.Stores.storesRemote</remote>
    <ejb-class>Ejb.Stores.storesBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>storesBean</abstract-schema-name>
    <cmp-field>
    <field-name>productId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>descrip</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>price</field-name>
    </cmp-field>
    <primkey-field>productId</primkey-field>
    <query>
    <query-method>
    <method-name>findPriceGreaterThan</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE a.price > ?1]]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>stores</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- end of ejb-ar.xml---------------------
    weblogic-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>stores</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
         <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
         <type-version>6.0</type-version>
         <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
         </persistence-type>
         <persistence-use>
         <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
         <type-version>6.0</type-version>
         </persistence-use>
    </persistence>
    </entity-descriptor>
    <jndi-name>storesEntity</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ------------- end of weblogic-jar.xml----------
    weblogic-cmp-rdbms-jar.xml
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0
    EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>stores</ejb-name>
    <data-source-name>sqlTX</data-source-name>
    <table-name>ProductEJBTable</table-name>
    <field-map>
    <cmp-field>productId</cmp-field>
    <dbms-column>productId</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>descrip</cmp-field>
    <dbms-column>descrip</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>price</cmp-field>
    <dbms-column>price</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>false</create-default-dbms-tables>
    </weblogic-rdbms-jar>
    ---------------- end of weblogic-cmp-rdbms-jar.xml----------
    Do i have to mention the connection Pool name anywhere .. My connection Pool name
    is sql7Pool and my datasource name which i have mentioned is sqlTx. I am using
    Sql server 7. I am deploying a jar file(not a war file) and accessng the EJB through
    a Servlet. Please any help would definitely be appreciated.
    Cheers
    Ashish.

    I thought you were getting a class cast exception but the stack trace shows
    a NullPointerException on line 38 of your servlet code. I am not sure if the
    code that you have attached is the complete code or just snippets of your
    complete code. Anyways, counting 38 lines in the code you attached points to
    the line "mr =
    mh.create(request.getParameter("login"),request.getParameter("name"));"
    which could be because "mh" is null. Can you verify "mh" is not null and
    also "objRef" is not null.
    Attaching the stack trace for ClassCastException would be useful.
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hey Anand,
    Thanks for your reply. I have attached the StackTrace,Servlet code andmy
    location and settings of my servlet .
    This is the StackTrace which i get :
    pl.java:265)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    before create
    java.lang.NullPointerException
    at trialweblogic.webServlet.doGet(webServlet.java:38)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:265)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    -------------- end of StackTrace---------------------
    My Servlet Code is
    package trialweblogic;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import javax.ejb.ObjectNotFoundException;
    import javax.ejb.DuplicateKeyException;
    import javax.ejb.EJBException;
    import java.rmi.RemoteException;
    import java.rmi.Remote;
    import trialweblogic.*;
    public class webServlet extends HttpServlet {
    masterHome mh;
    masterRemote mr;
    OutputStream out;
    private static final String CONTENT_TYPE = "text/html";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponseresponse)
    throws ServletException, IOException {
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    // out = response.getOutputStream();
    try{
    InitialContext ic = new InitialContext();
    Object objRef = ic.lookup("masterBeanJNDI");
    mh =(masterHome)PortableRemoteObject.narrow(objRef,masterHome.class);
    >
    mr =mh.create(request.getParameter("login"),request.getParameter("name"));
    out.println("after create");
    }catch(Exception ex){
    ex.printStackTrace();
    public void destroy() {
    --------- end of servlet--------------
    I am using Weblogic 6.1. I have included the following in my web.xml filewhich
    is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF
    >
    >
    <servlet>
    <servlet-name>webServlet</servlet-name>
    <servlet-class>trialweblogic.webServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>webServlet</servlet-name>
    <url-pattern>/webServlet/*</url-pattern>
    </servlet-mapping>
    My Servlet is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF\class
    es\trialweblogic\
    folder. In this folder i also have the supporting files (home,remote &bean tooo).
    >
    >
    I call this servlet when te user submits the info from a JSP page.
    Hope this info helps in solving my problem. Do i have to mention theconnection
    Pool name anywhere in the xml descriptor or am i missing anything here. iguess
    Connection Pool name is not required since we are mentioning the JNDI namein
    the xml descriptor. Bye for now.Awaiting your reply.
    Cheers
    Ashish.
    "Anand Byrappagari" <[email protected]> wrote:
    It is unlikely that your xml descriptors can cause class cast exceptions.
    How did you install the servlet? Can you attach the servlet code that
    might
    help. Also complete stack trace of the exceptions would be helpful.
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    Hi Anand,
    Thanks for quic reply.Hey i am using weblogic6.1. I am Not usinga WAR
    and
    ear file.I have created a jar file and deployed it.now i have createda
    servlet
    to access entity bean.Is a war file neccessary for accesing an entitybean
    through
    Servlet or JSP ???I am using sql server 7. The error that it givesis -----
    java.lang.ClassCastException: Cannot narrow remote object<br>
    "inside lookup method aaaaaaa" java.lang.NullPointerException. <br>
    Hope to get ur reply soon. in another entity bean i am getting thiserror ---
    java.lang.ClassCastException:
    weblogic.jdbc.common.internal.RmiDataSource
    .. I
    can't understand wots this error. I feel i am missing something inmy xml
    descriptor.
    Bye for now.
    Cheers
    Ashish.
    "Anand Byrappagari" <[email protected]> wrote:
    Can you attach the stack trace for the exception? Also please describe
    you
    environment - are the war and jar files installed separately? Are
    they
    composed into a ear? Also when are you getting a classcast exception?
    -- Anand
    "Ashish Suvarna" <[email protected]> wrote in message
    news:[email protected]...
    i am getting a classcast exception.My Stateless and stateful sessionbean
    works
    fine .. problem only with Entity bean. Please check these xml filesand
    let me
    know if i have missed anything.
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD EnterpriseJavaBeans
    2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>stores</ejb-name>
    <home>Ejb.Stores.storesHome</home>
    <remote>Ejb.Stores.storesRemote</remote>
    <ejb-class>Ejb.Stores.storesBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>storesBean</abstract-schema-name>
    <cmp-field>
    <field-name>productId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>descrip</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>price</field-name>
    </cmp-field>
    <primkey-field>productId</primkey-field>
    <query>
    <query-method>
    <method-name>findPriceGreaterThan</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    <![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE
    a.price> >> >>> >> >?1]>
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>stores</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- end of ejb-ar.xml---------------------
    weblogic-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD
    WebLogic
    6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>stores</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <jndi-name>storesEntity</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ------------- end of weblogic-jar.xml----------
    weblogic-cmp-rdbms-jar.xml
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD
    WebLogic
    6.0.0
    EJB RDBMS Persistence//EN'
    'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dt
    d
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>stores</ejb-name>
    <data-source-name>sqlTX</data-source-name>
    <table-name>ProductEJBTable</table-name>
    <field-map>
    <cmp-field>productId</cmp-field>
    <dbms-column>productId</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>descrip</cmp-field>
    <dbms-column>descrip</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>price</cmp-field>
    <dbms-column>price</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <create-default-dbms-tables>false</create-default-dbms-tables>
    </weblogic-rdbms-jar>
    ---------------- end of weblogic-cmp-rdbms-jar.xml----------
    Do i have to mention the connection Pool name anywhere .. My
    connection
    Pool name
    is sql7Pool and my datasource name which i have mentioned is sqlTx.I am
    using
    Sql server 7. I am deploying a jar file(not a war file) and accessngthe
    EJB through
    a Servlet. Please any help would definitely be appreciated.
    Cheers
    Ashish.

  • What's s the best automated route from stateless session bean class to EJB?

    Hi,
    I have an application that generates stateless session bean classes.
    For any given stateless session bean class, I would like to build an EJB, moreover, I would like to automate the process as much as possible.
    I'd rather not rely on a full blown third party IDE.
    I reckon could write a set of java classes that could analyse the session bean class and generate the home and remote interface and a basic deployment descriptor.
    That said, I have no doubt that I would be renventing the wheel.
    But I am struggling to find a utility/class of the appropriate granularity in the public domain.
    I am wide open to any feedback on approaches people may have taken and the pros and pitfalls.
    I fully realise my question is quite unspecific, but I really wanted to get some feedback and start a discussion. Since, I am sure there is no 'correct' answer.
    Most kind regards,
    Simon.

    My best advice: surrender to use an IDE.
    You wonder sometimes at how much productivity (read as 'time') could be wasted by doing something that could be done automatically. For a learning experience or a once only exercise is fine but as a routine thing, not worth it.
    Cheers

  • Sun-ejb-jar.xml  y ejb-jar.xml

    Hello
    I�m using SUn oNE Applciation Server and it request sun-ejb-jar.xml for this file when i deploy a ejb but i only have in the jar, generating by sun one studio , ejb-jar,xml , is it the same file?

    up

  • ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml'

    I have this error while compiling session bean (Stateful). my weblogic-ejb-jar.xml
    file looks like this. Could anyone tell me what I'm doing wrong.
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>TransactionAgent</ejb-name>
    <stateless-session-descriptor>
         <pool>10</pool>
         <stateless-clustering>false</stateless-clustering>
    </stateless-session-descriptor>
    <ejb-ref-name>ejb/Transaction</ejb-ref-name>
    <jndi-name>Transaction</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>

    <pool> should not have any value. Instead it shud have the child nodes
    <max-beans-in-free-pool> and/or <initial-beans-in-free-pool>
    it will look like
    <pool>
    <max-beans-in-free-pool> 500 </max-beans-in-free-pool>
    <initial-beans-in-free-pool>100 </initial-beans-in-free-pool>
    </pool>
    Also, <ejb-ref-name> and <jndi-name> goes under <ejb-reference-descriptor>
    which is under <reference-descriptor>
    So it would look like
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name> .. </ejb-ref-name>
    <jndi-name> .. </jndi-name>
    <ejb-reference-description>
    </reference-descriptor>
    The jndi name should also be defined for the bean. Also note that ejb-refs
    are defined under a bean which is referring other beans. Like Transaction
    should not refer to itself. Rather if it is referring to Customer, then
    ejb-ref will be defined for CustomerBean.
    Hope it helps.
    Rupesh.
    Owen <[email protected]> wrote in message
    news:3c614fb0$[email protected]..
    >
    I have this error while compiling session bean (Stateful). myweblogic-ejb-jar.xml
    file looks like this. Could anyone tell me what I'm doing wrong.
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>TransactionAgent</ejb-name>
    <stateless-session-descriptor>
    <pool>10</pool>
    <stateless-clustering>false</stateless-clustering>
    </stateless-session-descriptor>
    <ejb-ref-name>ejb/Transaction</ejb-ref-name>
    <jndi-name>Transaction</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>

  • More than one ejb in ejb-jar.xml ?

    Can i have more than one ejb in a jar file ??

    Include session and entity beans in your ejb-jar.xml with <session> &
    <entity> tags.
    <enterprise-beans>
    <session>
    </session>
    <entity>
    </entity>
    </enterprise-beans>
    David wrote:
    Can i have more than one ejb in a jar file ??

  • Will weblogic-ejb-jar.xml dtd 6.0 working fine on server 8.1?

    Hi guys,
    I have problem when use weblogic-ejb-jar.xml on server 8.1. JNDI compalain can not find local-home.
    Thanks!

    The interfaces and ejb-jar.xml, weblogic-ejb-jar.xml were generated by Xdoclet. I just copy the .ear file to the deployment directory. Is there anything more I need to do? Thanks!
    Here is the error message:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: remaining name: java:app/ejb/sims_hta.jar#HierarchyAdminSession/local-home
         at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
         at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:39)
         at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:57)
         at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:62)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at weblogic.jndi.internal.WLNamingManager.getObjectInstance(WLNamingManager.java:96)
         at weblogic.jndi.internal.ServerNamingNode.resolveObject(ServerNamingNode.java:265)
         at weblogic.jndi.internal.BasicNamingNode.resolveObject(BasicNamingNode.java:732)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:191)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:196)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:237)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:336)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.hta.servlet.HTAUtil.getHierarchyAdminSessionLocal(HTAUtil.java:622)
         at com.hta.servlet.HTAUtil.getPropertyDictionaryValues(HTAUtil.java:745)
         at com.hta.servlet.jsp.bean.Admin.getPropertyDictinaryValues(Admin.java:870)
         at com.hta.servlet.jsp.bean.Admin.getRunLevelDisplayParameters(Admin.java:819)
         at jsp_servlet._sims_jsp._app._hta.__incell_import._jspService(__incell_import.java:463)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

  • Ejb-jar.xml中的EJB QL和weblogic-cmp-rdbms-jar.xml中的WLQL

    我想问一下,在ejb-jar.xml文件中用EJB QL查询语言定义了相应的EJB QL查询语句后,在weblogic-cmp-rdbms-jar.xml文件中还需不需要用wlql语言来定义相应的查询语句呀?

    在Weblogic6.0中,如果你需要利用EJB2.0的EJBQL语言所不提供的
    ORDERBY排序功能,那么这时候可以在weblogic-cmp-rdbms-jar.xml中用WLQL覆盖它,一般情况下,在ejb-jar.xml中声明一个EJBQL方法就可以了,WLQL可有可无。

  • StreamCorruptedException from Stateless Session bean to java class

    Hi all,
    We have 2 servers, a ColdFusion App server which contains suns jdk 1.4.2 and websphere appserver using Ibm jdk, 1.4.2. On Server 1, we have a standalone java class which does a stateless session bean lookup and requests a service from it. On server 2(websphere), we have a stateless session bean deployed which connects to a database using a jndi lookup, executes a query and returns back a CachedRowSet object (which populates the ResultSet from the above query.) In some cases, session bean returns back an array of objects or String objects or just plain int values.
    When the java class on server 1 invokes the methods returning CachedRowSet, we are getting a StreamCorruptedException, whereas on the server side, there is no exception. everything gets executed fine on websphere. This is the case only for CachedRowSet and not for other return types(as mentioned earlier the session bean returns an array of object in some cases which the java class on server 1 is successfully able to use).
    This is what the piece of code look like on server 1:
    // First gets a StatelessSessionBean using suns InitialContextFactory
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL,"iiop://localhost:2809");
    System.out.println("Creating initial context");
    Context ctx = new InitialContext(env);
    System.out.println("Initial context created.");
    Object homeObj = ctx.lookup("cell/nodes/localhost/servers/server1/ejb/SSBHome");
    SSBHome eHome = (SSBHome)PortableRemoteObject.narrow(homeObj,SSBHome.class);
    System.out.println("Got Home");
    SSB eBean = eHome.create();
    CachedRowSet crs = eBean.getAccts(param1, param2);
    //This is the line of code which throws the exception.
    The stacktrace shoows as follows:
    Got Home
    java.io.StreamCorruptedException
         at com.sun.corba.se.internal.io.IIOPInputStream.inputRemoteMembersForReadFields(IIOPInputStream.java:1675)
         at com.sun.corba.se.internal.io.IIOPInputStream.readFields(IIOPInputStream.java:1595)
         at com.sun.corba.se.internal.io.InputStreamHook.readFields(InputStreamHook.java:177)
         at java.math.BigInteger.readObject(BigInteger.java:3034)
         at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:908)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1484)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1893)
         at com.sun.corba.se.internal.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:424)
         at com.sun.corba.se.internal.io.InputStreamHook.defaultReadObject(InputStreamHook.java:163)
         at java.math.BigDecimal.readObject(BigDecimal.java:1084)
         at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1182)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:259)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.EJBProj._SSB_Stub.getAccts(_SSB_Stub.java:240)
         at com.test.Test1.getAccts(Test1.java:101)
         at com.test.Test1.<init>(Test1.java:65)
         at com.test.Test1.main(Test1.java:81)
    java.io.IOException: Unable to read value from underlying bridge : Serializable readObject method failed internally
         at com.sun.corba.se.internal.io.IIOPInputStream.throwExceptionType(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:446)
         at com.sun.corba.se.internal.io.InputStreamHook.defaultReadObject(InputStreamHook.java:163)
         at java.math.BigDecimal.readObject(BigDecimal.java:1084)
         at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
         at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1182)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:259)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:948)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:289)
         at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:266)
         at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:635)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:260)
         at com.sun.corba.se.internal.javax.rmi.CORBA.Util.readAny(Util.java:100)
         at javax.rmi.CORBA.Util.readAny(Util.java:90)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:586)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:244)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1577)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:1796)
         at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:913)
         at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
         at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
         at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
         at com.EJBProj._SSB_Stub.getAccts(_SSB_Stub.java:240)
         at com.test.Test1.getAccts(Test1.java:101)
         at com.test.Test1.<init>(Test1.java:65)
         at com.test.Test1.main(Test1.java:81)
    Again, everything seems to work fine on websphere server.
    Any Clue of why this is happening?
    All suggestions are greatly appreciated.
    Thanks
    Neorav
    Message was edited by:
    NeoravB

    Sorry for the confusion!
    The solution mentioned above is not the right solution.
    The above given code works fine irrespective of having corbaloc in the url, if you are working in the IBMs jvm.
    It fails if you are working in suns jvm.
    Anyone with any idea whats missing here.
    Thanks a lot for any suggestion/ideas
    Neorav

  • Trying to call stateless session bean from MDB

    Folks,
    Am working on RAD and WAS 8.
    I have an MDB. And a stateless session bean (AOBean under EJB project).
    While the listener listens to the messages from queue, it also tries to persist to db. I want to achieve this via a method of AOBean (through instantiating session bean or by injection).
    I have been sucessful by invoking a method from AOBean class -  that method just returns a string (without any objects being passed)
    Problem:
    I am getting IllegalStateException when I try to invoke a method of AOBean class, that has an object as a parameter
    For eg:
    MDB
    @EJB(name="ejb/TransactionMgrAOBean", mappedName="ejb/TransactionMgrAOBean")
    ITransactionMgrAO tranAO;
        public void onMessage(Message message) {
         TextMessage textMessage = (TextMessage) message;
         boolean status = false;
      try {
       TransactionVO tranVO =  getTransactionVO();//Here building the object to be passed to session bean
       String status1  = tranAO.getVersion(tranVO);
      }catch(Exception e){
    AOBean
    @Stateless
    @Remote({ ITransactionMgrAO.class })
    @WebService
    public class TransactionMgrAOBean {
    public String getVersion(TransactionVO tranVO) throws Exception{
      try{
    //business logic 
      } catch(Exception e){
      throw e;
      return true;
    TransactionVO implements Serializable has also inner static classes that are not Serializable.
    EXCEPTION: At runtime we are getting exception saying that the inner classes are not serialized.
    REASON why we are invoking session bean from MDB? We found that if we invoke any service from AOBean the transaction management was successful. We are using sessionContext.setRollBackonly when an exception occurs. Tranasactions are not rolled back when any db exception occurs if we invoke business logic methods from Model layer of another NON-EJB package.
    Hope I have provided enough information!

    My concret problem is that I want to call an ejb session contained in an ejb project from a session bean in a different web project. When I include the code in my web session bean I get the error adjunted:
    - Code:
    @EJB
    private UserRemote userSessionBean;
    - Error:
    Exception Details: javax.naming.NameNotFoundException
    pac.UserRemote#pac.UserRemote not found
    Possible Source of Error:
    Class Name: com.sun.enterprise.naming.TransientContext
    File Name: TransientContext.java
    Method Name: doLookup
    Line Number: 216
    Any suggestion?

Maybe you are looking for

  • How do I make web shortcuts into start screen tiles that can be pushed to all users profile on a computer in Windows 8.1 enterprise?

    We are trying to roll out Windows 8.1 Enterpise in our school system (K-12). The focus of this question is how do we take an internet web based shortcut and make it into a screen tile (on the start screen) which will appear for any user's start scree

  • Getting error in dispaling smartform

    Hi , I have an application where the below BAPI is displaying the smartform in ABAP webdynpro. The output is taken from a TLINE table which consists of the special characters. The requirement is to display this smartform from Webdynpro Java but the o

  • IPhone sync freeze problem

    I've searched all the posts and tried everything (I think) but still have a problem. Syncing iPhone causes iTunes to freeze with force-quit the only option. Here's what I've tried: - repaired permissions - repaired drive (Disk Util) - repaired drive

  • New Keyboard + Last Gen iMac Help Please

    Hello, I'm using the most recent generation (right before the release of the aluminum ones) iMac Core 2 Duo 2.16 20" and I have a very minor problem: I ordered the new wired keyboard - the brushed aluminum one... wow it's awesome - super thin, nice k

  • [11g] adding a virtual col to a binary XML table?

    Hi Is it possible to add a virtual col to an existing binay XML table ? CREATE TABLE compagnie_binaryXML OF XMLType XMLTYPE STORE AS BINARY XML VIRTUAL COLUMNS (vircolcomp AS (EXTRACTVALUE(OBJECT_VALUE,'/compagnie/comp')), vircolnomcomp AS (EXTRACTVA