HELP! JNDI DataSource Name
Hello, I'm sorry to post to message; I've seen a bunch of messages like this posted but everything I've read and tried doesn't seem to work and I have no idea why. I'm trying to get a reference to a Container Managed DataSource (configured in my openejb.xml file). I can get the reference via the @Resource annotation but I am unable to get the resource via standard JNDI. here is my code Object obj1 = new javax.naming.InitialContext().lookup(java:openejb/Resource/JTADS); I've also tried it like this: Properties props = new Properties(); props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, org.apache.openejb.client.LocalInitialContextFactory); javax.naming.Context ctx = new javax.naming.InitialContext(props); Object obj1 = ctx.lookup(java:openejb/Resource/JTADS); I always get this error: NameNotFoundException: Name java:openejb/Resource/JTADS not found. Now the reason I need to understand the correct JNDI name is so I can use it as a Hibernate Property (hibernate.connection.datasource). I'm using openejb 3.1 SNAPSHOT and Hibernate hibernate-3.2.5.ga. Any ideas? I'm totally lost...as I understand it this should just work... Thanks in advance -- View this message in context: http://www.nabble.com/HELP%21-JNDI-DataSource-Name-tp19579867p19579867.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Active MQ 5.1 support
Thanks for all the thought guys! Let me know if/when you think you might be able to support both. It's not crucial but there are some features of 5.1.0 that I'd like to take advantage of if possible. BTW thanks for openEJB; its made my life a lot easier and works really well, IMHO. David Blevins wrote: On Sep 16, 2008, at 6:51 AM, Jean-Louis MONTEIRO wrote: Hi David, From my point of view, it's not possible to switch from 4.1.x to 5.1.x without any change in OpenEJB. In the current openejb-core module, the OpenEjbBrokerFactory implements BrokerFactory.BrokerFactoryHandler but in the ActiveMQ 5.1, this interface is no more an internal class. The new interface is org/apache/activemq/broker/ BrokerFactoryHandler.java Sounds like we might have to figure out some clever way to support both. -David -- View this message in context: http://www.nabble.com/Active-MQ-5.1-support-tp19400471p19519440.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Active MQ 5.1 support
I'm using the standard lib form a zip file... thx, RE David Blevins wrote: On Sep 9, 2008, at 1:25 PM, rde8026 wrote: Is it possible to use active mq 5.1 with the openejb container rather than 4.1? It should be possible, though I'm not sure if anyone has tried. If so what does it take to make this change. Are you in maven or are you using the lib directory of a standalone zip/tar? -David -- View this message in context: http://www.nabble.com/Active-MQ-5.1-support-tp19400471p19502515.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Active MQ 5.1 support
Thanks so much for the update. This is super helpful! I'll give it a try in the next couple of days and let you know how it goes! Thanks again for getting me all the necessary info! David Blevins wrote: On Sep 15, 2008, at 3:45 PM, rde8026 wrote: I'm using the standard lib form a zip file... Ok. In terms of general library upgrading, we generate two files (dependencies.xml and dependencies.txt) that we put inside of every openejb-*.jar that says what dependencies the jar has. The data is nested to show a tree view to make it easier to see what dependencies are pulled in only by third party libraries. Here is the top part of dependencies.txt for openejb-core-3.1- SNAPSHOT.jar: activemq-core-4.1.1.jar activeio-core-3.0.0-incubator.jar backport-util-concurrent-2.1.jar activemq-ra-4.1.1.jar asm-2.2.3.jar asm-commons-2.2.3.jar asm-tree-2.2.3.jar asm-finder-3.1-SNAPSHOT.jar commons-cli-1.1.jar commons-collections-3.2.jar . So you should only need to remove activemq-core-4.1.1.jar, activemq- ra-4.1.1.jar and any libraries they depend on, which are activeio- core-3.0.0-incubator.jar and backport-util-concurrent-2.1.jar. As far as replacing them, you'll definitely need activemq-core-5.1.0.jar and activemq-ra-5.1.0.jar. http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/activemq/activemq-core/5.1.0/activemq-core-5.1.0.jar http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/activemq/activemq-ra/5.1.0/activemq-ra-5.1.0.jar .. plus their non-optional depenencies. The activemq-core-5.1.0.pom shows these required deps (versions are in activemq-parent-5.1.0.pom). http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/activemq/activeio-core/3.1.0/activeio-core-3.1.0.jar http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/camel/camel-core/1.3.0/camel-core-1.3.0.jar The activeio-core pom lists backport-util-concurrent as a dependency, but I couldn't find any use of it in their source. I'd try getting by without it. Definitely let us know how it goes. -David -- View this message in context: http://www.nabble.com/Active-MQ-5.1-support-tp19400471p19504173.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Active MQ 5.1 support
Is it possible to use active mq 5.1 with the open ejb container rather than 4.1? If so what does it take to make this change. Thanks in advance. -- View this message in context: http://www.nabble.com/Active-MQ-5.1-support-tp19400471p19400471.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Use JAXB generated class as JAX-WS request parameter
No worries; actually its my fault for not updating the question since I was able to fix this myself. It ended up being a namespace issues with JAXB. Since my XSD didn't have a targetNamespace it seems that was causing some issue in passing the object back to the MDB. Anyway; thanks for getting back to me! David Blevins wrote: On Aug 18, 2008, at 6:45 AM, rde8026 wrote: I'm running into an issue when trying to use a JAXB generated class as input into my @WebMethod. Basically I have an XSD that is generated via JAXB and I want to use that generated class as the input parameter into my JAX-WS web service. I know JAX-WS uses JAXB to generate the necessary objects for the request and response parameters. My question is basically does anyone know if this is possible or do I need to generate some POJO to assign as the request object and let JAX-WS do it's thing then map that bean to the existing JAXB class I have generated? Not too sure. Cc'ing the CXF list as hopefully Dan and company will have a better idea. Let's hope they're a little quicker at responding than I was -- sorry for the delay on such a simple response. -David -- View this message in context: http://www.nabble.com/Use-JAXB-generated-class-as-JAX-WS-request-parameter-tp19032084p19081266.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Use JAXB generated class as JAX-WS request parameter
I'm running into an issue when trying to use a JAXB generated class as input into my @WebMethod. Basically I have an XSD that is generated via JAXB and I want to use that generated class as the input parameter into my JAX-WS web service. I know JAX-WS uses JAXB to generate the necessary objects for the request and response parameters. My question is basically does anyone know if this is possible or do I need to generate some POJO to assign as the request object and let JAX-WS do it's thing then map that bean to the existing JAXB class I have generated? Any input would be appreciated. -- View this message in context: http://www.nabble.com/Use-JAXB-generated-class-as-JAX-WS-request-parameter-tp19032084p19032084.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Configure OpenEJB Container to use external activemq.xml file
Hi Dain, Looks like you got it! Thanks so much for the effort. When should we expect this in a final release? Thx, RE Dain Sundstrom wrote: I think I have fixed this. We modify the brokerURL to handle the persistence setup, but we don't need to perform these modifications when using an external activemq.xml file. So, I simply wrapped this code with an if brokerUrl.startsWith(broker:). The fix is checked into trunk, and I uploaded a build here: http://people.apache.org/~dain/openejb-3.1-r685019.zip Let me know if this works for you, -dain On Aug 11, 2008, at 6:41 AM, rde8026 wrote: Any update on this subject? Thx rde8026 wrote: I gave that a go and here is the error message: org.apache.openejb.OpenEJBException: javax.resource.spi.ResourceAdapterInternalException: Failed to startup an embedded broker: openejb:xbean:(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false , due to: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false]; nested exception is java.io.FileNotFoundException: class path resource [(file:///D:opt/openejb-3.0/lib/] cannot be resolved to URL because it does not exist: Failed to startup an embedded broker: openejb:xbean:(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false , due to: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false]; nested exception is java.io.FileNotFoundException: class path resource [(file:///D:opt/openejb-3.0/lib/] Seems this doesn't want to work! I've attached my activemq.xml file here. Thanks for your help so far - its much appreciated... http://www.nabble.com/file/p18884422/activemq.xml activemq.xml . Thx, RE David Blevins wrote: On Aug 7, 2008, at 6:48 AM, rde8026 wrote: Hi David, Thanks for the reply. I've tried using the fully qualified path and I get the same exception - Failed to startup an embedded broker: openejb:xbean:(D:/opt/openejb-3.0/lib/activemq.xml)? persistent=false, due to: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [(D:/opt/openejb-3.0/lib/activemq.xml)?persistent=false]; nested exception is java.io.FileNotFoundException: class path resource [(D:/opt/openejb-3.0/lib/] cannot be resolved to URL because it does not exist I'm curious do you know if anyone has successfully gotten this to work or is it a bug? Any ideas would be much appreciated. I think I've tried this before, but I could be imagining things. Looking at the exception though, it seems that we might need to make the path a valid URL. Try this one: file:///D:/opt/openejb-3.0/lib/activemq.xml If that doesn't work, post your activemq.xml (or some version of it) and I'll give it a try. If that *does* work, then we can add examples as well as wrap this activemq functionality with something that tries harder to make things work and gives a better error message when they can't. -David David Blevins wrote: On Aug 6, 2008, at 12:47 PM, rde8026 wrote: I've been trying to get the openEJB container to allow me to use an external activemq.xml file for a while now and have been unsuccessful. Below is my resource config Resource id=ActiveMQRA type=ActiveMQResourceAdapter # Broker configuration URI as defined by ActiveMQ # see http://activemq.apache.org/broker-configuration-uri.html #BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false BrokerXmlConfig xbean:activemq.xml # Broker address #ServerUrl vm://localhost?async=true ServerUrl tcp://localhost:61616 # DataSource for persistence messages DataSource MessageDataStore /Resource With the activemq.xml file placed in the lib directory Hmmm... Try using an absolute path to the activemq.xml file and see if that doesn't make activemq happier. Not sure if that will work, but worth a try. -David -- View this message in context: http://www.nabble.com/Configure-OpenEJB-Container-to-use-external-activemq.xml-file-tp18858260p18870919.html Sent from the OpenEJB User mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Configure-OpenEJB-Container-to-use-external-activemq.xml-file-tp18858260p18926099.html Sent from the OpenEJB User mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Configure-OpenEJB-Container-to-use-external-activemq.xml-file-tp18858260p18944521.html Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Configure OpenEJB Container to use external activemq.xml file
Any update on this subject? Thx rde8026 wrote: I gave that a go and here is the error message: org.apache.openejb.OpenEJBException: javax.resource.spi.ResourceAdapterInternalException: Failed to startup an embedded broker: openejb:xbean:(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false, due to: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false]; nested exception is java.io.FileNotFoundException: class path resource [(file:///D:opt/openejb-3.0/lib/] cannot be resolved to URL because it does not exist: Failed to startup an embedded broker: openejb:xbean:(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false, due to: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [(file:///D:opt/openejb-3.0/lib/activemq.xml)?persistent=false]; nested exception is java.io.FileNotFoundException: class path resource [(file:///D:opt/openejb-3.0/lib/] Seems this doesn't want to work! I've attached my activemq.xml file here. Thanks for your help so far - its much appreciated... http://www.nabble.com/file/p18884422/activemq.xml activemq.xml . Thx, RE David Blevins wrote: On Aug 7, 2008, at 6:48 AM, rde8026 wrote: Hi David, Thanks for the reply. I've tried using the fully qualified path and I get the same exception - Failed to startup an embedded broker: openejb:xbean:(D:/opt/openejb-3.0/lib/activemq.xml)? persistent=false, due to: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [(D:/opt/openejb-3.0/lib/activemq.xml)?persistent=false]; nested exception is java.io.FileNotFoundException: class path resource [(D:/opt/openejb-3.0/lib/] cannot be resolved to URL because it does not exist I'm curious do you know if anyone has successfully gotten this to work or is it a bug? Any ideas would be much appreciated. I think I've tried this before, but I could be imagining things. Looking at the exception though, it seems that we might need to make the path a valid URL. Try this one: file:///D:/opt/openejb-3.0/lib/activemq.xml If that doesn't work, post your activemq.xml (or some version of it) and I'll give it a try. If that *does* work, then we can add examples as well as wrap this activemq functionality with something that tries harder to make things work and gives a better error message when they can't. -David David Blevins wrote: On Aug 6, 2008, at 12:47 PM, rde8026 wrote: I've been trying to get the openEJB container to allow me to use an external activemq.xml file for a while now and have been unsuccessful. Below is my resource config Resource id=ActiveMQRA type=ActiveMQResourceAdapter # Broker configuration URI as defined by ActiveMQ # see http://activemq.apache.org/broker-configuration-uri.html #BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false BrokerXmlConfig xbean:activemq.xml # Broker address #ServerUrl vm://localhost?async=true ServerUrl tcp://localhost:61616 # DataSource for persistence messages DataSource MessageDataStore /Resource With the activemq.xml file placed in the lib directory Hmmm... Try using an absolute path to the activemq.xml file and see if that doesn't make activemq happier. Not sure if that will work, but worth a try. -David -- View this message in context: http://www.nabble.com/Configure-OpenEJB-Container-to-use-external-activemq.xml-file-tp18858260p18870919.html Sent from the OpenEJB User mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Configure-OpenEJB-Container-to-use-external-activemq.xml-file-tp18858260p18926099.html Sent from the OpenEJB User mailing list archive at Nabble.com.