I am getting error when trying to run a session bean that creates an entity
bean.  Here is the section of the code that's throwing exception:

ScheduleBeanPK pk = new ScheduleBeanPK(jobName, jobType);
                System.out.println("got here1");
                Schedule oldSchedule = home.findByPrimaryKey(pk);
                System.out.println("got here2");
                String dummy1 = oldSchedule.getJobName(); // Force loading
of data here
                System.out.println("got here3");
                String dummy2 = oldSchedule.getJobType(); //If any execption
is thrown here, then that record doesn't exit
                System.out.println("got here4");
                // If we get here, the Schedule is already in the collection
                throw new ScheduleExistsException();
                }
        // Because we aren't dealing with air traffic control here, I will
assume
        // that any exception generated from finding whether a Schedule
exists in the
        // database is an indication that it doesn't, and therefore it's
safe to
        // add it.
        catch (Exception e)
                {
                try
                        {
                        System.out.println("got here5");
                        Schedule sc = home.create(jobName, jobType);
                        System.out.println("got here6");


The code gets to the line "got here1", but it throws an exception at the
line: Schedule oldSchedule = home.findByPrimaryKey(pk); and goes to the
catch block.  The "got here5" is printed to sysout, then this error messages
is displayed on the jboss server console:

D:\Projects\My NetRio Classes\SchedulerDeployment>java -classpath
".;d:\JBoss-2.2.1\conf\default\;d:
\JBoss-2.2.1\client\jboss-client.jar;d:\JBoss-2.2.1\client\jbosssx-client.ja
r;d:\JBoss-2.2.1\client\
jnp-client.jar;d:\JBoss-2.2.1\client\jbossmq-client.jar;d:\JBoss-2.2.1\clien
t\jaas.jar;d:\JBoss-2.2.
1\lib\crimson.jar;d:\JBoss-2.2.1\lib\jaxp.jar;d:\JBoss-2.2.1\lib\jboss-jaas.
jar;d:\JBoss-2.2.1\lib\x
ml.jar;d:\JBoss-2.2.1\client\jndi.jar;.;d:\j2sdkee1.3\lib\j2ee.jar;d:\j2sdke
e1.3\locale;d:\jdk1.3\jr
e\lib\rt.jar" Client
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
        javax.transaction.TransactionRolledbackException:
javax.transaction.TransactionRolledbackExc
eption: Could not create primary key; nested exception is:
        java.lang.InstantiationException: ScheduleBeanPK; nested exception
is:
        java.rmi.ServerException: Could not create primary key; nested
exception is:
        java.lang.InstantiationException: ScheduleBeanPK; nested exception
is:
        java.rmi.RemoteException:
javax.transaction.TransactionRolledbackException: Could not create
 primary key; nested exception is:
        java.lang.InstantiationException: ScheduleBeanPK; nested exception
is:
        java.rmi.ServerException: Could not create primary key; nested
exception is:
        java.lang.InstantiationException: ScheduleBeanPK

D:\Projects\My NetRio Classes\SchedulerDeployment>

Please let me know if anyone has any idea on how to resolve this error.
Thank you so much!
-Malia




_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to