EntityBean problems...

I've encoutered a couple of problems with Home methods, the remote calls
appear to work okay.
Setup:
- WLS 6.0 SP1
- 1 CMP EntityBean
- NT 4.0
- Using default orbs
First step, running ejbc with the -iiop option appears to create three pairs
of stubs/skeletons for each home. They are:
AccountHomeStub
AccountBeanHomeImplTie
AccountBeanHomeImpl_WLStub
AccountBeanHomeImpl_WLSkel
AccountHome_WLStub
AccountHome_WLSkel
I paired them up as I think they go. The first pair appears to be the one
generated for Corba/iiop usage.
The next step was to change the client to use iiop as the protocol and to
use the PortableRemoteObject to narrow the JNDI lookup. One thing I found
here is that the generated stubs have to be in the client's classpath
(according to the newsgroup, I think this is a bug?). The lookup is then
successful. I ran into some other problems here that could be attributed to
server config, more precisely, the Security configuration. I'm still not
100% sure what the actual problem was...
Now we can create beans, invoke some methods, remove them, etc... fine. I
discovered problems when the findByPrimaryKey throws a
javax.ejb.ObjectNotFoundException. Tracing through this I discovered that
the stub used on the client is '_AccountHome_Stub' but the skeleton used on
the server is 'AccountBeanHomeImpl_WLSkel'. It looks to me like it's a
mismatch. After decompiling the above stubs/skels I don't think this
problem would occur if '_AccountBeanHomeImpl_Tie' was used on the server
side. Is it truly a mismatch between the stubs and skeletons? Is it a bug
or configuration issue? There were no server side errors and actual error
on the client side is:
java.rmi.UnexpectedException: IDL:javax/ejb/ObjectNotFoundEx:1.0
The second problem I'm experiencing has to with a finder. I've tried this
with both an Enumeration and Collection return type with the same results.
The client stub fails when trying to read the results from the stream. I
have no idea why. It may be because of the stub/skeleton 'mismatch'??
Again, no server side error, the client error is:
java.lang.NullPointerException
at
com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java
:950)
at
examples.ejb.cmp.account._AccountHome_Stub.findLargeAccounts(UnknownSource)
at
examples.ejb.cmp.account.Client.findLargeAccounts(Client.java:116)
at examples.ejb.cmp.account.Client.runExampleB(Client.java:412)
at examples.ejb.cmp.account.Client.main(Client.java:307)
I put some debug statements in the stub and found that the input stream DOES
contain data.
The last problem I encountered arose when trying to look up the
UserTransaction in JNDI. From the docs, I gather we can't use client side
transactions? This is from WebLogic's docs:
EJB-to-CORBA mapping
WebLogic RMI over IIOP is the framework for EJB-to-CORBA mapping support.
Currently, however, a standard for passing user identity -- required to
implement EJB-to-CORBA mapping -- does not exist and the requirement for
transaction propagation from the client is in question. While RMI over IIOP
does allow CORBA clients to access EJBeans, the following services will not
be available:
EJB transaction services
EJB security services

Hi,
I'm having similar problems with an entity bean. I have a findAll method
that has the same error as yours, since it returns a Collection.
The other problem I have is with a create method. My bean has two create
methods, one with no args, one with a String argument. When I use the one
with the String argument, the object is created, but the field that should
be set using the argument is not. What's odd is that I'm using the CMP
accessors to set the field inside the ejbCreate, and when tested alone, the
accessor works.
Of course, everything works fine over T3. Can someone please shed some light
on these problems?
Thanks,
Michelle
"Jason Haley" <[email protected]> wrote in message
news:[email protected]...
I've encoutered a couple of problems with Home methods, the remote calls
appear to work okay.
Setup:
- WLS 6.0 SP1
- 1 CMP EntityBean
- NT 4.0
- Using default orbs
First step, running ejbc with the -iiop option appears to create threepairs
of stubs/skeletons for each home. They are:
AccountHomeStub
AccountBeanHomeImplTie
AccountBeanHomeImpl_WLStub
AccountBeanHomeImpl_WLSkel
AccountHome_WLStub
AccountHome_WLSkel
I paired them up as I think they go. The first pair appears to be the one
generated for Corba/iiop usage.
The next step was to change the client to use iiop as the protocol and to
use the PortableRemoteObject to narrow the JNDI lookup. One thing I found
here is that the generated stubs have to be in the client's classpath
(according to the newsgroup, I think this is a bug?). The lookup is then
successful. I ran into some other problems here that could be attributedto
server config, more precisely, the Security configuration. I'm still not
100% sure what the actual problem was...
Now we can create beans, invoke some methods, remove them, etc... fine. I
discovered problems when the findByPrimaryKey throws a
javax.ejb.ObjectNotFoundException. Tracing through this I discovered that
the stub used on the client is '_AccountHome_Stub' but the skeleton usedon
the server is 'AccountBeanHomeImpl_WLSkel'. It looks to me like it's a
mismatch. After decompiling the above stubs/skels I don't think this
problem would occur if '_AccountBeanHomeImpl_Tie' was used on the server
side. Is it truly a mismatch between the stubs and skeletons? Is it abug
or configuration issue? There were no server side errors and actualerror
on the client side is:
java.rmi.UnexpectedException: IDL:javax/ejb/ObjectNotFoundEx:1.0
The second problem I'm experiencing has to with a finder. I've tried this
with both an Enumeration and Collection return type with the same results.
The client stub fails when trying to read the results from the stream. I
have no idea why. It may be because of the stub/skeleton 'mismatch'??
Again, no server side error, the client error is:
java.lang.NullPointerException
at
com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java
:950)
at
examples.ejb.cmp.account._AccountHome_Stub.findLargeAccounts(UnknownSource)
at
examples.ejb.cmp.account.Client.findLargeAccounts(Client.java:116)
at examples.ejb.cmp.account.Client.runExampleB(Client.java:412)
at examples.ejb.cmp.account.Client.main(Client.java:307)
I put some debug statements in the stub and found that the input streamDOES
contain data.
The last problem I encountered arose when trying to look up the
UserTransaction in JNDI. From the docs, I gather we can't use client side
transactions? This is from WebLogic's docs:
EJB-to-CORBA mapping
WebLogic RMI over IIOP is the framework for EJB-to-CORBA mapping support.
Currently, however, a standard for passing user identity -- required to
implement EJB-to-CORBA mapping -- does not exist and the requirement for
transaction propagation from the client is in question. While RMI overIIOP
does allow CORBA clients to access EJBeans, the following services willnot
be available:
EJB transaction services
EJB security services

