Throwing EJBException causing mulitple retries

hi all,
I have a strange problem with a entity beans that fail in a ejbStore.
I have a session bean calling a BMP entity bean. On failure ( inserted value too large for column) the ejbStore throws a EJBException.
public void ejbStore()
throws RemoteException
_logger.received( "ejbStore" );
try
ClientDAO dao = ClientDAOFactory.getDAO();
dao.update( getRow(), getId() );
_logger.debug( "ejbStore", getRow() );   
catch( ClientDAOSysException e)
_logger.error( "ejbStore", e );
throw new EJBException( e.getMessage() );
catch( ApplicationException e)
_logger.error( "ejbStore", e );
throw new EJBException( e.getMessage() );
_logger.returned( "ejbStore", "complete" );
What follows is very weird. From the logs it seems that a sessionBean.store() method is called another three times before finally an exception is thrown all the way back to the client.
com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Error preparing bean instance: com.evermind.transaction.MarshallingXAException; nested exception is:
com.evermind.transaction.MarshallingXAException
My code only calls the sessionBean.store() once.
Why are 3 further attempts made? From my understanding the SessionBean should be managing the transaction and should be able either rollback or something else. This is not the case.
any help is appreciated
-lp

Lucio,
This question has been previously discussed on this forum.
I don't remember all the details (and I'm too lazy to search
the forum archives for you), but in a post from Jeffrey Schaefer
(I'm not sure I'm spelling his name right), it states that
there is a "max-tx-retries" attribute in the "orion-ejb-jar.xml"
file whose default value is "3" -- and that's why your "ejbStore()"
method is getting called three times (if I remember correctly).
Please check the above information, as I am only going from
memory.
Good Luck,
Avi.

