Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 38784 invoked from network); 8 Jan 2009 04:07:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jan 2009 04:07:47 -0000 Received: (qmail 52328 invoked by uid 500); 8 Jan 2009 04:07:45 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 52299 invoked by uid 500); 8 Jan 2009 04:07:45 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 52289 invoked by uid 99); 8 Jan 2009 04:07:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jan 2009 20:07:45 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jan 2009 04:07:35 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LKmAs-0007i0-9e for user@geronimo.apache.org; Wed, 07 Jan 2009 20:07:14 -0800 Message-ID: <21345528.post@talk.nabble.com> Date: Wed, 7 Jan 2009 20:07:13 -0800 (PST) From: bongosdude To: user@geronimo.apache.org Subject: Re: problem JNDI lookup in geronimo In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: bongosdude@gmail.com References: <79999F98-7082-4844-9D95-D3BD3B0F2141@yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org I found it from console. There is a menu "JNDI Viewer", so this is the JNDI for my db pool name: "jdbc/myvoipdb" Thanks CG-6 wrote: > > Hi all, I have solved the previous problem by reinstalling geronimo , > adding tag at appropriate line in persistence.xml > > I decided to reinstall geronimo because I found out I can't redeploy > (to overwrite) the jar package after changing the persistence.xml. > Later , I try to uninstall the EJB and deploy again but it told me > that the configuraion already exist, then I try to check the > "redeploy" but it told me that it is not installed. > > unfortunately I can't reproduce the error > > thx for all, I am now fighting with another error :) > > CG > > > On Sat, Apr 12, 2008 at 8:34 AM, CG wrote: >> Thx for the reply :) >> >> >> > Does your application have any CMP 2.1 Entity beans? >> Not sure whether is CMP 2.1 and how should I verify ? I coded it >> byfollowing a tutorial of EJB3 . I enclose the source of the >> EntityBEan Material.java as a reference at end of msg >> >> >> >> > What geronimo version are you using? >> I am using geronimo 2.1 on ubuntu , below is the openejb-jar.xml & >> persistence.xml for your reference >> >> FYI, my program consists of 2 entity bean, Material & MaterialType. >> Initially I try to use the dbpool in geronimo for the db connection >> but it seems like does not work , therefore , I hardcoded the driver >> name , server name in the coding. >> >> Initially there is tag in the openejb-jar.xml but it >> prompt me for error under eclipse GEP 2.1 snapshot plugin, and Ihave >> remove it out. >> >> Thanks >> CG >> >> >> openejb-jar.xml >> ==================== >> >> >> > xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2" >> xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0" >> xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2" >> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> >> >> >> default >> EJBStructsEJB >> 1.0 >> car >> >> >> >> console.dbpool >> mysql >> >> >> >> >> >> >> persistence.xml >> =================== >> >> > xmlns="http://java.sun.com/xml/ns/persistence" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence >> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> >> >> Entity Beans for Material >> >> org.apache.openjpa.persistence.PersistenceProviderImpl >> com.quesofttech.entity.MaterialType >> >> > value="false"/> >> > value="com.mysql.jdbc.Driver"/> >> > value="jdbc:mysql:localhost:3306/ERP"/> >> > value="root"/> >> > value="super123"/> >> >> >> >> >> >> >> >> >> >> >> >> >> package com.quesofttech.entity; >> >> import java.io.Serializable; >> import java.sql.Date; >> import java.sql.Time; >> >> import javax.persistence.Id; >> import javax.persistence.Entity; >> import javax.persistence.Table; >> >> import javax.persistence.GeneratedValue; >> import javax.persistence.GenerationType; >> //import javax.persistence.SequenceGenerator; >> import javax.persistence.TableGenerator; >> >> import javax.persistence.ManyToOne; >> import javax.persistence.JoinColumn; >> >> @Entity >> @Table(name = "Material") >> //For Postgresql : @SequenceGenerator(name = "material_sequence", >> sequenceName = "material_id_seq") >> //Generic solution : (Use a table named PrimaryKeys, with 2 fields , >> tableName & keyField) >> @TableGenerator( name="material_id", table="PrimaryKeys", >> pkColumnName="tableName", pkColumnValue="material", >> valueColumnName="keyField") >> public class Material implements Serializable { >> >> private static final long serialVersionUID = >> 7422574264557894632L; >> >> private Integer id; >> private String code; >> private String description; >> >> // Foreign keys >> private MaterialType materialType; >> >> // Common fields >> private String recordStatus; >> private String sessionId; >> private String createLogin; >> private String createApp; >> private java.sql.Date createDate; >> private java.sql.Time createTime; >> private String modifyLogin; >> private String modifyApp; >> private java.sql.Date modifyDate; >> private java.sql.Time modifyTime; >> >> >> public Material() { >> super(); >> // TODO Auto-generated constructor stub >> } >> >> public Material(Integer id, String code, String description) { >> super(); >> this.id = id; >> this.code = code; >> this.description = description; >> } >> >> >> public Material(Integer id, String code, String description, >> MaterialType materialType, String recordStatus, >> String sessionId, >> String createLogin, String createApp, Date >> createDate, >> Time createTime, String modifyLogin, String >> modifyApp, >> Date modifyDate, Time modifyTime) { >> super(); >> this.id = id; >> this.code = code; >> this.description = description; >> this.materialType = materialType; >> this.recordStatus = recordStatus; >> this.sessionId = sessionId; >> this.createLogin = createLogin; >> this.createApp = createApp; >> this.createDate = createDate; >> this.createTime = createTime; >> this.modifyLogin = modifyLogin; >> this.modifyApp = modifyApp; >> this.modifyDate = modifyDate; >> this.modifyTime = modifyTime; >> } >> >> @Override >> public String toString() { >> >> return "Id: " + getId() + " Desc: " + getDescription() + >> " Code:" + getCode() + >> " RecordStatus: " + getRecordStatus() + >> " SessionId: " + getSessionId() + >> " CreateLogin: " + getCreateLogin() + >> " CreateApp: " + getCreateApp() + >> " CreateDate: " + getCreateDate() + >> " CreateTime: " + getCreateTime() + >> " ModifyLogin: "+ getModifyLogin() + >> " ModifyApp: " + getModifyApp() + >> " ModifyDate: " + getModifyDate() + >> " ModifyTime: " + getModifyTime(); >> >> } >> >> >> @Id >> //For Postgresql : @GeneratedValue(strategy = >> GenerationType.SEQUENCE, generator = "material_sequence") >> //For MSSQL : @GeneratedValue(strategy = >> GenerationType.IDENTITY) >> //Generic solution : >> @GeneratedValue(strategy = GenerationType.TABLE, generator = >> "material_id") >> public Integer getId() { >> return id; >> } >> public void setId(Integer id) { >> this.id = id; >> } >> public String getCode() { >> return code; >> } >> public void setCode(String code) { >> this.code = code; >> } >> public String getDescription() { >> return description; >> } >> public void setDescription(String description) { >> this.description = description; >> } >> public String getRecordStatus() { >> return recordStatus; >> } >> public void setRecordStatus(String recordStatus) { >> this.recordStatus = recordStatus; >> } >> public String getSessionId() { >> return sessionId; >> } >> public void setSessionId(String sessionId) { >> this.sessionId = sessionId; >> } >> public String getCreateLogin() { >> return createLogin; >> } >> public void setCreateLogin(String createLogin) { >> this.createLogin = createLogin; >> } >> public String getCreateApp() { >> return createApp; >> } >> public void setCreateApp(String createApp) { >> this.createApp = createApp; >> } >> public java.sql.Date getCreateDate() { >> return createDate; >> } >> public void setCreateDate(java.sql.Date createDate) { >> this.createDate = createDate; >> } >> public java.sql.Time getCreateTime() { >> return createTime; >> } >> public void setCreateTime(java.sql.Time createTime) { >> this.createTime = createTime; >> } >> public String getModifyLogin() { >> return modifyLogin; >> } >> public void setModifyLogin(String modifyLogin) { >> this.modifyLogin = modifyLogin; >> } >> public String getModifyApp() { >> return modifyApp; >> } >> public void setModifyApp(String modifyApp) { >> this.modifyApp = modifyApp; >> } >> public java.sql.Date getModifyDate() { >> return modifyDate; >> } >> public void setModifyDate(java.sql.Date modifyDate) { >> this.modifyDate = modifyDate; >> } >> public java.sql.Time getModifyTime() { >> return modifyTime; >> } >> public void setModifyTime(java.sql.Time modifyTime) { >> this.modifyTime = modifyTime; >> } >> >> @ManyToOne >> @JoinColumn(name="materialType_fk") >> public MaterialType getMaterialType() { >> return materialType; >> } >> >> public void setMaterialType(MaterialType materialType) { >> this.materialType = materialType; >> } >> } >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> On Sat, Apr 12, 2008 at 3:25 AM, David Jencks >> wrote: >> > Hi CG, >> > >> > That's not a terribly informative error message :-). It looks to me >> as if >> > the cmp entity bean support is not properly configured. >> > Does your application have any CMP 2.1 Entity beans? >> > What geronimo version are you using? >> > >> > If your application does not have any CMP2.1 entity beans and you are >> using >> > a geronimo version before 2.1 please upgrade. There was a bug in some >> > versions that installed the cmp support even if you didn't have any >> cmp >> > beans. I think this was fixed by G 2.1. >> > >> > If you do have cmp 2.1 entity beans you should (1) upgrade to jpa or >> if >> > that is not possible (2) show us your openejb-jar.xml. >> > >> > If you are not using cmp 2.1 entity beans and are already using G 2.1 >> > please let us know.... we should check this is not a problem for G >> 2.1.1 >> > >> > thanks >> > david jencks >> > >> > >> > On Apr 11, 2008, at 11:49 AM, CG wrote: >> > >> > >> > > Hi all, >> > > >> > > >> > > >> > > I have solved a few remaining problem in JNDI lookup which occur >> after >> > that. >> > > >> > > And I manage to get a initialcontext and manage to lookup an EJB , >> > > however, the program throw exception when I try to call EJB function >> > > using the returned reference of EJB. >> > > >> > > Already search google but can't get useful info ... >> > > My EJB fundamental concept is not strong , find hard to understand >> the >> > > error message , therefore , hope to get some hints at here >> > > THanks >> > > >> > > CG >> > > >> > > >> > > OK context = new InitialContext(props); >> > > seems OK beanRemote = (MaterialTestBeanRemote) >> > > context.lookup(MaterialTestBean.RemoteJNDIName); >> > > if(beanRemote!=null) >> > > { >> > > problem beanRemote.testMaterial(); >> > > beanRemote.testMaterialType(); >> > > //beanRemote.testRelation(); >> > > } >> > > >> > > >> > > >> > > Error msg >> > > Exception in thread "main" javax.ejb.EJBException: The bean >> > > encountered a non-application exception.; nested exception is: >> > > >> > > org.apache.openjpa.persistence.PersistenceException: null >> > > at >> > >> org.apache.openejb.client.EJBInvocationHandler.convertException(EJBInvocationHandler.java:210) >> > > at >> > >> org.apache.openejb.client.EJBObjectHandler._invoke(EJBObjectHandler.java:157) >> > > at >> > >> org.apache.openejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:116) >> > > at >> > >> org.apache.openejb.client.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:52) >> > > at $Proxy0.testMaterialType(Unknown Source) >> > > at >> > >> test.com.quesofttech.FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:52) >> > > Caused by: >> > > org.apache.openjpa.persistence.PersistenceException: null >> > > at >> > >> org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:234) >> > > at >> > >> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:709) >> > > at >> > >> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDataSource(JDBCConfigurationImpl.java:809) >> > > at >> > >> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setContext(JDBCStoreManager.java:120) >> > > at >> > >> org.apache.openjpa.kernel.DelegatingStoreManager.setContext(DelegatingStoreManager.java:78) >> > > at >> > org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:285) >> > > at >> > >> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:187) >> > > at >> > >> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142) >> > > at >> > >> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192) >> > > at >> > >> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56) >> > > at >> > >> org.apache.geronimo.persistence.CMPEntityManagerTxScoped.createEntityManager(CMPEntityManagerTxScoped.java:74) >> > > at >> > >> org.apache.geronimo.persistence.CMPEntityManagerTxScoped.getEntityManager(CMPEntityManagerTxScoped.java:55) >> > > at >> > >> org.apache.geronimo.persistence.CMPEntityManagerTxScoped.persist(CMPEntityManagerTxScoped.java:81) >> > > at >> > >> com.quesofttech.session.MaterialTestBean.testMaterialType(MaterialTestBean.java:63) >> > > 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:597) >> > > at >> > >> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:146) >> > > at >> > >> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:129) >> > > at >> > >> org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67) >> > > at >> > >> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:210) >> > > at >> > >> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188) >> > > at >> > >> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165) >> > > at >> > >> org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:214) >> > > at >> > >> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:121) >> > > at >> > >> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164) >> > > at >> > org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122) >> > > at >> > org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84) >> > > at >> > org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60) >> > > at >> > org.apache.openejb.server.ServiceLogger.service(ServiceLogger.java:76) >> > > at >> > >> org.apache.openejb.server.ServiceAccessController.service(ServiceAccessController.java:55) >> > > at >> > org.apache.openejb.server.ServiceDaemon$1.run(ServiceDaemon.java:118) >> > > at java.lang.Thread.run(Thread.java:619) >> > > Caused by: java.lang.Exception: java.lang.NullPointerException >> > > at >> > >> org.apache.openjpa.util.Exceptions.replaceNestedThrowables(Exceptions.java:242) >> > > at >> > >> org.apache.openjpa.persistence.PersistenceException.writeObject(PersistenceException.java:100) >> > > 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:597) >> > > at >> > >> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) >> > > at >> > >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461) >> > > at >> > >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) >> > > at >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) >> > > at >> > >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) >> > > at >> > >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) >> > > at >> > >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) >> > > at >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) >> > > at >> > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) >> > > at >> > >> org.apache.openejb.client.ThrowableArtifact.writeExternal(ThrowableArtifact.java:49) >> > > at >> > >> java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421) >> > > at >> > >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390) >> > > at >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) >> > > at >> > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) >> > > at >> > >> org.apache.openejb.client.EJBResponse.writeExternal(EJBResponse.java:111) >> > > at >> > >> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:197) >> > > ... 8 more >> > > >> > > >> > > >> > >> > > ----- B Amigo:super: -- View this message in context: http://www.nabble.com/problem-JNDI-lookup-in-geronimo-tp16525445s134p21345528.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.