Similar Messages

  • Database problems deploying a CMP EntityBean

    Hi,
    I've written an CMP EntityBean and i've put the EJB-QL statements for the findermethods in the deployment descriptor.
    What i've written is an extra bean into the petstore as an exercise.
    What I don't understand is how the database-table is created. I don't have a create table statement anywhere in my code.
    The error I get during deployment is as follows:
    deploy:
    [exec] Generated sql = SELECT "a"."userId" FROM "CustomerEJBTable" "a"
    [exec] java.lang.RuntimeException: No database specified for CMP EntityBeans' persistent state
    [exec] at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:196)
    [exec] at com.sun.enterprise.tools.deployment.main.DeployTool.doGenerateSQL(DeployTool.java:260)
    [exec] at com.sun.enterprise.tools.deployment.main.Main.main(Main.java:268)
    [exec] Result: 2
    [exec] Deploy the application in ..\build\petstore.ear on the server localhost saving the client jar as null
    [exec] Sender object Deploy Tool : Deploy PetStoreEAR on localhost
    [exec] Remote message: Contacted Server....
    [exec] Remote message: Application PetStoreEAR transferred.
    [exec] Remote message: PetStoreEAR has 16 ejbs, 1 web components to deploy.
    [exec] Remote message: Deploying Ejbs....
    [exec] Remote message: Processing beans ....
    [exec] Remote message: Compiling wrapper code ....
    [exec] Sender object Deploytool (Main) : RemoteException occurred in server thread; nested exception is:
    [exec] java.rmi.RemoteException: Error processing ejb jar: Compilation failed.
    [exec] Result: 1
    My EJB has nothing to do with that CustomerEJBTable, I want my bean to be stored in its own table.
    I've tried to create a table with cloadview into the PetstoreDB-database, but that doesn't seem to work eather.
    any ideas what I'm doing wrong ???
    Thanks.

    Before you deploy a CMP, you have to either create the corresponding database table or you have to declare that the table be created at deployment time. You have to declare this in the runtime deployment descriptor. So you don't need a create table statement anywhere in your code.
    Hope that helps,
    Smitha

  • EntityBean Deployment settings Sun App Server. (j2ee1.3.1) problem

    I am getting following error:
    ERROR: while generating SQL.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: Error connecting to database; nested exception is:
    javax.naming.NameNotFoundException: sqlServer__pm not found
    Please make sure the database name/user/password is valid
    and the J2EE server and database are running.

    Well, the obvious questions are: a) is your database running? b) if so, did you configure the Application Server to correctly connect to your database server?
    The latest version of J2EE is 1.4, by the way. Unless you have a particular reason for using J2EE 1.3, I'd suggest installing the 1.4 SDK.
    -Ian Evans

  • Problem instantiating an entityBean

    Hi,
    i'm using the CabinBean-example from O'reilly's EJB2.0 3rd edition.
    i wrote the bean, the HomeRemote- and Remote-Interface, deployed it on jboss (it's creating the tables and says the jar-file is ok)
    but when i run the client, it says:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.ServerException: EJBException:; nested exception is:
    javax.ejb.EJBException: Could not instantiate bean; nested exception is: java.lang.InstantiationException
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
    at sun.rmi.transport.Transport$1.run(Transport.java:148)
    this is the client code:
    package com.titan.cabin;
    import com.titan.cabin.CabinHomeRemote;
    import com.titan.cabin.CabinRemote;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import java.rmi.RemoteException;
    import java.util.Properties;
    import javax.rmi.PortableRemoteObject;
    public class CabinClient1 {
    public static void main(String[] args) {
    try {
    Context jndiContext = getInitialContext();
    Object ref = jndiContext.lookup("CabinEJB");
    CabinHomeRemote home = (CabinHomeRemote)
    PortableRemoteObject.narrow(ref, CabinHomeRemote.class);
    CabinRemote cabin_1 = home.create(new Integer(1));
    cabin_1.setName("Master Suite");
    cabin_1.setDeckLevel(1);
    cabin_1.setShipId(1);
    cabin_1.setBedCount(3);
    Integer pk = new Integer(1);
    CabinRemote cabin_2 = home.findByPrimaryKey(pk);
    System.out.println(cabin_2.getName());
    System.out.println(cabin_2.getDeckLevel());
    System.out.println(cabin_2.getShipId());
    System.out.println(cabin_2.getBedCount());
    } catch (java.rmi.RemoteException re) { re.printStackTrace(); }
    catch (javax.naming.NamingException ne) { ne.printStackTrace(); }
    catch (javax.ejb.CreateException ce) { ce.printStackTrace(); }
    catch (javax.ejb.FinderException fe) { fe.printStackTrace(); }
    public static Context getInitialContext()
    throws javax.naming.NamingException {
    Properties props = System.getProperties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    return new javax.naming.InitialContext(props);
    i hope someone is able to help me ...
    thanks
    fb

    i think u r going in worng way,u intiallize home by "CabinHomeRemote"
    bt hor jboss would know what is "CabinHomeRemote"
    CabinHomeRemote home = (CabinHomeRemote)
    ur client code should be like this:
    Context ctx = null;
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    prop.put(Context.PROVIDER_URL, "localhost:1099");
         prop.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
         ctx = new InitialContext(prop);
    //lookup ur bean
    Object objref = ctx.lookup("CabinEJB");
    CabinHomeRemote home =
    (CabinHomeRemote)javax.rmi.
    PortableRemoteObject.narrow(objref,
    CabinHomeRemote.class);
    CabinRemote cabin_1 = home.create(new Integer(1));
    ok and before it plz read some document abt EJB. i think u r little bit confuse
    regards
    sachin

  • Design problem about repreatable entity relationships

    Hi all!
    As I design the data model (let's name it the ERD, no matter the name is quite unfashonable), I have found almost identical structures of entities and relationships between them, but playing completely different roles in the semantics of the model.
    It obviously makes no sense to implement all such entities separately as the Entity EJB as they are to share most of the fields and methods, but I found no "handsome" solution when trying to implement them as sets of classes and interfaces forming "the abstract EJBs", and then by putting the conrete classes and complementary interfaces at the final packages to create "concrete EJBs". The problem was about types returned by the createXXX and findXXX methods, because they had to return the "abstract" EJBs but the EJB programming contract forces them to return the "concrete" ones, that are unknown to me when defining the "abstract ones". So it cancels the sense for creating them this way. It was also unclear how to operate the relationships in such model.
    The idea was:
    1. I define BaseSthLocalHome extends EJBLocalHome
    2. I define BaseSthLocal extends EJBLocalObject
    3. I define BaseSthBean implements EntityBean
    ... this way I have the "abstract bean", and then I can create many:
    SthOneLocalHome extends BaseSthLocalHome,
    SthOneLocal extends BaseSthLocal,
    SthOneBean extends BaseSthBean ... to have the first "concrete" EJB,
    SthTwoLocalHome extends BaseSthLocalHome... and so on to create the second, third and all the next "concrete" EJBs.
    Anyway, it did not work fine as I defined createXXX and findXXX methods at the BaseSthLocalHome interface - it made sense, because those methods did not depend on the other entities.
    Has anyone some idea of how to solve the design problem? Currently we are at very beginning of the project, so we have some "case study" time, and I would appreciate any solution: redesign of the data model, extraction of new EJB modules or any use of the objective inheritance.
    Thanks in advance!
    Marcin Gawlik

    Again me - I now it is a bad idea to reply for own messages, but I have just checked a new idea:
    The problem was about re-using the same components in different roles. I tried to do that by creating subclasses of the EJB classes, but it did not work. So I tried to define multiple entity EJBs that have the same class.
    Considering the given example, it would look:
    1. public interface BaseSthLocalHome extends EJBLocalHome
    2. public interface BaseSthLocal extends EJBLocalObject
    3. public abstract class BaseSthBean implements EntityBean
    ... then I created the deployment descriptor that deploys this pack of class and interfaces as three separate CMP Entity Beans:
    1. deploy BaseSthBean as the SthOne CMP entity EJB
    2. deploy BaseSthBean as the SthTwo CMP entity EJB
    3. ... and so one
    The question is: IS THERE ANY CONTRA FOR THIS WAY OF DEPLOYING EJBS? Is there any reason for not to use the same class and its complementary interfaces many times to create many separate enity EJBs working within the same EJB module?
    Thanks in advance!
    Gaw

  • Problems accessing fields in a CMP entity bean from a session bean

    Hello everybody,
    I'm getting the next problem: when I try to access a field in a CMP entity bean that I have instantiated from a session bean (trhoug entitybean.getNameOfField), I get the error "the entity bean does not exist in the database".
    This entity bean is accessing a table in an external database (not the DB of the WAS), but I know that it's getting the correct data from the table, since  I check the entitybean.size() and the entitybean.findByPrimaryKey(), and I get the right information. For some reason, the only thing that it doesn't work in the entity bean are the getter/setter methods (I created them automatically after having created the entity fields).
    I access the entity bean through its local interface...
    I know it's really difficult to give an answer with so few details, but... does anybody think I forgot something important to configure??
    Thank very much in advance!!
    Isidro

    getter and setter methods for cmp-fields are abstract.
    getter and setter methods for cmr-fields are abstract.
    "John Lee" <[email protected]> wrote:
    >
    Hi:
    Which method in a CMP Entity bean should be abstract? just only SetXXX
    and
    GetXXX?
    Thanks!
    John Lee

  • What is the problem?

    I want to deploy a CMP Entity Bean in weblogic6.1SP2,but I meet an error,what should I do to solve the problem?
    the error code:
    <2003-4-7 ~{OBNg~}02~{J1~}27~{7V~}24~{Ck~}> <Error> <J2EE> <Error deploying application SVC:
    Unable to deploy EJB: CMPSvc from SVC.jar:
    The Container-Managed Persistence Entity EJB failed while creating its SQL Type
    Map. The error was:
    Io ~{Rl3#~}: Connection reset by peer: socket write error
    and my original code:
    SVC.java(remote interface)
    package CMPEntityBean;
    import javax.ejb.*;
    import java.rmi.RemoteException;
    public interface SVC extends EJBObject
         public java.lang.String getSvcID() throws RemoteException;
         public java.lang.String getSvcName() throws RemoteException;
         public void setSvcID(java.lang.String svcID) throws RemoteException;
         public void setSvcName(java.lang.String svcName) throws RemoteException;
    SVCHome.java (home interface file)
    package CMPEntityBean;
    import javax.ejb.*;
    import java.rmi.RemoteException;
    import java.util.Collection;
    public interface SVCHome extends EJBHome
    public SVC create(java.lang.String svcID,java.lang.String svcName) throws CreateException,RemoteException;
    public SVC findByPrimaryKey(CMPEntityBean.SVCPK key) throws FinderException,RemoteException;
    public Collection findBySvcName(java.lang.String svcName) throws FinderException,RemoteException;
    SVCBean.java (Enterprise Bean file)
    package CMPEntityBean;
    import javax.ejb.*;
    public abstract class SVCBean implements EntityBean
         protected EntityContext ctx;
         public abstract java.lang.String getSvcID();
         public abstract java.lang.String getSvcName();
         public abstract void setSvcID(java.lang.String svcID);
         public abstract void setSvcName(java.lang.String svcName);
         public void ejbActivate(){}
         public void ejbRemove(){}
         public void ejbPassivate(){}
         public void ejbLoad(){}
         public void ejbStore(){}
         public void setEntityContext(EntityContext ctx)
         this.ctx = ctx;
         public void unsetEntityContext()
         this.ctx = null;
         public void ejbPostCreate(String svcID,String svcName){}
         public SVCPK ejbCreate(String svcID,String svcName)
         setSvcID(svcID);
         setSvcName(svcName);
         return new SVCPK(svcID);
    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>CMPSvc</ejb-name>
    <home>CMPEntityBean.SVCHome</home>
    <remote>CMPEntityBean.SVC</remote>
    <ejb-class>CMPEntityBean.SVCBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>CMPEntityBean.SVCPK</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>SVCBean</abstract-schema-name>
    <cmp-field>
    <field-name>svcID</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>svcName</field-name>
    </cmp-field>
    <!--prim-key-class>svcID</prim-key-class-->
    <query>
    <query-method>
    <method-name>findBySvcName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
         <!--result-type-mapping>Local</result-type-mapping-->
    <ejb-ql>
    SELECT OBJECT(a) FROM SVCBean a WHERE svcName = ?1
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>CMPSvc</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    weblogic-ejb-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>CMPSvc</ejb-name>
    <entity-descriptor>
    <entity-cache>
         <max-beans-in-cache>1000</max-beans-in-cache>
    </entity-cache>
    <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>cmpsvc</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    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-rdbms-persistence.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>CMPSvc</ejb-name>
    <data-source-name>ucisOra</data-source-name>
    <table-name>TAB_SVC</table-name>
    <field-map>
    <cmp-field>svcName</cmp-field>
    <dbms-column>svcname</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>svcID</cmp-field>
    <dbms-column>svcid</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    </weblogic-rdbms-jar>
    thanks a lot!

    Try this
    SELECT OBJECT(a) FROM SVCBean a WHERE a.svcName = ?1

  • Weird error message from oc4j with EntityBean

    We have an J2EE application written originally to run on Orion 1.4.5.
    We have decided to try to port this to oc4j and the version we are using is 1.0.2.2
    There is some minor reconfiguration issue but nothing really major.
    All the servlet, jsp, and stateless session EJB runs without any problem.
    However, all the CMP EntityBean doesn't seem to like their new home.
    During deployment, the container will complaints about every single EntityBean with error message like the following:
    JavaApplication_EntityBeanWrapper33.java:358: Exception java.sql.SQLException is never thrown in the body of the corresponding try statement.
    catch(java.sql.SQLException e)
    JavaApplication is one of our CMP EntityBean and the Wrapper is supposingly created automatically by the container at deployment time.
    Has anyone encountered this before? Any work around/solutions?
    Thanks in advance
    Andrew
    null

    gday Andrew -
    I believe that this is caused by setting the attribute exclusive-write-access=false in the orion-ejb-jar.xml file for your EJBs.
    This is a known OC4J problem: a bug has been logged and it's been fixed here. The next minor release of OC4J will contain the fix for this.
    In the meantime as a workaround removing the exclusive-write-access=false attribute from the orion-ejb-jar.xml files for your beans should get you going.
    cheers!
    -steve.
    null

  • Mysql, Jboss connecting problem

    Hello,
    I am having problem with mysql database. I am trying to run AccountEJB application from SUN with mysql as my backend.
    PLEASE DO NOT FORGET I AM NOT EXPERT IN JBOSS OR EJB BUT I AM TRYING TO LEAN WITH A EXAMPLE.
    HERE IS MY SETUP UP TO THIS POINT.
    I am running jboss-3.03.0_tomcat-4.0.3
    I am including
    1. AccountBean
    2. ejb-jar.xml
    3. web.xml
    4. jboss.xml
    6. mysql-service.xml ( I add my database name, username, password and i copy it to ..server/default/deploy dir.)
    I only modified mysql-service.xml. Do i have to modify any other jboss files. Some people are saying i have to modify "standardjaws.xml, standardjbosscmp.xml"
    My AccountBean code is
    Please take a look at "setEntityContext" and "makeConnection" that is where problem comes.
    Here is the error
    10:43:19,950 INFO [Engine] AccountServlet: init
    10:43:19,950 INFO [STDOUT] AccountServlet: init()
    10:43:20,101 INFO [STDOUT] Got context
    10:43:20,311 INFO [STDOUT] Got referance
    10:43:20,371 INFO [STDOUT] Got referance to home object
    10:43:20,501 INFO [STDOUT] setEntityContext call....
    10:43:20,501 INFO [STDOUT] makeConnection call...
    10:43:20,501 INFO [STDOUT] Something went wrong within makeConnction call ....
    javax.naming.NameNotFoundException: MySqlDS not bound
    10:43:20,501 INFO [STDOUT] Came back from makeConnction call ...
    10:43:20,501 INFO [STDOUT] ejbCreate call
    10:43:20,501 INFO [STDOUT] insertRow call...
    10:43:20,511 ERROR [STDERR] Caught an exception.
    10:43:20,511 ERROR [STDERR] java.rmi.ServerException: ejbCreate: null; nested ex
    ception is:
    javax.ejb.EJBException: ejbCreate: null
    package com.ps.impl;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import java.sql.*;
    import javax.sql.*;
    import javax.ejb.*;
    import javax.naming.*;
    import java.util.*;
    import java.rmi.*;
    public class AccountBean implements EntityBean
    private EntityContext context;
    private String id;
    private String firstName;
    private String lastName;
    private double balance;
    private Connection con;
    //private String dbName = "java:/MySqlDS";
    public void debit (double amount)
    if (balance - amount < 0)
    else
    balance = balance - amount;
    public void credit (double amount)
    balance = balance + amount;
    public String getFirstName()
    return firstName;
    public String getLastName()
    return lastName;
    public double getBalance()
    return balance;
    public String ejbCreate(String id, String firstName, String lastName, double balance)
    throws CreateException
    System.out.println("ejbCreate call");
    if (balance < 0.00) {
    throw new CreateException
    ("A negative initial balance is not allowed.");
    try {
    insertRow(id, firstName, lastName, balance);
    } catch (Exception ex) {
    throw new EJBException("ejbCreate: " +
    ex.getMessage());
    this.id = id;
    this.firstName = firstName;
    this.lastName = lastName;
    this.balance = balance;
    return id;
    public void ejbPostCreate(String id, String firstname, String lastname, double blance)
    public String ejbFindByPrimaryKey(String primaryKey)
    throws FinderException
    System.out.println("ejbFindPrimaryKey call...");
    boolean result;
    try {
    result = selectByPrimaryKey(primaryKey);
    } catch (Exception ex) {
    throw new EJBException("ejbFindByPrimaryKey: " +
    ex.getMessage());
    if (result) {
    return primaryKey;
    else {
    throw new ObjectNotFoundException
    ("Row for id " + primaryKey + " not found.");
    public Collection ejbFindByLastName(String lastName)
    throws FinderException
    System.out.println("ejbFindByLastName call...");
    Collection result;
    try {
    result = selectByLastName(lastName);
    } catch (Exception ex) {
    throw new EJBException("ejbFindByLastName " +
    ex.getMessage());
    if (result.isEmpty()) {
    throw new ObjectNotFoundException("No rows found.");
    else {
    return result;
    public Collection ejbFindInRange(double low, double high)
    throws FinderException
    System.out.println("ejbFindRange call ....");
    Collection result;
    try {
    result = selectInRange(low, high);
    } catch (Exception ex) {
    throw new EJBException("ejbFindInRange: " +
    ex.getMessage());
    if (result.isEmpty()) {
    throw new ObjectNotFoundException("No rows found.");
    else {
    return result;
    public void ejbActivate()
    System.out.println("ejbActivate call ...");
    id = (String)context.getPrimaryKey();
    public void ejbLoad()
    System.out.println("ejbLoad call ...");
    try {
    loadRow();
    } catch (Exception ex) {
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
    public void ejbPassivate()
    id = null;
    public void ejbRemove()
    System.out.println("ebjRemove call ...");
    try {
    deleteRow(id);
    } catch (Exception ex) {
    throw new EJBException("ejbRemove: " +
    ex.getMessage());
    public void ejbStore()
    System.out.println("ejbStore call ...");
    try {
    storeRow();
    } catch (Exception ex) {
    throw new EJBException("ejbLoad: " +
    ex.getMessage());
    public void setEntityContext(EntityContext context)
    this.context = context;
    System.out.println("setEntityContext call....");
    try {
    makeConnection();
    System.out.println("Came back from makeConnction call ...");
    } catch (Exception ex) {
    throw new EJBException("Unable to connect to database " +
    ex.getMessage());
    public void unsetEntityContext()
    System.out.println("unsetEntityContext call ...");
    try {
    con.close();
    } catch (SQLException ex) {
    throw new EJBException("unsetEntityContext: " + ex.getMessage());
    /*********************** Database Routines *************************/
    private void makeConnection() throws NamingException, SQLException
    System.out.println("makeConnection call...");
    try
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("java:/MySqlDS");
    con = ds.getConnection();
    catch (Exception ex)
    System.out.println("Something went wrong within makeConnction call .... " + ex);
    private void insertRow (String id, String firstName, String lastName,
    double balance) throws SQLException {
    System.out.println("insertRow call...");
    String insertStatement =
    "insert into account values ( ? , ? , ? , ? )";
    PreparedStatement prepStmt =
    con.prepareStatement(insertStatement);
    prepStmt.setString(1, id);
    prepStmt.setString(2, firstName);
    prepStmt.setString(3, lastName);
    prepStmt.setDouble(4, balance);
    prepStmt.executeUpdate();
    prepStmt.close();
    private void deleteRow(String id) throws SQLException {
    System.out.println("deleteRow call ...");
    String deleteStatement =
    "delete from account where id = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(deleteStatement);
    prepStmt.setString(1, id);
    prepStmt.executeUpdate();
    prepStmt.close();
    private boolean selectByPrimaryKey(String primaryKey)
    throws SQLException {
    System.out.println("selectByPrimaryKey call...");
    String selectStatement =
    "select id " +
    "from account where id = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setString(1, primaryKey);
    ResultSet rs = prepStmt.executeQuery();
    boolean result = rs.next();
    prepStmt.close();
    return result;
    private Collection selectByLastName(String lastName)
    throws SQLException {
    System.out.println("selectByLastName call...");
    String selectStatement =
    "select id " +
    "from account where lastname = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setString(1, lastName);
    ResultSet rs = prepStmt.executeQuery();
    ArrayList a = new ArrayList();
    while (rs.next()) {
    String id = rs.getString(1);
    a.add(id);
    prepStmt.close();
    return a;
    private Collection selectInRange(double low, double high)
    throws SQLException {
    System.out.println("selectInRange call ....");
    String selectStatement =
    "select id from account " +
    "where balance between ? and ?";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setDouble(1, low);
    prepStmt.setDouble(2, high);
    ResultSet rs = prepStmt.executeQuery();
    ArrayList a = new ArrayList();
    while (rs.next()) {
    String id = rs.getString(1);
    a.add(id);
    prepStmt.close();
    return a;
    private void loadRow() throws SQLException {
    System.out.println("loadRow call ....");
    String selectStatement =
    "select firstname, lastname, balance " +
    "from account where id = ? ";
    PreparedStatement prepStmt =
    con.prepareStatement(selectStatement);
    prepStmt.setString(1, this.id);
    ResultSet rs = prepStmt.executeQuery();
    if (rs.next()) {
    this.firstName = rs.getString(1);
    this.lastName = rs.getString(2);
    this.balance = rs.getDouble(3);
    prepStmt.close();
    else {
    prepStmt.close();
    throw new NoSuchEntityException("Row for id " + id +
    " not found in database.");
    private void storeRow() throws SQLException {
    System.out.println("storeRow call ...");
    String updateStatement =
    "update account set firstname = ? ," +
    "lastname = ? , balance = ? " +
    "where id = ?";
    PreparedStatement prepStmt =
    con.prepareStatement(updateStatement);
    prepStmt.setString(1, firstName);
    prepStmt.setString(2, lastName);
    prepStmt.setDouble(3, balance);
    prepStmt.setString(4, id);
    int rowCount = prepStmt.executeUpdate();
    prepStmt.close();
    if (rowCount == 0) {
    throw new EJBException("Storing row for id " + id + " failed.");
    2. ejb-jar.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!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>
    <description>Entity Bean ( BMP )</description>
    <display-name>Account</display-name>
    <ejb-name>Account</ejb-name>
    <home>com.ps.AccountHome</home>
    <remote>com.ps.Account</remote>
    <ejb-class>com.ps.impl.AccountBean</ejb-class>
    <persistence-type>Bean</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    </entity>
    </enterprise-beans>
    </ejb-jar>
    3. web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <servlet>
    <servlet-name>AccountServlet</servlet-name>
    <servlet-class>com.ps.AccountServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>AccountServlet</servlet-name>
    <url-pattern>/accountservlet</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    4. jboss.xml (i am not sure this is righ maybe this is the problem)
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
    <jboss>
    <resource-managers>
    <resource-manager res-class="">
    <res-name>MySqlDS</res-name>
    <res-jndi-name>java:/MySqlDS</res-jndi-name>
    </resource-manager>
    </resource-managers>
    </jboss>
    5. mysql-service.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- ===================================================================== -->
    <!-- -->
    <!-- JBoss Server Configuration -->
    <!-- -->
    <!-- ===================================================================== -->
    <server>
    <!-- ==================================================================== -->
    <!-- New ConnectionManager setup for mysql using 2.0.11 driver -->
    <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
    <!-- ==================================================================== -->
    <mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=MySqlDS">
    <!-- Include a login module configuration named MySqlDbRealm.
    Update your login-conf.xml, here is an example for a
    ConfiguredIdentityLoginModule:
    <application-policy name = "MySqlDbRealm">
    <authentication>
    <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
    <module-option name = "principal">yourprincipal</module-option>
    <module-option name = "userName">yourusername</module-option>
    <module-option name = "password">yourpassword</module-option>
    <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
    </login-module>
    </authentication>
    </application-policy>
    NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
    module-option name = "managedConnectionFactoryName"
    must match the object name of the ConnectionManager you are configuring here.
    -->
    <!--uncomment out this line if you are using the MySqlDbRealm above
    <attribute name="SecurityDomainJndiName">MySqlDbRealm</attribute>
    -->
    <depends optional-attribute-name="ManagedConnectionFactoryName">
    <!--embedded mbean-->
    <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=MySqlDS">
    <attribute name="JndiName">MySqlDS</attribute>
    <attribute name="ManagedConnectionFactoryProperties">
    <properties>
    <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/pac</config-property>
    <config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property>
    <!--set these only if you want only default logins, not through JAAS -->
    <config-property name="UserName" type="java.lang.String">t100</config-property>
    <config-property name="Password" type="java.lang.String">t200</config-property>
    </properties>
    </attribute>
    <!--Below here are advanced properties -->
    <!--hack-->
    <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper</depends>
    </mbean>
    </depends>
    <depends optional-attribute-name="ManagedConnectionPool">
    <!--embedded mbean-->
    <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=MySqlDS">
    <attribute name="MinSize">0</attribute>
    <attribute name="MaxSize">50</attribute>
    <attribute name="BlockingTimeoutMillis">5000</attribute>
    <attribute name="IdleTimeoutMinutes">15</attribute>
    <!--criteria indicates if Subject (from security domain) or app supplied
    parameters (such as from getConnection(user, pw)) are used to distinguish
    connections in the pool. Choices are
    ByContainerAndApplication (use both),
    ByContainer (use Subject),
    ByApplication (use app supplied params only),
    ByNothing (all connections are equivalent, usually if adapter supports
    reauthentication)-->
    <attribute name="Criteria">ByContainer</attribute>
    </mbean>
    </depends>
    <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
    <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager</depends>
    <attribute name="TransactionManager">java:/TransactionManager</attribute>
    <!--make the rar deploy! hack till better deployment-->
    <depends>jboss.jca:service=RARDeployer</depends>
    </mbean>
    </server>

    In /JBoss/server/default/conf/standardjaws.xml.
    Set
    <datasource>java:/mySqlDS</datasource>
    <type-mapping>mySql</type-mapping>
    In /JBoss/server/default/conf/standardjbosscmp-jdbc.xml.
    Set
    <defaults>
    <datasource>java:/mySqlDS</datasource>
    <datasource-mapping>mySql</datasource-mapping></defaults>

  • @IdClass problem in JDeveloper 10.1.3.1

    Hi,
    @IdClass(MyPK.class)
    I used the line above in an entity bean class, and it worked well with JDeveloper 10.1.3.0 and it's embedded OC4J.
    And this is right based on the J2EE API spec.
    Now I downloaded 10.1.3.1 and it gives error during compilation:
    Error(21,10): incompatible types; found: class java.lang.Class<logger.model.entitybeans.MyPK>, required: class java.lang.String
    If I change my annotation to:
    @IdClass("MyPK")
    then JDev compiles my code but the OC4J throws exception during startup:
    java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract java.lang.Class javax.persistence.IdClass.value() (Found data of type class java.lang.String[MyPK])
    Coud you help me what can I do in this situation??
    Many thanks!!
    Kati

    My problem resolved: I made the mistake.
    My project used the Oracle TopLink (Preview) JPA library.
    I changed it to TopLink Essentials JPA and everything works well.
    Kati

  • Problems with Oracle Thin Driver

    Hi,
    I'm having major problems configuring the Oracle Thin Driver for use
    with CMP Entity Beans. What am I doing wrong?
    Configuration: Windows 2000 Professional, WebLogic 6.1, Oracle 8.1.6,
    Oracle Thin Driver 8.1.7 (classes12.zip is the first thing in the
    classpath)
    I first created the connection pool through the console, here's the
    generated xml:
    <JDBCConnectionPool
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    MaxCapacity="2" Name="myXAPool"
    Properties="user=XXX;url=jdbc:oracle:thin:@192.168.0.145:1521:db;password=XXX;dataSourceName=myXAPool"
    Targets="server"/>
    The connection pool deployed fine, so I went ahead and created the TX
    DataSource through the console:
    <JDBCTxDataSource JNDIName="mySource" Name="myXASource"
    PoolName="myXAPool" Targets="server"/>
    The log file shows that the TX DataSource was also created. Next step
    was deploying the application. I created a new application through the
    console and uploaded the ear file containing the application (several
    SessionBeans, EntityBeans and a web application). Upon loading the first
    CMP EntityBean (They have "mySource" set as the name of the DataSource
    in the <data-source-name> tag), the following error showed up in the
    log:
    <04.10.2001 09:02:50 CEST> <Info> <EJB> <EJB Deploying file:
    ContractClassStopover.jar>
    <04.10.2001 09:02:51 CEST> <Error> <J2EE> <Error deploying application
    ContractClassStopover:
    Unable to deploy EJB: ContractClassStopoverBean from
    ContractClassStopover.jar:
    The Entity EJB requires the table: CONTRACT_CLASS_STOPOVER to be
    accessible. Please ensure that this table exists and is accessible.
    >
    <04.10.2001 09:02:51 CEST> <Error> <Management> <Error deploying
    application .\config\server\applications\app.ear:
    java.lang.reflect.UndeclaredThrowableException>
    The table exists, so I had a look at the jdbc log file. Here's what
    happened in there:
    DRVR FUNC OracleConnection.OracleConnection(par, pc, autoCommit=false)
    DRVR FUNC
    OracleConnection.initialize(ur="jdbc:oracle:thin:@192.168.0.145:1521:db",
    us="XXX", access)
    DRVR FUNC OracleConnection.initClientDataSupport()
    DRVR OPER OracleConnection.setAutoCommit(autoCommit=false)
    DRVR OPER OracleConnection.getAutoCommit() returned false
    DRVR DBG1 OracleXAResource.start():start
    DRVR DBG1 Should use OracleXid for 8.1.6 database
    DRVR OPER OracleConnection.getTransactionIsolation() returned 2
    DRVR OPER OracleConnection.isReadOnly()
    DRVR OPER OracleConnection.getCatalog()
    DRVR OPER OracleConnection.getAutoCommit() returned false
    DRVR OPER OracleConnection.close()
    DRVR OPER OracleConnection.close()
    DRVR FUNC OracleConnection.OracleConnection(par, pc, autoCommit=false)
    DRVR FUNC
    OracleConnection.initialize(ur="jdbc:oracle:thin:@192.168.0.145:1521:db",
    us="XXX", access)
    DRVR FUNC OracleConnection.initClientDataSupport()
    DRVR OPER OracleConnection.setAutoCommit(autoCommit=false)
    DRVR OPER OracleConnection.getAutoCommit() returned false
    SQLException: SQLState() vendor code(-6)
    java.sql.SQLException: XA error: XAER_PROTO : Routine was invoked in an
    inproper context start() failed on resource 'myXAPool' null
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1044)
    at
    weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1010)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:148)
    at
    weblogic.jdbc.jta.Connection.prepareStatement(Connection.java:226)
    at
    weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
    at
    weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
    at
    weblogic.ejb20.utils.TableVerifier.checkTableAndColumns(TableVerifier.java:125)
    at
    weblogic.ejb20.utils.TableVerifier.verifyTableAndColumnsExist(TableVerifier.java:226)
    at
    weblogic.ejb20.utils.TableVerifier.verifyTableExistsAndCreateMaybe(TableVerifier.java:294)
    at
    weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl.verifyTablesExist(PersistenceManagerImpl.java:172)
    at
    weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl.setup(PersistenceManagerImpl.java:120)
    at
    weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:197)
    at
    weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:173)
    at weblogic.ejb20.manager.DBManager.setup(DBManager.java:123)
    at
    weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.deploy(ClientDrivenBeanInfoImpl.java:793)
    at
    weblogic.ejb20.deployer.Deployer.deployDescriptor(Deployer.java:1250)
    at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:939)
    at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at
    weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
    at
    weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:606)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:590)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:350)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:482)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:352)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:926)
    at
    weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:913)
    at
    weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:898)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:618)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:590)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:350)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy68.addTarget(Unknown Source)
    at
    weblogic.management.mbeans.custom.ApplicationManager.autoDeploy(ApplicationManager.java:833)
    at
    weblogic.management.mbeans.custom.ApplicationManager.addApplication(ApplicationManager.java:930)
    at
    weblogic.management.mbeans.custom.ApplicationManager.addApplication(ApplicationManager.java:852)
    at
    weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManager.java:768)
    at
    weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManager.java:701)
    at
    weblogic.management.mbeans.custom.ApplicationManager.update(ApplicationManager.java:198)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:606)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:590)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:350)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy5.update(Unknown Source)
    at
    weblogic.management.console.webapp._domain.__upload_app._jspService(__upload_app.java:150)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at
    weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:190)
    at
    weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at
    weblogic.management.console.actions.ForwardAction.perform(ForwardAction.java:35)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:172)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServlet.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Can someone please help me figure out what's going wrong here?
    Thanks in advance,
    Nils
    ============================
    [email protected]

    Thanks for the reply!! I was expecting something like this. I will look
    into an upgrade to 8.1.7.
    Take care,
    Nils
    Priscilla Fung wrote:
    >
    Hi,
    You need to use an Oracle 8.1.7 server for XA features. Refer to Third Party
    JDBC XA drivers doc for more info: http://e-docs.bea.com/wls/docs61/jta/thirdpartytx.html#1070650
    Regards,
    Priscilla
    Nils Winkler <[email protected]> wrote:
    Hi,
    I'm having major problems configuring the Oracle Thin Driver for use
    with CMP Entity Beans. What am I doing wrong?
    Configuration: Windows 2000 Professional, WebLogic 6.1, Oracle 8.1.6,
    Oracle Thin Driver 8.1.7 (classes12.zip is the first thing in the
    classpath)
    I first created the connection pool through the console, here's the
    generated xml:
    <JDBCConnectionPool
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    MaxCapacity="2" Name="myXAPool"
    Properties="user=XXX;url=jdbc:oracle:thin:@192.168.0.145:1521:db;password=XXX;dataSourceName=myXAPool"
    Targets="server"/>
    The connection pool deployed fine, so I went ahead and created the TX
    DataSource through the console:
    <JDBCTxDataSource JNDIName="mySource" Name="myXASource"
    PoolName="myXAPool" Targets="server"/>
    The log file shows that the TX DataSource was also created. Next step
    was deploying the application. I created a new application through the
    console and uploaded the ear file containing the application (several
    SessionBeans, EntityBeans and a web application). Upon loading the first
    CMP EntityBean (They have "mySource" set as the name of the DataSource
    in the <data-source-name> tag), the following error showed up in the
    log:
    <04.10.2001 09:02:50 CEST> <Info> <EJB> <EJB Deploying file:
    ContractClassStopover.jar>
    <04.10.2001 09:02:51 CEST> <Error> <J2EE> <Error deploying application
    ContractClassStopover:
    Unable to deploy EJB: ContractClassStopoverBean from
    ContractClassStopover.jar:
    The Entity EJB requires the table: CONTRACT_CLASS_STOPOVER to be
    accessible. Please ensure that this table exists and is accessible.
    >
    <04.10.2001 09:02:51 CEST> <Error> <Management> <Error deploying
    application .\config\server\applications\app.ear:
    java.lang.reflect.UndeclaredThrowableException>
    The table exists, so I had a look at the jdbc log file. Here's what
    happened in there:
    DRVR FUNC OracleConnection.OracleConnection(par, pc, autoCommit=false)
    DRVR FUNC
    OracleConnection.initialize(ur="jdbc:oracle:thin:@192.168.0.145:1521:db",
    us="XXX", access)
    DRVR FUNC OracleConnection.initClientDataSupport()
    DRVR OPER OracleConnection.setAutoCommit(autoCommit=false)
    DRVR OPER OracleConnection.getAutoCommit() returned false
    DRVR DBG1 OracleXAResource.start():start
    DRVR DBG1 Should use OracleXid for 8.1.6 database
    DRVR OPER OracleConnection.getTransactionIsolation() returned 2
    DRVR OPER OracleConnection.isReadOnly()
    DRVR OPER OracleConnection.getCatalog()
    DRVR OPER OracleConnection.getAutoCommit() returned false
    DRVR OPER OracleConnection.close()
    DRVR OPER OracleConnection.close()
    DRVR FUNC OracleConnection.OracleConnection(par, pc, autoCommit=false)
    DRVR FUNC
    OracleConnection.initialize(ur="jdbc:oracle:thin:@192.168.0.145:1521:db",
    us="XXX", access)
    DRVR FUNC OracleConnection.initClientDataSupport()
    DRVR OPER OracleConnection.setAutoCommit(autoCommit=false)
    DRVR OPER OracleConnection.getAutoCommit() returned false
    SQLException: SQLState() vendor code(-6)
    java.sql.SQLException: XA error: XAER_PROTO : Routine was invoked in
    an
    inproper context start() failed on resource 'myXAPool' null
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1044)
    at
    weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1010)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:148)
    at
    weblogic.jdbc.jta.Connection.prepareStatement(Connection.java:226)
    at
    weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
    at
    weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
    at
    weblogic.ejb20.utils.TableVerifier.checkTableAndColumns(TableVerifier.java:125)
    at
    weblogic.ejb20.utils.TableVerifier.verifyTableAndColumnsExist(TableVerifier.java:226)
    at
    weblogic.ejb20.utils.TableVerifier.verifyTableExistsAndCreateMaybe(TableVerifier.java:294)
    at
    weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl.verifyTablesExist(PersistenceManagerImpl.java:172)
    at
    weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl.setup(PersistenceManagerImpl.java:120)
    at
    weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:197)
    at
    weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:173)
    at weblogic.ejb20.manager.DBManager.setup(DBManager.java:123)
    at
    weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.deploy(ClientDrivenBeanInfoImpl.java:793)
    at
    weblogic.ejb20.deployer.Deployer.deployDescriptor(Deployer.java:1250)
    at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:939)
    at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
    at weblogic.j2ee.Application.addComponent(Application.java:160)
    at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
    at
    weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
    at
    weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:606)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:590)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:350)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:482)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:352)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:926)
    at
    weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:913)
    at
    weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:898)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:618)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:590)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:350)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy68.addTarget(Unknown Source)
    at
    weblogic.management.mbeans.custom.ApplicationManager.autoDeploy(ApplicationManager.java:833)
    at
    weblogic.management.mbeans.custom.ApplicationManager.addApplication(ApplicationManager.java:930)
    at
    weblogic.management.mbeans.custom.ApplicationManager.addApplication(ApplicationManager.java:852)
    at
    weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManager.java:768)
    at
    weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManager.java:701)
    at
    weblogic.management.mbeans.custom.ApplicationManager.update(ApplicationManager.java:198)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:606)
    at
    weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:590)
    at
    weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:350)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at
    com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:444)
    at
    weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
    at $Proxy5.update(Unknown Source)
    at
    weblogic.management.console.webapp._domain.__upload_app._jspService(__upload_app.java:150)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at
    weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:190)
    at
    weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at
    weblogic.management.console.actions.ForwardAction.perform(ForwardAction.java:35)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:172)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServlet.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Can someone please help me figure out what's going wrong here?
    Thanks in advance,
    Nils
    ============================
    [email protected]
    ============================
    [email protected]

  • EJBException thrown when using EntityBean

    I am currently developing on the BEA Weblogic server 8.1 on Win2k SP4. The application
    is currently up and running under Weblogic. I've added a new EntityBean (along
    with the necessarn DB tables, classes, and descriptor file updates). Everything
    compiles and the jar file builds. However, when I run the application and attempt
    to access the new bean I get the following runtime exception:
    javax.ejb.EJBException: Attempt to pass a reference to an EJBLocalObject to a
    remote client. A local EJB component may only be accessed by clients co-located
    in the same ear or standalone jar file..
    javax.ejb.EJBException: Attempt to pass a reference to an EJBLocalObject to a
    remote client. A local EJB component may only be accessed by clients co-located
    in the same ear or standalone jar file.
         at com.jsims.ws.ejbgame.ejb.Metadata_na2102_ELOImpl.writeObject(Ljava.io.ObjectOutputStream;)V(Metadata_na2102_ELOImpl.java:355)
         at COM.jrockit.reflect.NativeMethodInvoker.invoke0(ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Native
    Method)
    where Metadata is the new bean added to the system. Could someone give me a clue
    as to how I would start to debug this problem? I've gone over every file and I
    can't see any issues.
    Thanks in advance.

    Right, but you're returning a Collection of EJBLocalObjects. That's the
    problem.
    -- Rob
    Bill Beebe wrote:
    Rob Woollen <[email protected]> wrote:
    It looks like your GameFacade EJB has a remote call trying to return
    the
    Local Metadata EJBI wish that were true, but it's just returning a Collection. I've attached another
    file that includes code snippets of the various classes (from the client to the
    EJBs) stripped down to their bare essentials as well as the section in the ejb-jar.xml
    file where the ejb is defined.
    Here is the home interface class:
    package com.jsims.ws.ejbgame.ejb;
    import java.util.Collection;
    import javax.ejb.EJBLocalHome;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    public interface MetadataHome extends EJBLocalHome
    public static final String
    JNDI_NAME = "cirrus/ejb/Metadata";
    public MetadataLocal create(
    String toeId,
    String entityName,
    Integer count,
    String entityType,
    Integer parent,
    String symbolCode)
    throws
    CreateException;
    public MetadataLocal findByPrimaryKey(MetadataKey primeKey)
    throws FinderException;
    public Collection findAllUnits()
    throws FinderException;
    public Collection findUnitEgs(String toeId)
    throws FinderException;
    public Collection findAllByDomain(String domain)
    throws FinderException;
    Here is the EJBLocalObject definition:
    package com.jsims.ws.ejbgame.ejb;
    import javax.ejb.EJBLocalObject;
    * The local interface for the Metadata bean.
    public interface MetadataLocal extends EJBLocalObject
    public String getToeId();
    public String getEntityName();
    public Integer getCount();
    public String getEntityType();
    public Integer getParent();
    public String getSymbolCode();
    Here are the methods defined in GameFacade (and Bean):
    public interface GameFacade extends EJBObject
    public Collection getUnitsByDomain(String domain)
    throws RemoteException;
    Here is the implementation in the bean:
    public class GameFacadeBean
    extends NullEventListener
    implements SessionBean
    public Collection getUnitsByDomain(String domainName)
    Collection
    domainUnits = Collections.EMPTY_LIST;
    try
    domainUnits = metadataHome.findAllByDomain(domainName);
    catch(FinderException ex)
    ex.printStackTrace();
    domainUnits = Collections.EMPTY_LIST;
    return domainUnits;
    and here is where it is being used on the client:
    public TemplateView(int en, Framework fw)
    framework = fw;
    // Get the GameFacade and perform the query.
    Collection
    templates =
    framework.getGame().getUnitsByDomain(domainName);
    Here is the definition in the ejb-jar.xml entry:
    <entity>
    <display-name>Metadata</display-name>
    <ejb-name>Metadata</ejb-name>
    <local-home>com.jsims.ws.ejbgame.ejb.MetadataHome</local-home>
    <local>com.jsims.ws.ejbgame.ejb.MetadataLocal</local>
    <ejb-class>com.jsims.ws.ejbgame.ejb.MetadataBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>com.jsims.ws.ejbgame.ejb.MetadataKey</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>Metadata</abstract-schema-name>
    <cmp-field>
    <field-name>toeId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>entityName</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>count</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>entityType</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>parent</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>symbolCode</field-name>
    </cmp-field>
    <query>
    <query-method>
    <method-name>findAllUnits</method-name>
    <method-params/>
    </query-method>
    <ejb-ql>SELECT OBJECT(f) FROM Metadata AS f WHERE f.count = 0 OrderBy f.toeId</ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findUnitEgs</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql>SELECT OBJECT(f) FROM Metadata AS f WHERE f.toeId = ?1 AND f.count > 0 OrderBy f.count</ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findAllByDomain</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql>SELECT OBJECT(f) FROM Metadata AS f, TOE as t, ToeTemplateMappings as t2 WHERE f.toeId = t2.toeId AND t2.templateId = t.templateId AND t.domain=?1 and f.count = 0 OrderBy f.toeId</ejb-ql>
    </query>
    <!--query>
    <query-method>
    <method-name>findAllUnitKeys</method-name>
    <method-params/>
    </query-method>
    <ejb-ql>SELECT f.toeId FROM Metadata AS f WHERE f.count = 0 OrderBy f.toeId</ejb-ql>
    </query-->
    </entity>

  • Ejb-ref and JNDI lookup problem

    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files. I tried to
    use session bean to refer entity bean, I failed. The details are as following:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
         <ejb-reference-description>
              <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
              <jndi-name>ejb/CabinHome</jndi-name>
         </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome'
         <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']
         at com.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBean_a4c3ph_EOImpl.java:37)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer> <ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changes for domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

    Slava,
    I took "cabin." out from weblogic-ejb-jar.xml, I got the same error.
    DJ
    "Slava Imeshev" <[email protected]> wrote:
    Hi DJ,
    I think you don't need "cabin." in weblogic-ejb-jar.xml :
    <jndi-name>cabin.CabinHome</jndi-name>
    Regards,
    Slava Imeshev
    "DJ" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files.I
    tried to
    use session bean to refer entity bean, I failed. The details are asfollowing:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <jndi-name>ejb/CabinHome</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remainingname
    'CabinHome'
    <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']
    atcom.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBe
    an_a4c3ph_EOImpl.java:37)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    atweblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :93)
    atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
    2)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer><ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changesfor
    domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

  • Problems deploying application.

    Hi,
    we are trying to migrate a JAVA application from Oracle ias 9i (9.0.3) to 10G (10.1.3), and we have a problem with the EJBs when we make the deploy.
    We have two EJBs into two JAR files, into an EAR file.
    One of them is a SessionBean, and the other one is an EntityBean.
    We deploy, using the Oracle Enterprise Manager, the ear file. We let that the EM make the Deployment plan, and it seems to work.
    But when we go to the JNDI Explorer, into the OC4J instance where we have deployed the ear, we don't see any entry, and the combo-box to select an application is empty.
    And we have found this error at the log, when we access at JNDI Explorer:
    08/04/02 18:30:46 java.lang.UnsupportedOperationException: This part of the API is not supported
    08/04/02 18:30:46 at oracle.oc4j.admin.jmx.distributed.SimpleInstanceMBeanServerDelegate.queryMBeans(SimpleInstanceMBeanServerDelegate.java:522)
    08/04/02 18:30:46 at oracle.oc4j.admin.jmx.server.state.LocalizationFilterMBeanServer.queryMBeans(LocalizationFilterMBeanServer.java:420)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.jmx.spi.JMXConnectorImpl.queryMBeans(JMXConnectorImpl.java:346)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.j2ee.userdefined.jndi.JndiHGridOC4JModel.getJndiTree(JndiHGridOC4JModel.java:164)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.j2ee.userdefined.jndi.JndiHGridOC4JModel.getJndiTree(JndiHGridOC4JModel.java:134)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.j2ee.userdefined.jndi.JndiGridHelper.createHGrid(JndiGridHelper.java:421)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.j2ee.userdefined.jndi.JndiGridHelper.prepareData(JndiGridHelper.java:357)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.sdk.AbstractController.prepareData(AbstractController.java:875)
    08/04/02 18:30:46 at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:391)
    08/04/02 18:30:46 at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:765)
    08/04/02 18:30:46 at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:283)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.app.StudioConsole.doGet(StudioConsole.java:297)
    08/04/02 18:30:46 at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    08/04/02 18:30:46 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    08/04/02 18:30:46 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.app.BrowserVersionFilter.doFilter(BrowserVersionFilter.java:75)
    08/04/02 18:30:46 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.app.MultipleJVMFilter.doFilter(MultipleJVMFilter.java:85)
    08/04/02 18:30:46 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.app.PostLogonFilter.doFilter(PostLogonFilter.java:80)
    08/04/02 18:30:46 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
    08/04/02 18:30:46 at oracle.sysman.ias.studio.app.ShortHostnameRedirectFilter.doFilter(ShortHostnameRedirectFilter.java:68)
    08/04/02 18:30:46 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619)
    08/04/02 18:30:46 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
    08/04/02 18:30:46 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
    08/04/02 18:30:46 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
    08/04/02 18:30:46 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302)
    08/04/02 18:30:46 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190)
    08/04/02 18:30:46 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    08/04/02 18:30:46 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    08/04/02 18:30:46 at java.lang.Thread.run(Thread.java:595)
    Any idea about which may be the problem?...

    PRODUCT VERSION: OC4J_STANDALONE: 10133
    I also am having a problem with simple MBEAN deployment as well. some attributes with default values defined in orion-application.xml deploy fine, one however does not. The error I see in ASControl is attribute "unavailable".
    Would appreciate some guidance here.
    I see the following errors in the log:
    2008-04-09 06:56:11,515 [EMUI_06_56_11_/console/ias/j2ee/userdefined/admin/j2eeBrowserRight] WARN oc4j.OC4JManagementAdminBeanJMXImpl getCurrentJVMs.253 - java.lang.IllegalArgumentException: J2EE Server not found from SimpleInstanceMBeanServerDelegate
    2008-04-09 06:56:11,515 [EMUI_06_56_11_/console/ias/j2ee/userdefined/admin/j2eeBrowserRight] WARN oc4j.OC4JManagementAdminBeanJMXImpl getCurrentJVMs.253 - java.lang.IllegalArgumentException: J2EE Server not found from SimpleInstanceMBeanServerDelegate
    Here are the relevant files:
    ===== orion-application.xml ================
    <jmx-mbean objectname=":type=Application,name=MessageHandler" class="com.eds.gtm.ccg.management.MessageHandler">
    <description>GTMDEMOBEANS</description>
    <attribute name="TestSize">
    <value>100</value>
    </attribute>
    <attribute name="Interval">
    <value>100</value>
    </attribute>
    <attribute name="WindowSize">
    <value>7</value>
    </attribute>
    </jmx-mbean>
    ============== MBEAN source files ===================
    package com.eds.gtm.ccg.management;
    public interface MessageHandlerMBean {
    public void setTestSize(String testSize) ;
    public String getTestSize();
    public void setInterval(String interval);
    public String getInterval();
    public void setWindowSize(String windowSize);
    public String getWindowSize();
    public void setEdsCacheConfig(String edsCacheConfig);
    public String getEdsCacheConfig();
    ==================== class ============================
    package com.eds.gtm.ccg.management;
    public class MessageHandler implements MessageHandlerMBean {
    private String testSize;
    private String interval;
    private String windowSize;
    private String edsCacheConfig;
    public MessageHandler() {
    public void setTestSize(String testSize) {
    this.testSize = testSize;
    public String getTestSize() {
    return testSize;
    public void setInterval(String interval) {
    this.interval = interval;
    public String getInterval() {
    return interval;
    public void setWindowSize(String windowSize) {
    this.windowSize = windowSize;
    public String getWindowSize() {
    return windowSize;
    public void setEdsCacheConfig(String edsCacheConfig) {
    this.edsCacheConfig = edsCacheConfig;
    public String getEdsCacheConfig() {
    return this.edsCacheConfig;
    Message was edited by:
    user54633

  • Problem with return cardinality of my Entity-Bean

    Hi all,
    i'm using Sun Java Studio Enterprise 8.1 and i try to create a EJB CMP Entity-Bean, it's name is Customer. But i become an error during the deploy. By the method findByName(String name) i selected as return cardinality "Many" and become below error. If i select "One" as return cardinality then is this error away.
    What is here wrong? Every time when i create an EntityBean i become this error, but just by "Many" return cardinality. Can anyone help me to solve this problem?
    thanks
    Bean : CustomerBean
    Method : public abstract Collection findByName(String) throws FinderException
    Section: 10.5.6
    Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.
    01:06:32,031 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.3SP1/server/default/tmp/deploy/tmp26541bank.ear-co
    ntents/Bank-ejb.jar
    org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
    at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:575)
    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:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
    at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy24.create(Unknown Source)
    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
    at org.jboss.deployment.MainDeployer.create(MainDeployer.java:925)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
    at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
    at $Proxy9.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:489)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
    01:07:17,406 INFO [EJBDeployer] Undeploying: file:/C:/jboss-4.0.3SP1/server/default/tmp/deploy/tmp26541bank.ear-contents/Bank-ejb.j
    ar

    As you have noted, for 'One' cardinality findByPrimaryKey is sufficient since a primary key is used to locate unique records. But for 'many' cardinality, the system needs to know how to locate a collection of records and hence the need for findAll in the specification.
    Regarding EJB 3.0, i suggest that you use NetBeans.
    Note: Java Studio Enterprise 8.1 is itself built on top of NetBeans version 5.0. NetBeans is an ide developed as opensource at www.netbeans.org; it is extensible ide and so add-on modules can be developed to run on top of netbeans. And that is what JSE8.1 does; JSE 8.1 is NetBeans 5.0 plus several add-on modules (like UML etc).
    The latest stable version of NetBeans is 5.5.1 and NetBeans 6.0 is currently under development with milestone 10 being the latest release.
    Home page: www.netbeans.org
    Download: http://www.netbeans.info/downloads/index.php (From the main page, you can also download several packs which are addons that provide various functionality).
    Docs: http://www.netbeans.org/kb/index.html
    Docs on EE apps: http://www.netbeans.org/kb/trails/java-ee.html
    Further community resources (mailing lists, issue tracking etc) : http://www.netbeans.org/community/index.html
    wiki.netbeans.org
    NetBeans download is free. And since it is developed as an opensource project, the source is freely available under CDDL license (http://www.netbeans.org/about/legal/license.html)

Maybe you are looking for

  • Question about dual-monitor setup - advanced dock + PCIe card

    I just got a Z60t at work. I had been using a dual monitor setup, but it doesn't look like my current config is going to fly w/ the new machine. Anyway, here's what I've got: Primary monitor: Acer AL2416W (1920x1200 DVI) Secondary monitor: Dell 1901F

  • Mail doesn't display full email text, only displays the subject line

    Mail doesn't display full email text, only displays the subject line. My preview shows first three lines of email, but when I chose the email specifically mail doesn't display any lines of text.  Been this way for about ten days.  Please help.  Ben

  • Can't connect to iPhoto Print

    When I try to order prints through iphoto I get the 'connection' status bar but no connection takes place, so I end up stopping the process. At other times, I get an error message telling me that my DSL connection was terminated, however this is not

  • I create trigger but not display massage after insert in oracle 10g

    I create trigger but not display massage after insert in oracle 10g **CREATE OR REPLACE TRIGGER TableName** **AFTER INSERT OR DELETE OR UPDATE ON test** **BEGIN** **if inserting then** **dbms_output.put('Message');** **end if;** **END;**

  • Suggested user rights for FCP daily work

    friends, I am wondering what is the suggested user rights for a user doing daily work with final cut pro? Should this user be an admin or restricted? What is the suggested - best practice? I am wondering what the benefits - drawbacks are of iether me