From open-jpa-dev-return-1607-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Tue Jan 09 19:47:42 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 89619 invoked from network); 9 Jan 2007 19:47:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jan 2007 19:47:41 -0000 Received: (qmail 23382 invoked by uid 500); 9 Jan 2007 19:47:48 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 23281 invoked by uid 500); 9 Jan 2007 19:47:48 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 23262 invoked by uid 99); 9 Jan 2007 19:47:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jan 2007 11:47:47 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of mprudhomapache@gmail.com designates 64.233.184.228 as permitted sender) Received: from [64.233.184.228] (HELO wr-out-0506.google.com) (64.233.184.228) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jan 2007 11:47:36 -0800 Received: by wr-out-0506.google.com with SMTP id i20so52854wra for ; Tue, 09 Jan 2007 11:47:15 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=F1HFP5vd++hB49ktF/vUiXX82t/qwu1NwK+gMJaF/Wy1J1rA9hJyJFLfc+PTGXWzCBofN1YEP6GjgE0jilvAUVXZMvgDXYnD8xHxbnqxZpOey3rux5Fo3j33orh0irZMGJyh4C9pA1ukANoSJpv1tL9mIk4f4cTugmyqsm0EA7M= Received: by 10.90.36.9 with SMTP id j9mr9779356agj.1168372034364; Tue, 09 Jan 2007 11:47:14 -0800 (PST) Received: from ?192.168.15.101? ( [66.248.222.34]) by mx.google.com with ESMTP id 6sm49335896wrh.2007.01.09.11.47.12; Tue, 09 Jan 2007 11:47:13 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <951C2A8B-A313-4C24-9040-2107B3D21538@apache.org> <4DDA2018-439E-483E-9264-78BDF6252C92@bea.com> <29D25882-1009-43F9-8058-513D2FB87081@bea.com> <2A61C7D0-88B6-4894-843A-89E684FC7694@apache.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marc Prud'hommeaux Subject: Re: Configuration: either / or ? Date: Tue, 9 Jan 2007 11:46:44 -0800 To: open-jpa-dev@incubator.apache.org X-Mailer: Apple Mail (2.752.3) Sender: Marc Prud'hommeaux X-Virus-Checked: Checked by ClamAV on apache.org Matthieu- We may not be expecting you to just manually set the DataSource. Try setting the "openjpa.ConnectionFactory" property to the DataSource object you are using, and then set "openjpa.ConnectionFactoryName" to some bogus string and see what happens. If there is an error, be sure to post the complete stack trace. On Jan 9, 2007, at 9:11 AM, Matthieu Riou wrote: > If I don't set "openjpa.ConnectionDriverName" (and even if I set " > openjpa.ConnectionFactory" with my datasource instance) I get the > "A JDBC > Driver or DataSource class name must be specified in the > ConnectionDriverName property" error. So I'm getting more and more > confused > as to which properties I should set... > > On 1/8/07, Marc Prud'hommeaux wrote: >> >> Matthieu- >> >> I think you want "openjpa.ConnectionFactory", not >> "openjpa.ConnectionDriverName". >> >> >> >> On Jan 8, 2007, at 9:45 AM, Matthieu Riou wrote: >> >> > Hi, >> > >> > I've just tried your fix after compiling the OpenJPA trunk. I'm >> > getting a >> > ClassCastException as the openjpa.ConnectionDriverName is set as a >> > StringValue. Should I use another property instead? >> > >> > My code: >> > >> > propMap.put("openjpa.jdbc.DBDictionary", " >> > org.apache.openjpa.jdbc.sql.DerbyDictionary"); >> > propMap.put("openjpa.ManagedRuntime", new TxMgrProvider()); >> > propMap.put("openjpa.ConnectionDriverName", _datasource); >> > propMap.put("openjpa.Log", "DefaultLevel=TRACE"); >> > EntityManagerFactory emf = >> > Persistence.createEntityManagerFactory("ode-dao", >> > propMap); >> > EntityManager em = emf.createEntityManager(); >> > >> > The exception: >> > >> > <0|true|0.9.7-incubating-SNAPSHOT> >> > org.apache.openjpa.persistence.PersistenceException: There was an >> > error when >> > invoking the static newInstance method on the named factory class " >> > org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the nested >> > exception >> > for details. >> > at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory( >> > Bootstrap.java:62) >> > at >> > >> org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMa >> n >> > agerFactory >> > (PersistenceProviderImpl.java:70) >> > at >> > >> org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMa >> n >> > agerFactory >> > (PersistenceProviderImpl.java:78) >> > at javax.persistence.Persistence.createEntityManagerFactory( >> > Persistence.java:83) >> > at org.apache.ode.axis2.ODEServerJPA.initJPA >> > (ODEServerJPA.java:345) >> > at org.apache.ode.axis2.ODEServerJPA.init >> (ODEServerJPA.java:96) >> > at org.apache.ode.axis2.hooks.ODEAxisServlet.init( >> > ODEAxisServlet.java:50) >> > at org.apache.catalina.core.StandardWrapper.loadServlet( >> > StandardWrapper.java:1105) >> > at org.apache.catalina.core.StandardWrapper.load( >> > StandardWrapper.java:932) >> > at org.apache.catalina.core.StandardContext.loadOnStartup( >> > StandardContext.java:3917) >> > at org.apache.catalina.core.StandardContext.start( >> > StandardContext.java:4201) >> > at org.apache.catalina.core.ContainerBase.addChildInternal( >> > ContainerBase.java:759) >> > at org.apache.catalina.core.ContainerBase.addChild( >> > ContainerBase.java:739) >> > at org.apache.catalina.core.StandardHost.addChild >> > (StandardHost.java >> > :524) >> > at org.apache.catalina.startup.HostConfig.deployWAR >> > (HostConfig.java >> > :809) >> > at org.apache.catalina.startup.HostConfig.deployWARs >> > (HostConfig.java >> > :698) >> > at org.apache.catalina.startup.HostConfig.deployApps >> > (HostConfig.java >> > :472) >> > at org.apache.catalina.startup.HostConfig.start >> (HostConfig.java >> > :1122) >> > at org.apache.catalina.startup.HostConfig.lifecycleEvent( >> > HostConfig.java:310) >> > at >> > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent( >> > LifecycleSupport.java:119) >> > at org.apache.catalina.core.ContainerBase.start >> > (ContainerBase.java >> > :1021) >> > at org.apache.catalina.core.StandardHost.start >> > (StandardHost.java >> > :718) >> > at org.apache.catalina.core.ContainerBase.start >> > (ContainerBase.java >> > :1013) >> > at org.apache.catalina.core.StandardEngine.start >> > (StandardEngine.java >> > :442) >> > at org.apache.catalina.core.StandardService.start( >> > StandardService.java:450) >> > at org.apache.catalina.core.StandardServer.start >> > (StandardServer.java >> > :709) >> > at org.apache.catalina.startup.Catalina.start(Catalina.java: >> > 551) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >> Method) >> > at sun.reflect.NativeMethodAccessorImpl.invoke( >> > NativeMethodAccessorImpl.java:39) >> > at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> > DelegatingMethodAccessorImpl.java:25) >> > at java.lang.reflect.Method.invoke(Method.java:585) >> > at org.apache.catalina.startup.Bootstrap.start >> > (Bootstrap.java:294) >> > at org.apache.catalina.startup.Bootstrap.main >> (Bootstrap.java: >> > 432) >> > Caused by: org.apache.openjpa.lib.util.ParseException: >> > ConnectionDriverName: >> > org.opentools.minerva.connector.jdbc.JDBCDataSource@dfbb43 >> > at org.apache.openjpa.lib.conf.Value.setObject(Value.java: >> 298) >> > at >> > org.apache.openjpa.lib.conf.ConfigurationImpl.fromProperties( >> > ConfigurationImpl.java:627) >> > at >> > org.apache.openjpa.lib.conf.MapConfigurationProvider.setInto( >> > MapConfigurationProvider.java:82) >> > at >> > org.apache.openjpa.persistence.PersistenceProductDerivation >> > $ConfigurationProviderImpl.setInto >> > (PersistenceProductDerivation.java:406) >> > at >> > org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance( >> > JDBCBrokerFactory.java:56) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >> Method) >> > at sun.reflect.NativeMethodAccessorImpl.invoke( >> > NativeMethodAccessorImpl.java:39) >> > at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> > DelegatingMethodAccessorImpl.java:25) >> > at java.lang.reflect.Method.invoke(Method.java:585) >> > at org.apache.openjpa.kernel.Bootstrap.invokeFactory >> > (Bootstrap.java >> > :117) >> > at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory( >> > Bootstrap.java:57) >> > ... 32 more >> > Caused by: java.lang.ClassCastException: >> > org.opentools.minerva.connector.jdbc.JDBCDataSource >> > at >> org.apache.openjpa.lib.conf.StringValue.setInternalObject( >> > StringValue.java:63) >> > at org.apache.openjpa.lib.conf.Value.setObject(Value.java: >> 294) >> > ... 42 more >> > >> > Thanks! >> > >> > Matthieu >> > >> > On 1/3/07, Abe White wrote: >> >> >> >> SVN revision 492368 no long ignores non-String values for >> openjpa.* >> >> keys in the Map passed to Persistence.createEntityManagerFactory. >> >> >> _____________________________________________________________________ >> >> __ >> >> Notice: This email message, together with any attachments, may >> >> contain >> >> information of BEA Systems, Inc., its subsidiaries and >> >> affiliated >> >> entities, that may be confidential, proprietary, copyrighted >> >> and/or >> >> legally privileged, and is intended solely for the use of the >> >> individual >> >> or entity named in this message. If you are not the intended >> >> recipient, >> >> and have received this message in error, please immediately return >> >> this >> >> by email and then delete it. >> >> >> >>