Similar Messages

  • InvalidClassException in throwing EJBException from WebLogic 6.1 to WebLogic 7.0

    We are running two versions of WL and need to run the GUI part of App
    on 7.0 and the business part on 6.1.
    We get an exception on 6.1 but in handling the exception on 7.0 we get
    the following error:
    java.io.InvalidClassException: javax.ejb.EJBException; Local class not
    compatibl
    e: stream classdesc serialVersionUID=-9219910240172116449 local class
    serialVers
    ionUID=796770993296843510
    Sure enough the EJBException class on the different servers have
    different serial version numbers. Of course, the root cause is
    something else but we need to be able to handle exceptions throw from
    one to another.
    Any ideas on the best way to handle this?

    That's understandable. I believe EJBException is the only class you'll
    need to change, but it's worth testing.
    If you're uncomfortable adding the class to the front of the classpath,
    you'll have to open a case with [email protected] to get an official patch.
    -- Rob
    Jim Cross wrote:
    I believe that would probably solve the problem but I don't feel
    particularly comfortable with replacing WebLogic classes.
    How many other classes would we need to do this with?
    FinderException?CreateException? What else?
    Rob Woollen <[email protected]> wrote in message news:<[email protected]>...
    I believe the problem is that 6.1 was released before J2EE 1.3 was final
    and the EJBException serialversionuid changed. The easiest fix is to
    take the EJBException class from 7.0 and put it in front of the 6.1
    classpath.
    -- Rob
    Jim Cross wrote:
    We are running two versions of WL and need to run the GUI part of App
    on 7.0 and the business part on 6.1.
    We get an exception on 6.1 but in handling the exception on 7.0 we get
    the following error:
    java.io.InvalidClassException: javax.ejb.EJBException; Local class not
    compatibl
    e: stream classdesc serialVersionUID=-9219910240172116449 local class
    serialVers
    ionUID=796770993296843510
    Sure enough the EJBException class on the different servers have
    different serial version numbers. Of course, the root cause is
    something else but we need to be able to handle exceptions throw from
    one to another.
    Any ideas on the best way to handle this?

  • Generic throws clause causes unreported exception

    I'm trying to pass a block to a ctor, which can throw an exception. The problem can be reproduced with this sample program.
    interface Bar<X extends Exception> {
        void run() throws X;
    public class Foo {
        public Foo() {}
        public <X extends Exception> Foo(Bar<X> bar) throws X {
            bar.run();
        public static <X extends Exception> Foo createFoo(Bar<X> bar) throws X {
            return createFoo2(bar); // ok
        public static <X extends Exception> Foo createFoo2(Bar<X> bar) throws X {
            Foo foo = new Foo();
            bar.run(); // ok
            return foo;
        public static <X extends Exception> Foo createFoo3(Bar<X> bar) throws X {
            return new Foo(bar);  // unreported exception X; must be caught or declared to be thrown
    }createFoo and createFoo2 work fine, but createFoo3 fails to compile with javac. None of the examples raise a warning in IDEA. I'm running javac 1.5.0_07.
    Is there a way to do this in Java 1.5, or is this a bug with javac?

    BrianEgge wrote:
    However, we know types inference works differently for methods vs constructors (15.12.2.8). This is why List<String> s = Collections.emptyList(); works, but List<String> s = new ArrayList<String>() generates an unchecked warning. Well, this is definitely not true.
    According the the JLS, the throws clause shouldn't be handled differently.
    8.8.5 Constructor Throws
    The throws clause for a constructor is identical in structure and behavior to the throws clause for a method (�8.4.6).The JLS explicitely allows a constructor to be defined generic, and those parameters have a scope on the constructor definition including the parameter list (8.8.4 Generic Constructors).
    Hence, I assume, this is a bug.

  • EJBException in ejbStore() doesn't reach client

    Oracle 8.1.7
    Entity Bean (Bean managed persistence)
    Transaction Attrib : Required
    I am trying to get any SQLException thrown in ejbStore() to be thrown to the client wrapped in an EJBException and somehow this doesnt happen. My ejbStore() method tries to execute an update statement, but if the update fails for some reason then I need the exception thrown back to the client.
    Sample piece of code:
    public void ejbStore() throws EJBException {
    try {
    conn = getConnection();
    PreparedStatement stmt = conn.prepareStatement("...");
    stmt.setString(1, ...);
    int a = stmt.executeUpdate();
    } catch (SQLException e) {
    throw new EJBException(e.getMessage());
    Is there something wrong with this approach or a am I missing something ???
    Thanks in advance for any help.
    Ashish.

    I have tried and tried and failed to make sense of this.
    Can anyone give me the slightest of hints?
    TIA.
    Ashish.

  • Exporting methods that throw exceptions?

    Using 10g Preview, I have encountered the following situation:
    I've written a custom method in my ViewRowImpl class that I intend to export as a client row method. It's a public void method that takes a single String parameter.
    Originally, I declared that the method throws Exception. With the throws clause present, the View Object wizard does not display the method in the list of available methods to export to the client. Removing the throws clause causes the method to appear in the list.
    There's nothing in the documentation that I can find to explain this apparent restriction. The closest thing I can find has to do with all types in the signature being Serializable. Nothing is mentioned about exceptions.
    Can somebody explain why methods that declare thrown exceptions can't be exported to the client? Or does the type of exception declared need to be narrower, such as a JboException?

    I wondered the same thing. Take a look at this thread:
    Why can't I throw exception from the Impl?

  • Remoteexception and  ejbexception

    I have a stateless session bean method:
    try{
    catch(){
    throw new EJBException()...// here
    I read some article says: either throw EJBException for local or throw RemoteException for remote.
    but my EJB suppose to be used by both local or remote client, how can I throw both EJBException or RemoteException?
    Thanks

    Your EJB should not directly throw RemoteException. First, you need to decide whether the
    condition you encounter is an application exception or a system exception. An application
    exception is a condition from which the client might be able to recover and is considered non-fatal
    by the container. When an application exception is thrown, the client will receive that exact
    exception. An application is a user-defined exception or any other existing exception that is a
    sublcass of java.lang.Exception (except java.rmi.RemoteException)
    With a system exception, the container destroys the bean instance that threw the exception
    and automatically rolls back the current transaction. The way to signify a system exception is by
    throwing EJBException or any runtime exception.
    The container will convert that exception to the appropriate client-side
    exception. In the case of a Local EJB client, the client will receive EJBException. If the client is
    an EJB 2.x Remote client, it will receive RemoteException. If the client is a 3.0 Remote client, it
    will receive EJBException.

  • RemoteException deprecation and EJBException

    Is throwing a RemoteException from remote interfaces a deprecated
    programming practice?
    I've read some articles and newsgroups which stated that.
    If true, since when exactly is this deprecated?
    Remote interfaces implement java.rmi.Remote so they must throw a
    RemoteException, don't they?
    Should I throw EJBException instead of RemoteException?
    Any remarks, explanations would be greatly helpful.

    Exactly.
    The container implementation of your remote interface will throw a
    RemoteException or javax.transaction.TransactionRolledBackException
    (which is an instance of RemoteException) if you throw an EJBException
    from your Bean implementation.
    If instead you use a Local interface, then you should either get the
    EJBException or javax.ejb.TransactionRolledBackLocalException (which is
    an instance of EJBException).
    It's a bit complicated and I might have been unclear myself for which I
    apologize.
    HTH,
    Dejan
    Yonatan Taub wrote:
    I don't quite follow.
    Do you mean that my remote interface class should declare that it throws a
    RemoteException while my bean implementation class
    should not state in its throws clause a RemoteException?
    "Deyan D. Bektchiev" <[email protected]> wrote in message
    news:[email protected]...
    EJB 1.1 Spec deprecates throwing RemoteExceptions from the Bean
    implementations.
    EJBs can still throw it and the container should behave in the same was
    as if an EJBException was thrown.
    The difference is when all this happens if your EJB has a Remote and
    Local interfaces. The local clients (those using the local interface)
    should get the EJB exception that might be wrapped in a
    TransactionRolledBackException to indicate that the current transaction
    was rolled back, while the remote clients should get the EJB exception
    (or any RuntimeException thrown from your EJB implementation) wrapped in
    a RemoteException.
    HTH,
    Dejan
    Yonatan Taub wrote:
    All of this is known to me.
    Since then I read some more material on the subject.
    It seems that throwing a RemoteException from a bean implementation
    class
    is deprecated.
    RemoteException indicates a system exception and the bean implementation
    class should throw an EJBException.
    The container specific implementation would catch this exception and
    throw a
    RemoteException.
    http://groups.google.com/groups?q=ejb+RemoteException+deprecated+ejbexcepti
    on&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=8i5b64%24bk8%241%40newsgroups.bea.com&rn
    um=4
    I would appreciate your thoughts on the subject.

  • BulkCopy cause double entry in Database

    Hi, I was trying to use bulkcopy to insert data to oracle database, the server is 11g, but when I try to run my unit test of insert duplicate date, horrible thing happened, the pk violation did not throw, and cause the double entry in database, the index is set to unused status as well. According to oracle documents, it seems this is the expected result, if it is so, I really doubted the ability of this database provider and the practical ability of bulkcopy, anyway does anyone encountered this issue and solved it? any advice would be greatly appreciated
    regards,
    xc

    You must have used a second INSERT in place of an UPDATE somewhere.
    And vague queries will only fetch wild guesses.
    xH4x0r

  • HELP - EJBException in ejbStore() doesnt propogate to client

    Oracle 8.1.7
    Entity Bean (Bean managed persistence)
    Transaction Attrib : Required
    I am trying to get any SQLException thrown in ejbStore() to be thrown to the client wrapped in an EJBException and somehow this doesnt happen. My ejbStore() method tries to execute an update statement, but if the update fails for some reason then I need the exception thrown back to the client.
    Sample piece of code:
    public void ejbStore() throws EJBException {
    try {
    conn = getConnection();
    PreparedStatement stmt = conn.prepareStatement("...");
    stmt.setString(1, ...);
    int a = stmt.executeUpdate();
    } catch (SQLException e) {
    throw new EJBException(e.getMessage());
    Is there something wrong with this approach or a am I missing something ???
    Thanks in advance for any help.
    Ashish.
    null

    I have tried and tried and failed to make sense of this.
    Can anyone give me the slightest of hints?
    TIA.
    Ashish.

  • Cannot deploy EntityBean from Weblogic 5.1

    Hi everyone,
    I'm relatively new to EJB deployment, but there is an Entity bean that I was able to deploy using Weblogic 4.0 and fail to do the same with Weblogic 5.1, although I'm going through all the necessary steps, like creating xmls (ejb_jar, weblogic-cmp-rdbms-jar, and weblogic-ejb-jar), creating a jar file, and recompiling it using weblogic.ejbc, and that's where it stops. While it works fine with session beans, every time I'm trying to deploy entity bean, it gives me the following message:
    ERROR: Error from ejbc: [9.1.5.1] In EJB EmployerEntityEJB, there is an ejbPostCreate method ejbPostCreate() that has no matching ejbCreate method.
    Yet my ejbCreate and ejbPostCreate methods do match, unless I'm missing something, but at this point I have no idea what exactly. Any kind of help would be great, 'cause I'm almost out of ideas.
    Here's the code I'm working on:
    EmployerEntity.java:
    import java.rmi.*;
    import java.sql.*;
    import javax.ejb.*;
    import java.util.*;
    public interface EmployerEntity extends EJBObject, Remote {
    public boolean postingUpdate(Hashtable posting) throws RemoteException,SQLException;
    public void callingBreakHashtable(Hashtable posting) throws RemoteException;
    EmployerEntityHome.java:
    import java.rmi.*;
    import javax.ejb.*;
    import java.io.*;
    import java.util.*;
    import javax.naming.*;
    public interface EmployerEntityHome extends EJBHome{
    public EmployerEntity create(Hashtable posting) throws RemoteException, EJBException, CreateException;
    public EmployerEntity findByPrimaryKey(EmployerEntityPK job_id) throws FinderException,RemoteException;
    public EmployerEntity findByPosition(int job_id) throws FinderException,RemoteException;
    EmployerEntityPK.java:
    import java.io.Serializable;
    public class EmployerEntityPK {
    public int job_id;
    and finally EmployerEntityBean.java (I left only ejbCreat and ejbPostCreate methods, so that I won't confuse anybody):
    import java.io.*;
    import java.util.*;
    import javax.ejb.*;
    import javax.naming.*;
    import java.rmi.*;
    import java.sql.*;
    //and local classes
    public class EmployerEntityBean extends LocalClassEntityBean {
    Hashtable posting=new Hashtable();
    public EmployerEntityBean() {}
    public EmployerEntityPK ejbCreate(Hashtable posting) throws EJBException, CreateException {
    if (posting_entity_flag)
    this.posting=posting;
    callingBreakHashtable(posting);
    Syslog.debug(this,"EJBCreate Called ");
    return null;
    public void ejbPostCreate(Hashtable posting) throws EJBException {
    Syslog.debug(this,"EJBPostCreate Called ");
    Thanks for your help.
    PS. Also, could it be that the error that I'm getting might be caused by something other than simply mismatching ejbCreate and ejbPostCreate? If so, what are the other possible reasons?
    Thanks

    Hi,
    First of all, you don't need to add EJBException in your method definition as its a runtime exception. Next your ejbPostCreate() is missing the CreateException and thats the reason you have a mismatch.
    Also your remote interface should extend EJBObject ( which is a subclass of java.rmi.Remote). Catch the SQLException and rethrow it as an EJBException with proper message. And finally I take it that LocalClassEntityBean implements EntityBean.
    Best wishes

  • Error while running EJB from java client on JBOSS

    Hi
    As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.gl.TestClient.main(TestClient.java:39)
    Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
         ... 4 more
    Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
         ... 5 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:266)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
         ... 5 more
    Following is my code:
    Home Interface:
    package com.gl;
    import javax.ejb.CreateException;
    public interface testHome extends EJBHome {
         String JNDI_NAME = "testBean";
         public     test create()
         throws java.rmi.RemoteException,CreateException;
    Remote Interface:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface test extends EJBObject {
         public String welcomeMessage() throws RemoteException;
    Bean:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class testbean implements SessionBean {
         public void ejbActivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbPassivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbRemove() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void setSessionContext(SessionContext arg0) throws EJBException,
                   RemoteException {
              // TODO Auto-generated method stub
         public void ejbCreate(){}
         public String welcomeMessage(){
              return "Welcome to the World of EJB";
    ejb-jar.xml:
    <?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>
    <enterprise-beans>
    <session>
    <ejb-name>testBean</ejb-name>
    <home>com.gl.testHome</home>
    <remote>com.gl.test</remote>
    <ejb-class>com.gl.testbean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    jboss.xml:
    <?xml version='1.0' ?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
    <jboss>
    <enterprise-beans>
    <entity>
    <ejb-name>testBean</ejb-name>
    <jndi-name>testBean</jndi-name>
    </entity>
    </enterprise-beans>
    </jboss>
    Client code:
    package com.gl;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
         public static void main(String[] args) throws Exception{
                   try{
                   /*     Properties props=new Properties();
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                   Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "localhost:1099");
                        System.out.println("Properties ok");
                        //env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
                        //env.put(Context.PROVIDER_URL,"http://localhost:8080");
                        //env.put(Context.SECURITY_PRINCIPAL, "");
                        //env.put(Context.SECURITY_CREDENTIALS, "");
                        Context ctx=new InitialContext(props);
                        System.out.println("context ok");
                        //testHome home = (testHome)ctx.lookup("testBean");
                        Object obj = ctx.lookup ("testBean");
                        System.out.println("ojb = " + obj);
                        testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
                   test ejbObject = ejbHome.create();
                   String message = ejbObject.welcomeMessage();
                        System.out.println("home ok");
                        System.out.println("remote ok");
                        System.out.println(message);
                        catch(Exception e){e.printStackTrace();}
    I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
    kindly suggest me something to solve this issue.
    Regards
    Gagan
    Edited by: Gagan2914 on Aug 26, 2008 3:28 AM

    Is it a remote lookup? Then maybe this will help:
    [http://wiki.jboss.org/wiki/JBoss42FAQ]
    - Roy

  • Trying to create cmp correctly(auto-increment);error while running

    I am using the latest versions of Jboss(4.0.5.GA) and Lomboz(R-3.2-200610201336) along with SQL Server 2005 and Microsoft's SQL Server 2005 JDBC driver.
    Lomboz used xdoclet to create the java files based on the SQL table but it did not put anything in the DoctorBean.java file telling it that the primary key was auto-incremented.
    Using the JSP files, I can retreive data out of the database fine so I know the connection and drivers are set up properly.
    Here is the error:
    09:16:46,815 WARN  [ServiceController] Problem starting service jboss.j2ee:service=EjbModule,module=MedicalEJB.jar
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at java.lang.String.charAt(Unknown Source)
        at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:197)
        at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClassFromClassLoader(UnifiedLoaderRepository3.java:277)
        at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:284)
        at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
        at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.jboss.util.loading.DelegatingClassLoader.loadClass(DelegatingClassLoader.java:89)
        at org.jboss.mx.loading.LoaderRepositoryClassLoader.loadClass(LoaderRepositoryClassLoader.java:90)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.jboss.util.loading.DelegatingClassLoader.loadClass(DelegatingClassLoader.java:89)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData.<init>(JDBCEntityCommandMetaData.java:73)
        at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDBCEntityMetaData.java:952)
        at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:378)
        at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:89)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:736)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:424)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:368)
        at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:172)
        at org.jboss.ejb.EjbModule.startService(EjbModule.java:414)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:417)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy25.start(Unknown Source)
        at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:662)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
        at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
        at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
        at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
        at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy26.start(Unknown Source)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
        at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy8.deploy(Unknown Source)
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:417)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy5.deploy(Unknown Source)
        at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
        at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
        at org.jboss.Main.boot(Main.java:200)
        at org.jboss.Main$1.run(Main.java:490)
        at java.lang.Thread.run(Unknown Source)
    09:16:46,862 INFO  [EJBDeployer] Deployed: file:/C:/java/jboss-4.0.5.GA/server/default/deploy/MedicalEJB.jar
    09:16:46,987 INFO  [TomcatDeployer] deploy, ctxPath=/MedicalWeb, warUrl=.../tmp/deploy/tmp63256MedicalWeb-exp.war/
    09:16:47,315 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
    09:16:47,503 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    --- MBeans waiting for other MBeans ---
    ObjectName: jboss.j2ee:service=EjbModule,module=MedicalEJB.jar
      State: FAILED
      Reason: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
    ObjectName: jboss.j2ee:service=EjbModule,module=MedicalEJB.jar
      State: FAILED
      Reason: java.lang.StringIndexOutOfBoundsException: String index out of range: 01Simple Doctor table:
    CREATE TABLE [dbo].[Doctors](
        [DoctorId] [int] IDENTITY(1,1) NOT NULL,
        [firstName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
        [lastName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    CONSTRAINT [PK_Doctors] PRIMARY KEY CLUSTERED
        [DoctorId] ASC
    )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY]Most of DoctorBean.java was createded automatically with xdoclet, I created these items manually but with no success:
    * @jboss.entity-command
    * name="mssql-get-generated-keys"
    * @jboss.unknown-pk
    * class="java.lang.Integer"
    * column-name="doctorid"
    * field-name="doctorid"
    * jdbc-type="INTEGER"
    * sql-type="int"
    * auto-increment="true"DoctorBean.java:
    package com.bdintegrations.MedicalApp.EJB;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.EntityContext;
    import javax.ejb.RemoveException;
    * <!-- begin-xdoclet-definition -->
    * @ejb.bean name="Doctor"
    *    jndi-name="Doctor"
    *    type="CMP"
    *  primkey-field="doctorid"
    *  schema="DoctorSCHEMA"
    *  cmp-version="2.x"
    *  @ejb.persistence
    *   table-name="dbo.Doctors"
    * @ejb.finder
    *    query="SELECT OBJECT(a) FROM DoctorSCHEMA as a" 
    *    signature="java.util.Collection findAll()" 
    * @ejb.pk
    *  class="java.lang.Object"
    *  generate="false"
    * @jboss.entity-command
    * name="mssql-get-generated-keys"
    * @jboss.unknown-pk
    * class="java.lang.Integer"
    * column-name="doctorid"
    * field-name="doctorid"
    * jdbc-type="INTEGER"
    * sql-type="int"
    * auto-increment="true"
    * @jboss.persistence
    * datasource="java:/MSSQLDS"
    * datasource-mapping="MS SQLSERVER2005"
    * table-name="dbo.Doctors"
    * create-table="false" remove-table="false"
    * alter-table="false"
    * <!-- end-xdoclet-definition -->
    * @generated
    public abstract class DoctorBean implements javax.ejb.EntityBean {
         * <!-- begin-user-doc -->
         * The  ejbCreate method.
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.create-method
         * <!-- end-xdoclet-definition -->
         * @generated
        public java.lang.Object ejbCreate(String firstName, String lastName) throws javax.ejb.CreateException {
            setFirstname(firstName);
            setLastname(lastName);
            return null;
            // end-user-code
         * <!-- begin-user-doc -->
         * The container invokes this method immediately after it calls ejbCreate.
         * <!-- end-user-doc -->
         * @generated
        public void ejbPostCreate() throws javax.ejb.CreateException {
            // begin-user-code
            // end-user-code
         * <!-- begin-user-doc -->
         * CMP Field doctorid
         * Returns the doctorid
         * @return the doctorid
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.persistent-field
         * @ejb.persistence
         *    column-name="DoctorId"
         *     jdbc-type="INTEGER"
         *     sql-type="int identity"
         *     read-only="false"
         * @ejb.pk-field
         * @ejb.interface-method
         * <!-- end-xdoclet-definition -->
         * @generated
        public abstract java.lang.Integer getDoctorid();
         * <!-- begin-user-doc -->
         * Sets the doctorid
         * @param java.lang.Integer the new doctorid value
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.interface-method
         * <!-- end-xdoclet-definition -->
         * @generated
        public abstract void setDoctorid(java.lang.Integer doctorid);
         * <!-- begin-user-doc -->
         * CMP Field firstname
         * Returns the firstname
         * @return the firstname
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.persistent-field
         * @ejb.persistence
         *    column-name="firstName"
         *     jdbc-type="VARCHAR"
         *     sql-type="varchar"
         *     read-only="false"
         * @ejb.interface-method
         * <!-- end-xdoclet-definition -->
         * @generated
        public abstract java.lang.String getFirstname();
         * <!-- begin-user-doc -->
         * Sets the firstname
         * @param java.lang.String the new firstname value
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.interface-method
         * <!-- end-xdoclet-definition -->
         * @generated
        public abstract void setFirstname(java.lang.String firstname);
         * <!-- begin-user-doc -->
         * CMP Field lastname
         * Returns the lastname
         * @return the lastname
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.persistent-field
         * @ejb.persistence
         *    column-name="lastName"
         *     jdbc-type="VARCHAR"
         *     sql-type="varchar"
         *     read-only="false"
         * @ejb.interface-method
         * <!-- end-xdoclet-definition -->
         * @generated
        public abstract java.lang.String getLastname();
         * <!-- begin-user-doc -->
         * Sets the lastname
         * @param java.lang.String the new lastname value
         * <!-- end-user-doc -->
         * <!-- begin-xdoclet-definition -->
         * @ejb.interface-method
         * <!-- end-xdoclet-definition -->
         * @generated
        public abstract void setLastname(java.lang.String lastname);
        /* (non-Javadoc)
         * @see javax.ejb.EntityBean#ejbActivate()
        public void ejbActivate() throws EJBException, RemoteException {
            // TODO Auto-generated method stub
        /* (non-Javadoc)
         * @see javax.ejb.EntityBean#ejbLoad()
        public void ejbLoad() throws EJBException, RemoteException {
            // TODO Auto-generated method stub
        /* (non-Javadoc)
         * @see javax.ejb.EntityBean#ejbPassivate()
        public void ejbPassivate() throws EJBException, RemoteException {
            // TODO Auto-generated method stub
        /* (non-Javadoc)
         * @see javax.ejb.EntityBean#ejbRemove()
        public void ejbRemove() throws RemoveException, EJBException,
                RemoteException {
            // TODO Auto-generated method stub
        /* (non-Javadoc)
         * @see javax.ejb.EntityBean#ejbStore()
        public void ejbStore() throws EJBException, RemoteException {
            // TODO Auto-generated method stub
        /* (non-Javadoc)
         * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
        public void setEntityContext(EntityContext arg0) throws EJBException,
                RemoteException {
            // TODO Auto-generated method stub
        /* (non-Javadoc)
         * @see javax.ejb.EntityBean#unsetEntityContext()
        public void unsetEntityContext() throws EJBException, RemoteException {
            // TODO Auto-generated method stub
        public DoctorBean() {
            // TODO Auto-generated constructor stub
    }JSP client page snippet:
    <%
    DoctorHome home = DoctorUtil.getHome();
    Doctor doctor = home.create("Jon","Smith");
    %>
    <%=doctor.getDoctorid() %>thanks

    Nevermind.. no one bothered to inform the developer that the path to the collection AND the path to the directory that the collection is for are different on this other server.
    Fixed.

  • Unable to create reference: org.omg.CORBA.OBJ_ADAPTER

    What is causing this error? I believe it is a configuration error, but I cannot discern what it is.
    Setup:
    I have two beans: a User entity bean, and a UserWrapper stateful session bean.
    Execution:
    My testing client-code looks up the UserWrapper EJB and creates a new object. In the UserWrapper ejbCreate method I am attempting to obtain a reference to a specific User by looking up the User EJB and calling its findByPrimaryKey method.
    Everything works fine right up until the UserWrapper.ejbCreate method is ready to close; I catch this exception:
    RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: nested exception is: java.lang.RuntimeException:
    Unable to create reference org.omg.CORBA.OBJ_ADAPTER: vmcid: SUN minor code: 1015 completed: No;
    Observations:
    User.ejbFindByPrimaryKey(UserPK pk) is NOT throwing ANY EXCEPTIONS! The error is passed to UserWrapper.ejbCreate from the container, or so it seems, but I am relatively positive it is not orginiating from the finder method. At this time the User.ejbFindByPrimaryKey method only returns the primary key object.
    UserWrapper.ejbCreate code:
    public void ejbCreate(String usrnm, String pswrd) throws CreateException {
      // instance variables
      UserHome userHome = null;
      // implementation
      try {
        // obtain an instance of the EJBHomeFactory and have it return an
        // instance of the UserHome interface
        userHome = (UserHome)EJBHomeFactory.getInstance().lookup(
            "ejb/User", net.cmpro.app.entity.user.UserHome.class);
        // request the container supply a User object for the specified
        // primary key object
        this.user = userHome.findByPrimaryKey(new UserPK(usrnm, pswrd));
      catch(FinderException e) {
        throw new CreateException(e.toString());
      catch(RemoteException e) {
        throw new EJBException(e.toString(), e);
    }Need a little help here. I'm getting very frustrated because I've never had this problem before.
    Thanks for any advice, no matter how off the wall it is.

    Yes, it is. This returns an EJBHome object from a cache. I picked this up from the IBM website. It is very handy. The method in question is as follows:
    public EJBHome lookup(String jndi, Class home) throws EJBException {
      // instance variables
      EJBHome ejbHome = null;
      Object obj = null;
      // implementation
      try {
        // looks for the interface in the collection by class
        ejbHome = (EJBHome)interfaces.get(home);
        if(ejbHome == null) {
          // looks up the interface by its JNDI name
          obj = context.lookup(jndi);
          // casts the returned object into the interface desired
          ejbHome = (EJBHome)PortableRemoteObject.narrow(obj, home);
          // put the newly retreived interface into the collection and
          // list it by its class      never use the interfaces JNDI name
          // because a single EJB object could have multiple JNDI names
          interfaces.put(home, ejbHome);
      catch(ClassCastException e) {
        throw new EJBException(e.toString());
      catch(NamingException e) {
        throw new EJBException(e.toString(true), e);
      return ejbHome;
    }

  • EjbCreate() architecture with CMP 2.0; confused

    I exhaustively searched for this topic in this, and other forums, and
    tried some suggested techniques, but none worked.
    I've received "Primary key fields of bean not initialized" in     the following stmt.
         Entity1Remote prEntity1Remote = printHome.create( new Integer(1) );     <-- should parm. list be empty??
    RemoteClient1.java contains:
         package com.zbeans;
         import com.zbeans.Entity1Remote;
         import com.zbeans.Entity1RemoteHome;
         import javax.naming.InitialContext;
         Context prinitctx = new InitialContext();
         Context prenvctx = (Context) prinitctx.lookup("java:comp/env");
         Object prrefHome = prenvctx.lookup("ejb/Entity1 EJB ref1");
         Entity1RemoteHome printHome = (Entity1RemoteHome)
              PortableRemoteObject.narrow( prrefHome, Entity1RemoteHome.class );
         /* Following causes "Primary key fields of bean not initialized" */
         Entity1Remote prEntity1Remote = printHome.create( new Integer(1) );     <-- should parm. list be empty??
         I ran using D:\zJava\zsamples\EJB\application1>C:\j2sdkee1.3.1\bin\runclient -client application1.ear -name RemoteClient1 -textauth
         I ensured j2ee and cloudscape were running, and
         set APPCPATH=application1Client.jar     (application1Client.jar was generated by the deployment tool)
    The bean code contains:
         package com.zbeans;
         import javax.ejb.*;
         public abstract class Entity1Bean implements javax.ejb.EntityBean {
              public Integer property1;     /* primary key (all lower case, unless that
                   breaches naming conventions?). All letters s/b in lower case to
                   exactly match non-capitalization of primary key in deployment tool?? */
              /* Must the parm. variable be identically named as the primary key name?? */
              public Integer ejbCreate(Integer property1) throws EJBException, CreateException {
              //public Integer ejbCreate(Integer pnNewProperty1) throws EJBException, CreateException {
              //public void ejbCreate(Integer pnNewProperty1) throws EJBException, CreateException {
                   System.out.println("\nInside Entity1Bean.ejbCreate()");     <-- this stmt. was reached
                   this.property1 = property1;
                   //property1 = pnNewProperty1;
                   /* return pnNewProperty1; or return Property1?? should return null for
                        CMP 2.0?? I don't     think so */
                   return property1;
              }     // ejbCreate() method
              public abstract Integer getProperty1();
              public abstract void setProperty1(Integer pnNewProperty1);
    Entity1RemoteHome.java contains:
         package com.zbeans;
         import java.rmi.RemoteException;
         import javax.ejb.*;
         public interface Entity1RemoteHome extends javax.ejb.EJBHome {
         public Entity1Remote create (Integer property1)
              throws CreateException, RemoteException, EJBException;
    Remote1Client1, Entity1RemoteHome.java, etc. resides under d:\zjava\zsamples\com\zbeans
    Unsuccessful remedies:
         1) in Entity1Bean
         public Integer ejbCreate(Integer id) throws javax.ejb.CreateException {
         coded
              return id;
         instead of
              return null;
         - some newsgroup posting states that for EJB 2.0 CMP must return Primary key
              type, while others disagree (refer below)
    2)
         defined ejbCreate() return type as void instead of Integer,
         and commented out return stmt. i.e.
         public void ejbCreate(Integer id)
              //return null;
         - instead of -
         public Integer ejbCreate(Integer id)
              return null;
         - this compiled clean with javac, but in deployment tool system.err
         contained:
         Entity1Bean_PM.java:76: illegal start of expression return (void)
         partition.afterEjbCreate(this); ^
         c:\j2sdkee1.3.1\repository\computer\gnrtrTMP\application1\com\zbeans\Entity1Bean_PM.
         java:76: ')' expected return (void) partition.afterEjbCreate(this);
         c:\j2sdkee1.3.1\repository\computer\gnrtrTMP\application1\com\zbeans\Entity1Bean_PM.
         java:76: cannot return a value from method whose result type is void
         return (void) partition.afterEjbCreate(this); ^
    3) property1 is actually the Integer primary key in deployment tool, so tried the
    following
         public Integer Property1;     /* primary key; all letter s/b in lower case to
              exactly match capitalization in deployment tool?? */
         public Integer ejbCreate(Integer pnNewProperty1) throws EJBException, CreateException {
              Property1 = pnNewProperty1;
              return pnNewProperty1;
         }     // ejbCreate() method
    4) as above, but typed property1 all in lower case so it would match the
    non-capitalization of the primary key in the deployment tool i.e.
         public Integer property1;     /* primary key; all letter s/b in lower case to
              exactly match capitalization in deployment tool?? */
         public Integer ejbCreate(Integer pnNewProperty1) throws EJBException, CreateException {
              property1 = pnNewProperty1;
              return pnNewProperty1;
         }     // ejbCreate() method
    5) as above, but made the parm. variable identically named as the
    primary key name, and modifed return stmt. i.e.
         public Integer ejbCreate(Integer property1) throws EJBException, CreateException {     
              this.property1 = property1;
              return property1;          /* removing this return caused " missing return
                   statement" */
         }     // ejbCreate() method
    My environment settings are:
         java version "1.4.0_01"
         Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
         Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
         WinNT 4.0 SP5
         CLASSESDIR=c:\j2sdkee1.3.1\lib\classes
         CLASSPATH=.;c:\j2sdkee1.3.1\lib\j2ee.jar;D:\jakarta-tomcat-3.3.1\lib\common\serv
         let.jar;C:\JRun4\servers\default\default-ear\default-war\WEB-INF\classes;D:\zJav
         a\zsamples\EJB\application1
         J2EEJARS=c:\j2sdkee1.3.1\lib\j2ee.jar
         J2EETOOL_CLASSES=c:\j2sdkee1.3.1\lib\toolclasses
         J2EETOOL_JAR=c:\j2sdkee1.3.1\lib\j2eetools.jar
         J2EE_HOME=c:\j2sdkee1.3.1
         JAVA_HOME=C:\j2sdk1.4.0_01
         etc.
    My understanding was that for CMP2.0, ejbCreate() should accept a parm.
    and return the primary key type? For my application, CMP 2.0 is
    specified in the J2EE deploytool. I'm really getting confused on the
    correct rules for developing the ejbCreate() in CMP 2.0 vs BMP, I've
    read conflicting postings.
    Instead of the J2EE Deployment Tool, am I better off learning another
    server/deployer, such as JBoss, VisualAge for CSP, etc.?

    I have noticed two bugs in your code:
    1) You should ALWAYS use abstract get/set methods to modify CMP fields
    of EJB 2.0 CMP entity bean.
    Instead of
    this.property1 = property1;call
    setProperty1(Integer pnNewProperty1);2) you should return null in ejbCreate() method
    "The entity object created by the ejbCreate<METHOD> method must have a unique primary
    key. This means that the primary key must be different from the primary keys of all the existing
    entity objects within the same home. However, it is legal to reuse the primary key of a previously
    removed entity object. The implementation of the Bean Provider?s ejbCreate<
    METHOD>(...) methods should be coded to return a null.[14]"
    I hope it helps
    Maris Orbidans

  • Getting a Mail session from Initialcontext

    Hi,
    Does anyone know how to configure oc4j such that i could get a mail session by looking up in the initial context? I know it could be done in jboss by altering an xml file. But I am not sure how to do it in oc4j. Could someone help please?
    Could any one explain to me what is the use of PortableRemoteObject.narrow method used for? As down cast could be done directly, why is there a need for PortableRemoteObject. Thanks
    if say, part of the j2ee application (some ejb jar files) is running on a host, and the j2ee application (some different ejb jar files) is running on a different host, and to look up the ejb on diferrent host normal java casting cannot be done cause they are network appart. So we need PortableRemoteObject to do the down casting. Is that right?
    If say, on a different situation, a server (orion or weblogic) is running on a host and the j2ee application is on another different host, to get the initial context, we need to set the provider and the uri say something like t3 for weblogic and ormi for orion... Am I right so far? please correct me if i am not. And to lookup the DataSource for connection pooling in order to get a connection, do we need to use portable remove object as well? I think so cause they are separated and they should communicate using rmi-iiop? Is that correct?
    Is CreateException, FinderException, RemoveException and EJBException applicable to their respective methods? Say CreateException is thorwn when problems in creating a bean instance and finder when canno find bean due to (maybe connection or sql error) etc. RemoveException when ejbRemove encounter problems and EJBException when business methods cannot succeed? In sun tutorial all methods throw EjbException which confused me. Could someone shed some light on this issue please?
    Thanks a lot
    Ras

    No.

Maybe you are looking for

  • Enabling button mode on Accordion item

    I have an Accordion with an AccordionHeader skin, and at runtime I add a navigatorContent component a number of times to dynamically create my accordion. What I need to do is have the cursor change to a hand when rolling over each accordion header (s

  • PS...Collective PR indicator Functionality

    Hi, I am using collective PR functionality in projects. When I upload the material from external Excel sheet and transfer the BOM, single PR is getting created in the system, however the item nos in PR are not identical with the sr. nos. given in exc

  • Additional field for Material Master of SRM

    Hi, We want to add 3 <b>additional fields to the product master table</b> of SRM. We do not want to use these additional fields on any documents (neither SC nor PO nor contracts etc). We do not want to display these additional fields on Enterprise Bu

  • Reg:Process Order Notification in PP

    Hi Experts,      I have a clarification that while doing process order,after usage decision a notification will be automatically generated, if in the usage decision the user selected rework, then after activating it it should go to production order s

  • SSID not Broadcasting after reload

    Hi all, I have Build a 5508-HA Cluster (7.4.100.0) , hat to reboot this cluster due to Licens install. After the reboot atleast one of the SSIDs was not broadcasting anymore, even the checkbox was checked. What did I do: Installed the Licenses @ Frei