Re: Bind Datasource to specific jndi name

2008-09-16 Thread David Blevins


On Sep 16, 2008, at 3:42 AM, Andreas Karalus wrote:



Hi David,

thank you for your hint, I tried this, but still got exception:
In the code for intialisation of openejb:

initialContext.bind("java:operativDS", new
javax.naming.LinkRef("java:openejb/Resource/operativDS"));


In the test Code:
// this is ok
DataSource operativDS = (DataSource)
initialContext.lookup("java:openejb/operativDS");

// this one fails, but this is the lookup I need
DataSource operativDS = (DataSource)
initialContext.lookup("java:/operativDS");


So is there a possibility to bind directly to java: and not to  
java:openejb?

It seems to me like java:openejb is kind of hardcoded?


Right, internally we depend on things being at a known place  
(java:openejb).  We could bind things to additional places but we will  
still need to maintain the java:openejb namespace. The use of LinkRef  
should allow you to have all the extra JNDI names you need, we just  
need to figure out what might be happening.


Is it possible you can post the complete initialization stacktrace as  
long as some sample code that shows how you are constructing the  
InitialContext you are using to do the binding/lookup?


-David





Re: Active MQ 5.1 support

2008-09-16 Thread rde8026

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

2008-09-16 Thread David Blevins


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




Re: Active MQ 5.1 support

2008-09-16 Thread Jean-Louis MONTEIRO

As far as I can see, a refactoring has been done in ActiveMQ. That's why you
have this exception.

Regards,
Jean-Louis


rde8026 wrote:
> 
> Hey David,
> 
> I followed the instructions below and ran into the following exception:
> 
> org.apache.openejb.OpenEJBException: OpenEJB has encountered a fatal error
> and cannot be started: The Assembler encountered an unexpected error while
> attempting to build the container system.:
> org/apache/activemq/broker/BrokerFactory$BrokerFactoryHandler
> at org.apache.openejb.OpenEJB$Instance.(OpenEJB.java:156)
> at org.apache.openejb.OpenEJB.init(OpenEJB.java:291)
> at org.apache.openejb.server.Server.init(Server.java:63)
> at org.apache.openejb.server.Main.initServer(Main.java:155)
> at org.apache.openejb.server.Main.main(Main.java:128)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.apache.openejb.cli.MainImpl.main(MainImpl.java:151)
> at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> Caused by: java.lang.NoClassDefFoundError:
> org/apache/activemq/broker/BrokerFactory$BrokerFactoryHandler
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$000(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> at
> org.apache.openejb.resource.activemq.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java:128)
> at
> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:980)
> at
> org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:337)
> at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:265)
> at org.apache.openejb.OpenEJB$Instance.(OpenEJB.java:149)
> ... 10 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.activemq.broker.BrokerFactory$BrokerFactoryHandler
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> ... 27 more
> 
> After inspection of the activemq-core-5.1.0.jar there is no
> BrokerFactory$BrokerFactoryHandler class.  Anyway; not sure if there is
> anything I'm missing but thought I'd let you know.
> 
> Also; I've removed the backport-util-concurrent-2.1.jar.
> 
> Any advice would be appreciated.
> 
> 
> 
> 
> 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

Re: Active MQ 5.1 support

2008-09-16 Thread rde8026

Hey David,

I followed the instructions below and ran into the following exception:

org.apache.openejb.OpenEJBException: OpenEJB has encountered a fatal error
and cannot be started: The Assembler encountered an unexpected error while
attempting to build the container system.:
org/apache/activemq/broker/BrokerFactory$BrokerFactoryHandler
at org.apache.openejb.OpenEJB$Instance.(OpenEJB.java:156)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:291)
at org.apache.openejb.server.Server.init(Server.java:63)
at org.apache.openejb.server.Main.initServer(Main.java:155)
at org.apache.openejb.server.Main.main(Main.java:128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.openejb.cli.MainImpl.main(MainImpl.java:151)
at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
Caused by: java.lang.NoClassDefFoundError:
org/apache/activemq/broker/BrokerFactory$BrokerFactoryHandler
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java:128)
at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:980)
at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:337)
at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:265)
at org.apache.openejb.OpenEJB$Instance.(OpenEJB.java:149)
... 10 more
Caused by: java.lang.ClassNotFoundException:
org.apache.activemq.broker.BrokerFactory$BrokerFactoryHandler
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 27 more

After inspection of the activemq-core-5.1.0.jar there is no
BrokerFactory$BrokerFactoryHandler class.  Anyway; not sure if there is
anything I'm missing but thought I'd let you know.

Also; I've removed the backport-util-concurrent-2.1.jar.

Any advice would be appreciated.




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://

Re: Active MQ 5.1 support

2008-09-16 Thread Jean-Louis MONTEIRO

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

Do you agree ?

Jean-Louis



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-tp19400471p19512302.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: Bind Datasource to specific jndi name

2008-09-16 Thread Andreas Karalus

Hi David,

thank you for your hint, I tried this, but still got exception:
In the code for intialisation of openejb:

initialContext.bind("java:operativDS", new 
javax.naming.LinkRef("java:openejb/Resource/operativDS"));


In the test Code: 
// this is ok
DataSource operativDS = (DataSource)
initialContext.lookup("java:openejb/operativDS");

// this one fails, but this is the lookup I need
DataSource operativDS = (DataSource)
initialContext.lookup("java:/operativDS");


So is there a possibility to bind directly to java: and not to java:openejb?
It seems to me like java:openejb is kind of hardcoded? 

Regards,
Andreas



David Blevins wrote:
> 
> 
> On Sep 9, 2008, at 5:53 AM, Andreas Karalus wrote:
> 
>>
>> hello,
>>
>> i've configured a datasource like this
>>
>> 
>>JdbcDriver  oracle.jdbc.driver.OracleDriver
>>JdbcUrl  jdbc:oracle:thin:@localhost:1521:orcl
>>UserNamescott
>>Passwordtiger
>> 
>>
>>
>> is it possible to bind the datasource to a specific jndi name?  
>> especially, I
>> would like to bind the datasource to "java:/operativDS"
> 
> Everything in the config is bound to something that closely matches  
> its path in the openejb.xml file.  So for example:
> 
> 
>
> 
> Is bound to:
> 
>new InitialContext().lookup("java:openejb/Resource/operativDS");
> 
> If you wanted to make it available at a different name, you could  
> easily add the link yourself with some code like this after OpenEJB  
> has been embedded:
> 
>InitialContext context = new InitialContext();
>context.bind("java:operativDS", new  
> javax.naming.LinkRef("java:openejb/Resource/operativDS"));
> 
> -David
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Bind-Datasource-to-specific-jndi-name-tp19391707p19509314.html
Sent from the OpenEJB User mailing list archive at Nabble.com.