persistence@glassfish.java.net

RE: stand-alone & portable clients -ejb3

From: Eve Pokua <gorgeous65_at_msn.com>
Date: Tue, 8 Apr 2008 19:02:00 +0100

Hello James/everyone,
 
I already have try and catch in my application, this' why I don't understand why I see nothing. I
get the following message at deployment:
 
[#|2008-04-08T18:31:09.953+0100|INFO|sun-appserver9.1|javax.enterprise.system.core.classloading|_ThreadID=15;_ThreadName=Thread-49;|LDR5202:Exception in EJBClassLoaderjava.io.IOException: The filename, directory name, or volume label syntax is incorrect at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396) at java.io.File.getCanonicalPath(File.java:559) at com.sun.enterprise.loader.EJBClassLoader$1.run(EJBClassLoader.java:431) at java.security.AccessController.doPrivileged(Native Method) at com.sun.enterprise.loader.EJBClassLoader.findResource0(EJBClassLoader.java:404) at com.sun.enterprise.loader.EJBClassLoader.findResource(EJBClassLoader.java:480) at java.lang.ClassLoader.getResource(ClassLoader.java:977) at java.lang.ClassLoader.getResource(ClassLoader.java:972) at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159) at com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:795) at com.sun.xml.rpc.spi.JaxRpcObjectFactory.newInstance(JaxRpcObjectFactory.java:131) at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.<init>(JaxRpcRICodegen.java:134) at com.sun.enterprise.webservice.codegen.JaxRpcCodegenFactory.getAdapter(JaxRpcCodegenFactory.java:63) at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:855) at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:593) at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployApp(EJBCompiler.java:290) at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:226) at com.sun.enterprise.deployment.backend.AppDeployer.runEJBC(AppDeployer.java:319) at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:240) at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)|#]
[#|2008-04-08T18:31:10.984+0100|INFO|sun-appserver9.1|oracle.toplink.essentials.session.file:/C:/jee/STOCKINFOR2/dist/gfdeploy/STOCKINFOR2-ejb_jar/-STOCKINFOR2-ejbPU|_ThreadID=15;_ThreadName=Thread-49;|TopLink, version: Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))|#]
[#|2008-04-08T18:31:11.062+0100|INFO|sun-appserver9.1|oracle.toplink.essentials.session.file:/C:/jee/STOCKINFOR2/dist/gfdeploy/STOCKINFOR2-ejb_jar/-STOCKINFOR2-ejbPU|_ThreadID=15;_ThreadName=Thread-49;|Server: unknown|#]
[#|2008-04-08T18:31:13.593+0100|INFO|sun-appserver9.1|oracle.toplink.essentials.session.file:/C:/jee/STOCKINFOR2/dist/gfdeploy/STOCKINFOR2-ejb_jar/-STOCKINFOR2-ejbPU|_ThreadID=15;_ThreadName=Thread-49;|file:/C:/jee/STOCKINFOR2/dist/gfdeploy/STOCKINFOR2-ejb_jar/-STOCKINFOR2-ejbPU login successful|#]
[#|2008-04-08T18:31:13.703+0100|INFO|sun-appserver9.1|oracle.toplink.essentials.session.file:/C:/jee/STOCKINFOR2/dist/gfdeploy/STOCKINFOR2-ejb_jar/-STOCKINFOR2-ejbPU|_ThreadID=15;_ThreadName=Thread-49;|file:/C:/jee/STOCKINFOR2/dist/gfdeploy/STOCKINFOR2-ejb_jar/-STOCKINFOR2-ejbPU logout successful|#]
[#|2008-04-08T18:31:14.312+0100|WARNING|sun-appserver9.1|javax.enterprise.resource.jdo.codegen.ejb|_ThreadID=15;_ThreadName=Thread-49;_RequestID=386b7d12-4211-4eba-8eba-5459476442ab;|JDO76609: Got SQLException executing statement "CREATE TABLE CUSTOMER (CUSID VARCHAR(20) NOT NULL, ADDRESS1 VARCHAR(90) NULL, ADDRESS2 VARCHAR(90) NULL, FIRSTNAME VARCHAR(50) NULL, POSTCODE VARCHAR(12) NULL, PHONENO NUMERIC(19) NULL, SURNAME VARCHAR(50) NULL, PASSWORD VARCHAR(20) NULL, PRIMARY KEY (CUSID))": java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]There is already an object named 'CUSTOMER' in the database.|#]
[#|2008-04-08T18:31:14.343+0100|WARNING|sun-appserver9.1|javax.enterprise.resource.jdo.codegen.ejb|_ThreadID=15;_ThreadName=Thread-49;_RequestID=386b7d12-4211-4eba-8eba-5459476442ab;|JDO76609: Got SQLException executing statement "CREATE TABLE SELF_COLITEMS (LOCATION VARCHAR(20) NULL, ITMID VARCHAR(8) NOT NULL, PRIMARY KEY (ITMID))": java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]There is already an object named 'SELF_COLITEMS' in the database.|#]
[#|2008-04-08T18:31:14.343+0100|WARNING|sun-appserver9.1|javax.enterprise.resource.jdo.codegen.ejb|_ThreadID=15;_ThreadName=Thread-49;_RequestID=386b7d12-4211-4eba-8eba-5459476442ab;|JDO76609: Got SQLException executing statement "CREATE TABLE COLLPOINTORDERLINE (ITMID VARCHAR(255) NOT NULL, COLLORDID VARCHAR(255) NOT NULL, CUSID VARCHAR(255) NOT NULL, PRIMARY KEY (ITMID, COLLORDID, CUSID))": java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]There is already an object named 'COLLPOINTORDERLINE' in the database.|#]
[#|2008-04-08T18:31:14.343+0100|WARNING|sun-appserver9.1|javax.enterprise.resource.jdo.codegen.ejb|_ThreadID=15;_ThreadName=Thread-49;_RequestID=386b7d12-4211-4eba-8eba-5459476442ab;|JDO76609: Got SQLException executing statement "CREATE TABLE STAFF (STAID VARCHAR(10) NOT NULL, SURNAME VARCHAR(80) NULL, PASSWORD VARCHAR(20) NULL, FIRSTNAME VARCHAR(70) NULL, STATUS VARCHAR(15) NOT NULL, DEPTID VARCHAR(4) NULL, PRIMARY KEY (STAID))": java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]There is already an object named 'STAFF' in the database.|#]
 
..............
 
 
[#|2008-04-08T18:31:15.109+0100|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|**RemoteBusinessJndiName: stockInformation.CollOrdlinerem; remoteBusIntf: stockInformation.CollOrdlinerem|#]
[#|2008-04-08T18:31:15.125+0100|INFO|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;java:comp/env/stockInformation.DepartmentSessBean/em;|naming.bind|#]
[#|2008-04-08T18:31:15.140+0100|INFO|sun-appserver9.1|javax.enterprise.resource.corba|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|POARemoteRefFactory checking if SFSBVersionPolicy need to be added|#]
[#|2008-04-08T18:31:15.140+0100|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==> false|#]
[#|2008-04-08T18:31:15.140+0100|INFO|sun-appserver9.1|javax.enterprise.resource.corba|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|POARemoteRefFactory addSFSBVersionPolicy? false|#]
[#|2008-04-08T18:31:15.140+0100|INFO|sun-appserver9.1|javax.enterprise.resource.corba|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|POARemoteRefFactory checking if SFSBVersionPolicy need to be added|#]
[#|2008-04-08T18:31:15.140+0100|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==> false|#]
[#|2008-04-08T18:31:15.140+0100|INFO|sun-appserver9.1|javax.enterprise.resource.corba|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|POARemoteRefFactory addSFSBVersionPolicy? false|#]
[#|2008-04-08T18:31:15.140+0100|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|**RemoteBusinessJndiName: stockInformation.Department; remoteBusIntf: stockInformation.Department|#]
[#|2008-04-08T18:31:15.156+0100|INFO|sun-appserver9.1|javax.enterprise.system.core.naming|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;java:comp/env/STOCKINFOR2-ejbPU;|naming.bind|#]
[#|2008-04-08T18:31:15.171+0100|INFO|sun-appserver9.1|javax.enterprise.resource.corba|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|POARemoteRefFactory checking if SFSBVersionPolicy need to be added|#]
[#|2008-04-08T18:31:15.171+0100|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==> false|#]
[#|2008-04-08T18:31:15.171+0100|INFO|sun-appserver9.1|javax.enterprise.resource.corba|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|POARemoteRefFactory addSFSBVersionPolicy? false|#]
[#|2008-04-08T18:31:15.171+0100|INFO|sun-appserver9.1|javax.enterprise.resource.corba|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|POARemoteRefFactory checking if SFSBVersionPolicy need to be added|#]
[#|2008-04-08T18:31:15.171+0100|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;|EJBSCLookup:: sc.getEjbContainerAvailabilityEnabledFromConfig() ==> false|#]
.....
 
 
#|2008-04-08T18:31:15.500+0100|WARNING|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=13;_ThreadName=httpWorkerThread-4848-1;_RequestID=cd1637f4-635b-4b60-b791-80d5cf8613f6;|Error attempting to process extensions from the manifest of JAR file C:\jee\STOCKINFOR2\dist\gfdeploy\STOCKINFOR2-ejb.jar; ignoring it and continuingjava.io.FileNotFoundException: C:\jee\STOCKINFOR2\dist\gfdeploy\STOCKINFOR2-ejb.jar (The system cannot find the file specified) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:114) at java.util.jar.JarFile.<init>(JarFile.java:133) at java.util.jar.JarFile.<init>(JarFile.java:97)
 
 
 
From my client:package stockinfor2;
import java.awt.BorderLayout;import java.awt.event.*;import javax.ejb.EJB;import javax.swing.*;import javax.swing.JPanel;import stockInformation.*;import stockInformation.Department;
 
public class TestClient { @EJB private static Department department;
    public TestClient(String[] args) { } //public TestClient() { //}
    /** * @param args the command line arguments */ public static void main(String[] args) { TestClient client = new TestClient(args); client.doTest(); }
    public void doTest() { try { department.createDepartment(); System.out.println("successfull");
         } catch (Exception ex) { System.err.println("Caught a Exception: not working "); ex.printStackTrace(); //System.exit(0);} }}
 
and the implementation class:
 
@Statefulpublic class DepartmentSessBean implements Department{
 
 @PersistenceContext(name="STOCKINFOR2-ejbPU") private EntityManager em;
public void createDepartment(){ Departmentent departmentent=new Departmentent(); try{ departmentent.setDeptID("t34"); departmentent.setDepartmentname("tesgxfg8"); em.persist(departmentent);
            System.out.println("inserted new department details"); } catch(Exception ex){ System.err.println("Can not insert new department details into DB"); ex.printStackTrace();} }
 
Remote:
 
 
 
package stockInformation;
import javax.ejb.*;@Remote
public interface Department { public void createDepartment();
    }
 
Entity class:
 
@Entity_at_Table(name="DEPARTMENT")
public class Departmentent implements java.io.Serializable{
 
 @Id @Column(name="DEPTID", nullable=false, length=4) private String deptID; @Column(name="DEPARTNAME", nullable=true, length=25) private String departmentname;
 //no set and get methods is produced as relationship is a unidirectional @OneToMany(mappedBy="departmentent") private Collection <Iteamdetailsent> iteamdetailsent;
 //constructor with no argument public Departmentent(){ } public Departmentent(String deptID,String departmentname){ }
 public String getDeptID(){ return deptID;} public void setDeptID(String deptID){ this.deptID=deptID;} public String getDepartmentname(){ return departmentname;} public void setDepartmentname(String departmentname){ this.departmentname=departmentname;}
 
So what Im I doing wrong?
 
Your suggestion would be apprecaited.
 
Thanks
 
eve
 
 



> Date: Tue, 8 Apr 2008 05:55:23 -0700> From: jamesssss@yahoo.com> To: persistence@glassfish.dev.java.net> Subject: Re: stand-alone & portable clients -ejb3> > > Are you sure that no errors are occurring? Perhaps the errors are somehow> being caught or lost.> > Try setting the log level to finest and include the log for an operation and> the source code for the operation. Try adding a try catch block and dumping> any error that may be occurring.> > Are you accessing JPA from the client, or the server?> > > eveeve wrote:> > > > Hello everyone,> > > > I have been trying to working on this for some time now.> > I started my application with stand-alone clients and now> > what to change it application client to make it portable.> > > > I have tried and got to a point where I get now error but > > nothing is going into the DB and there is no error. I was> > told that if the application has been set to metadata to true> > that it stops the injection from taking place. When I run > > it as stand alone it works but when I try my application> > client, nothing happens. Could it be that it is not injecting?> > > > I have tried the Cart and order examples of the tutorial. And> > followed it but still nothing seems to be working. > > > > I have testing it both with the Java DB and MS SQL server 2000 using> > toplink.> > > > Here is the application - client xml:> > > > <?xml version="1.0" encoding="UTF-8"?>> > <application-client version="5" xmlns="http://java.sun.com/xml/ns/javaee"> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee> > http://java.sun.com/xml/ns/javaee/application-client_5.xsd">> > <display-name>STOCKINFOR2-app-client</display-name>> > </application-client>> > > > > > and application xml> > > > > > <?xml version="1.0" encoding="UTF-8"?>> > <application version="5" xmlns="http://java.sun.com/xml/ns/javaee"> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee> > http://java.sun.com/xml/ns/javaee/application_5.xsd">> > <display-name>STOCKINFOR2</display-name>> > <module>> > <web>> > <web-uri>STOCKINFOR2-war.war</web-uri>> > <context-root>/STOCKINFOR2-war</context-root>> > </web>> > </module>> > <module>> > <java>STOCKINFOR2-app-client.jar</java>> > </module>> > <module>> > <ejb>STOCKINFOR2-ejb.jar</ejb>> > </module>> > </application>> > > > > > Could you see anything I can't see and if so, please> > help.> > > > Thanks> > > > eve> > > > > -----> ---> http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland > http://www.eclipse.org/eclipselink/> EclipseLink , http://www.oracle.com/technology/products/ias/toplink/> TopLink > Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink , > http://wiki.oracle.com/page/TopLink TopLink > Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , > http://www.nabble.com/EclipseLink-f26430.html EclipseLink > Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence > -- > View this message in context: http://www.nabble.com/stand-alone---portable-clients--ejb3-tp16540247p16558221.html> Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.>
_________________________________________________________________
Win 100’s of Virgin Experience days with BigSnapSearch.com
http://www.bigsnapsearch.com