aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Bohn <joeb...@gmail.com>
Subject Re: svn commit: r935639 - /incubator/aries/branches/0.1-incubating-RC1/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/PersistenceUnitInfoImpl.java
Date Tue, 20 Apr 2010 13:26:26 GMT
Thanks Brian.  That does the trick and fortunately it appears that I can 
add it into the config.ini so that users won't have to cut/paste  the 
entire content to run the sample.  There certainly are a lot of entries!

Joe


On 4/20/10 8:50 AM, Brian De Pradine wrote:
> Hi Joe,
>
> The mechanism to specify the bootclasspath was removed a while ago in
> favour of the mechanism that David is referring to (this is currently the
> way that the transaction unit tests work). In order to get this mechanism
> to work for the samples you will need to add the following to the command
> line (it is quite long so I suggest creating a script or batch file)
>
> -Dorg.osgi.framework.system.packages=javax.accessibility,javax.activation,javax.activity,javax.annotation,javax.annotation.processing,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.au
t!
>   h.kerberos,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml
.p!
>   arsers,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.TypeCodePackage,org.omg.CORBA.portable,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.PortableServer
.P!
>   OAManagerPackage,org.omg.PortableServer.POAPackage,org.omg.PortableServ!
>   er.ServantLocatorPackage,org.omg.PortableServer.portable,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,javax.transaction;partial=true;mandatory:=partial,javax.transaction.xa;partial=true;mandatory:=partial
>
> Cheers
>
> Brian DePradine
> Web Services Development
> IBM Hursley
> External  +44 (0) 1962 816319         Internal 246319
>
> If you can't find the time to do it right the first time, where will you
> find the time to do it again?
>
>
> Joe Bohn<joebohn@gmail.com>  wrote on 19/04/2010 20:30:06:
>
>> [image removed]
>>
>> Re: svn commit: r935639 - /incubator/aries/branches/0.1-incubating-
>> RC1/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/
>> unit/impl/PersistenceUnitInfoImpl.java
>>
>> Joe Bohn
>>
>> to:
>>
>> aries-dev
>>
>> 19/04/2010 20:30
>>
>> Please respond to aries-dev
>>
>>
>> I didn't have any success specifying bootclasspath when starting equinox
>
>>    ... same linkage error.  I also tried to removing the geronimo-jta
>> spec from the config.ini to eliminate the possibility of it being loaded
>
>> from 2 different classloaders ...  but still the same result.
>>
>> Joe
>>
>>
>>
>> On 4/19/10 1:25 PM, Joe Bohn wrote:
>>>
>>> Thanks David. I was just speaking about this with Jarek as well. So it
>>> seems that the problem is that some transaction classes are loaded
> from
>>> the system bundle. At one time we were including the geronimo-jta spec
>>> jar in the Xbootclasspath when starting equinox to avoid this issue.
> But
>>> then something was changed (don't recall what at the moment) so that
> was
>>> no longer necessary. I'll try adding the spec back to the
> Xbootclasspath
>>> when starting equinox to confirm that resolves the issue. If anybody
>>> recalls what had changed that removed that requirement - and why it no
>>> longer seems to be working - please let me know.
>>>
>>> Joe
>>>
>>> On 4/19/10 1:05 PM, David Jencks wrote:
>>>> Karaf has some goo like
>>>>
>>>> javax.transaction; javax.transaction.xa; version=1.1; partial=true;
>>>> mandatory:=partial, \
>>>>
>>>> about exporting from the system bundle which is supposed to avoid
> some
>>>> linkage problems. Do the samples have the same goo?
>>>>
>>>> thanks
>>>> david jencks
>>>>
>>>> On Apr 19, 2010, at 9:54 AM, Joe Bohn wrote:
>>>>
>>>>> It certainly looks like this fix is necessary (the one to return the
>>>>> JTA_DATASOURCE rather than the NON_JTA_DATASOURCE) - but I want to
>>>>> warn you that it surfaces another problem. I don't know the details
>>>>> of how to fix this yet but we need to get it resolved. This is
>>>>> especially important because it looks like you are getting ready to
>>>>> create a new RC and I think this error will prevent that from
> passing
>>>>> if not resolved:
>>>>>
>>>>> To recreate the error just run Blog for JPA or AriesTrader
> configured
>>>>> for container managed JPA.
>>>>>
>>>>> java.lang.LinkageError: loader constraint violation: when resolving
>>>>> interface method
>>>>> "javax.transaction.Transaction.enlistResource(Ljavax/
>> transaction/xa/XAResource;)Z"
>>>>> the class loader (instance of
>>>>> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the
>>>>> current class, org/apache/aries/transaction/jdbc/ConnectionWrapper,
>>>>> and the class loader (instance of
>>>>> org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for
>>>>> resolved class, javax/transaction/Transaction, have different Class
>>>>> objects for the type javax/transaction/xa/XAResource used in the
>>>>> signature
>>>>> at
>>>>> org.apache.aries.transaction.jdbc.ConnectionWrapper.<init>
>> (ConnectionWrapper.java:67)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.aries.transaction.jdbc.XADatasourceEnlistingWrapper.getEnlistedConnection
>> (XADatasourceEnlistingWrapper.java:85)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.aries.transaction.jdbc.XADatasourceEnlistingWrapper.getConnection
>> (XADatasourceEnlistingWrapper.java:50)
>>>>>
>>>>> at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke
>> (DelegatingMethodAccessorImpl.java:25)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at
>>>>> org.apache.aries.jndi.services.ServiceHelper
>> $JNDIServiceDamper.invoke(ServiceHelper.java:99)
>>>>>
>>>>> at $Proxy13.getConnection(Unknown Source)
>>>>> at
>>>>> org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection
>> (DelegatingDataSource.java:131)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection
>> (DecoratingDataSource.java:106)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary
>> (DBDictionaryFactory.java:91)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance
>> (JDBCConfigurationImpl.java:595)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration
>> (MappingRepository.java:1489)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.lib.conf.Configurations.configureInstance
>> (Configurations.java:507)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.lib.conf.Configurations.configureInstance
>> (Configurations.java:432)
>>>>>
>>>>> at
>>>>>
> org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate
>> (MetaDataRepositoryValue.java:68)
>>>>>
>>>>> at
>>>>>
> org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
>>>>> at
>>>>>
>>
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance
>> (OpenJPAConfigurationImpl.java:939)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance
>> (OpenJPAConfigurationImpl.java:930)
>>>>>
>>>>> at
> org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:343)
>>>>> at
> org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:315)
>>>>> at
>>>>> org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker
>> (AbstractBrokerFactory.java:218)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker
>> (AbstractBrokerFactory.java:202)
>>>>>
>>>>> at
>>>>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker
>> (DelegatingBrokerFactory.java:156)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager
>> (EntityManagerFactoryImpl.java:213)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager
>> (EntityManagerFactoryImpl.java:57)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.aries.jpa.container.context.transaction.impl.JTAPersistenceContextRegistry.getCurrentPersistenceContext
>> (JTAPersistenceContextRegistry.java:122)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getPersistenceContext
>> (JTAEntityManager.java:73)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.persist
>> (JTAEntityManager.java:220)
>>>>>
>>>>> at
>>>>>
>>
> org.apache.aries.samples.ariestrader.persist.jpa.cm.TradeJpaCm.createQuote
>> (TradeJpaCm.java:444)
>>>>>
>>>>> 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.aries.blueprint.proxy.Collaborator$1.invoke
>> (Collaborator.java:66)
>>>>>
>>>>> at
>>>>> org.apache.aries.blueprint.proxy.Collaborator.invoke
>> (Collaborator.java:151)
>>>>>
>>>>> at
>>>>> org.apache.aries.samples.ariestrader.persist.jpa.cm.
>> $TradeJpaCm360369157.createQuote(Unknown
>>>>> Source)
>>>>> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke
>> (DelegatingMethodAccessorImpl.java:25)
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>>>> at
>>>>>
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe
>> $JdkProxyFactory$1.invoke(AbstractServiceReferenceRecipe.java:614)
>>>>>
>>>>> at $Proxy15.createQuote(Unknown Source)
>>>>> at
>>>>> org.apache.aries.samples.ariestrader.web.TradeBuildDB.<init>
>> (TradeBuildDB.java:183)
>>>>>
>>>>> at
>>>>>
>> org.apache.aries.samples.ariestrader.web.TradeConfigServlet.service
>> (TradeConfigServlet.java:418)
>>>>>
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>> at
>>>>>
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>> at
>>>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
>> (ServletHandler.java:1157)
>>>>>
>>>>> at
>>>>> org.ops4j.pax.web.service.internal.WelcomeFilesFilter.doFilter
>> (WelcomeFilesFilter.java:169)
>>>>>
>>>>> at
>>>>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
>> (ServletHandler.java:1148)
>>>>>
>>>>> at
>>>>>
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
>>>>> at
>>>>>
>>
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle
>> (HttpServiceServletHandler.java:64)
>>>>>
>>>>> at
>>>>>
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>>>> at
>>>>>
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>>>>> at
>>>>>
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle
>> (HttpServiceContext.java:111)
>>>>>
>>>>> at
>>>>>
>>
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle
>> (JettyServerHandlerCollection.java:64)
>>>>>
>>>>> at
>>>>>
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>> at org.mortbay.jetty.Server.handle(Server.java:322)
>>>>> at
>>>>>
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>> at
>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
>> (HttpConnection.java:864)
>>>>>
>>>>> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
>>>>> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>>>>> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>>>>> at
>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run
>> (SelectChannelEndPoint.java:409)
>>>>>
>>>>> at
>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run
>> (QueuedThreadPool.java:520)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I discovered this in trunk while attempting to run the AriesTrader
>>>>> sample - but the same is also true of the Blog sample. When we
>>>>> attempt to use declarative transaction support after the change be
>>>>>
>>>>>
>>>>> On 4/19/10 11:59 AM, hughesj@apache.org wrote:
>>>>>> Author: hughesj
>>>>>> Date: Mon Apr 19 15:59:35 2010
>>>>>> New Revision: 935639
>>>>>>
>>>>>> URL: http://svn.apache.org/viewvc?rev=935639&view=rev
>>>>>> Log:
>>>>>> ARIES-287 fix a couple egregious errors in PersistenceUnitInfoImpl
> -
>>>>>> this time in the 0.1-incubating release candidate branch
>>>>>>
>>>>>> Modified:
>>>>>> incubator/aries/branches/0.1-incubating-RC1/jpa/jpa-container/
>> src/main/java/org/apache/aries/jpa/container/unit/impl/
>> PersistenceUnitInfoImpl.java
>>>>>>
>>>>>>
>>>>>> Modified:
>>>>>> incubator/aries/branches/0.1-incubating-RC1/jpa/jpa-container/
>> src/main/java/org/apache/aries/jpa/container/unit/impl/
>> PersistenceUnitInfoImpl.java
>>>>>>
>>>>>> URL:
>>>>>> http://svn.apache.org/viewvc/incubator/aries/branches/0.1-
>> incubating-RC1/jpa/jpa-container/src/main/java/org/apache/aries/jpa/
>> container/unit/impl/PersistenceUnitInfoImpl.java?
>> rev=935639&r1=935638&r2=935639&view=diff
>>>>>>
>>>>>>
>>
> ==============================================================================
>>>>>>
>>>>>> ---
>>>>>> incubator/aries/branches/0.1-incubating-RC1/jpa/jpa-container/
>> src/main/java/org/apache/aries/jpa/container/unit/impl/
>> PersistenceUnitInfoImpl.java
>>>>>> (original)
>>>>>> +++
>>>>>> incubator/aries/branches/0.1-incubating-RC1/jpa/jpa-container/
>> src/main/java/org/apache/aries/jpa/container/unit/impl/
>> PersistenceUnitInfoImpl.java
>>>>>> Mon Apr 19 15:59:35 2010
>>>>>> @@ -80,17 +80,20 @@ public class PersistenceUnitInfoImpl imp
>>>>>> if(jarFiles != null) {
>>>>>> for(String jarFile : jarFiles){
>>>>>> URL url = bundle.getResource(jarFile);
>>>>>> - if(url == null)
>>>>>> + if(url == null) {
>>>>>> _logger.error("The persistence unit {} in bundle {} listed the jar
>>>>>> file {}, but " +
>>>>>> "{} could not be found in the bundle", new
>>>>>> Object[]{getPersistenceUnitName(),
>>>>>> bundle.getSymbolicName() + "_" + bundle.getVersion(), jarFile,
>>>>>> jarFile});
>>>>>> + } else {
>>>>>> + urls.add(url);
>>>>>> + }
>>>>>> }
>>>>>> }
>>>>>> return urls;
>>>>>> }
>>>>>>
>>>>>> public DataSource getJtaDataSource() {
>>>>>> - String jndiString = (String)
>>>>>> unit.getPersistenceXmlMetadata().get
>> (ParsedPersistenceUnit.NON_JTA_DATASOURCE);
>>>>>>
>>>>>> + String jndiString = (String)
>>>>>> unit.getPersistenceXmlMetadata().get
>> (ParsedPersistenceUnit.JTA_DATASOURCE);
>>>>>>
>>>>>> DataSource toReturn = null;
>>>>>> if(jndiString != null) {
>>>>>> try {
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Joe
>>>>
>>>>
>>>
>>>
>>
>>
>> --
>> Joe
>
>
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
>
>
>


-- 
Joe

Mime
View raw message