You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com> on 2013/04/06 16:06:26 UTC
Getting Started TomEE
Hi
Is there any instructions with how to get started with TomEE?
We are migrating from Tomcat 6 the Web Server to TomEE Plus which is the
Application Server.
Do you start the server with startup.bat? As when I start it the Tomcat 7 is
loaded.
When we used Tomcat 6, we had our own custom resources. For example:
<Resource name="git/GitConnectionFactory" auth="Container"
type="com.webchannel.jndi.GitConnection"
factory="com.webchannel.jndi.GitObjectFactory"
gitLocation="C:\git\.git">
</Resource>
How can this be acheived with TomEE? I have seen some examples, but they
fail.
Could you help please?
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-tp4662031.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Declare directly the object as mentionned before.
Le 6 avr. 2013 18:36, "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>
a écrit :
> ok, so if I want to avoid context.xml what are the other options?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662048.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Getting Started TomEE
Posted by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>.
ok, so if I want to avoid context.xml what are the other options?
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662048.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
ObjectFactory have to be defined in context.xml. tomee.xml doesnt define
jndi factories but directly objects
Le 6 avr. 2013 18:24, "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>
a écrit :
> Assuming you had the following code:
>
> package com.jndi;
>
> import java.util.Hashtable;
> import javax.naming.Context;
> import javax.naming.Name;
> import javax.naming.NamingException;
> import javax.naming.RefAddr;
> import javax.naming.Reference;
> import javax.naming.spi.ObjectFactory;
>
> public class GitObjectFactory implements ObjectFactory {
>
> public GitObjectFactory() {
>
> }
>
> public Object getObjectInstance(Object obj, Name name, Context
> nameCtx,
> Hashtable environment) throws NamingException {
> GitConnection gitConnection = new GitConnection();
> // Customize the bean properties from our attributes
> Reference ref = (Reference) obj;
> RefAddr refAddr = ref.get("gitLocation");
> String value = (String) refAddr.getContent();
> gitConnection.setGitLocation(value);
> return gitConnection;
> }
>
> <Resource class-name="GitConnectionFactory">
> gitLocation C:\jGitClone\.git
> </Resource>
>
> In tomee.xml how would you do it?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662046.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Getting Started TomEE
Posted by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>.
Assuming you had the following code:
package com.jndi;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.RefAddr;
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
public class GitObjectFactory implements ObjectFactory {
public GitObjectFactory() {
}
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable environment) throws NamingException {
GitConnection gitConnection = new GitConnection();
// Customize the bean properties from our attributes
Reference ref = (Reference) obj;
RefAddr refAddr = ref.get("gitLocation");
String value = (String) refAddr.getContent();
gitConnection.setGitLocation(value);
return gitConnection;
}
<Resource class-name="GitConnectionFactory">
gitLocation C:\jGitClone\.git
</Resource>
In tomee.xml how would you do it?
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662046.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>.
what do you mean?
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662044.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yes even tomcat context.xml but only on trunk ATM i think
Le 6 avr. 2013 17:46, "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>
a écrit :
> I believe the question should be does TomEE Plus support
> javax.naming.spi.ObjectFactory? How?
>
> If not, what are the options for custom resources? This is not clearly
> explained, and I cannot find anything about this.
>
> Any help would be appreciated.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662040.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Getting Started TomEE
Posted by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>.
I believe the question should be does TomEE Plus support
javax.naming.spi.ObjectFactory? How?
If not, what are the options for custom resources? This is not clearly
explained, and I cannot find anything about this.
Any help would be appreciated.
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662040.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>.
I did something like this in tomee.xml but it gives errors in startup.bat:
<Resource id="GitConnectionFactory"
type="com.webchannel.jndi.GitConnection">
factory com.webchannel.jndi.GitObjectFactory
gitLocation C:\jGitClone\.git
</Resource>
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662038.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>.
It mentions on: Type class could not be found: GitConnectionFactory: Type
class could not be
found: GitConnectionFactory
The API library for this is the lib folder.
Any ideas?
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662043.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
<Resource class-name="qualified name">
Attribute1 = value
OtherAttr=...
<Resource>
Le 6 avr. 2013 17:45, "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>
a écrit :
> Yes, I did read it.
>
> http://tomee.apache.org/containers-and-resources.html
>
> It is not clear for my needs.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662036.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
Re: Getting Started TomEE
Posted by "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>.
Yes, I did read it.
http://tomee.apache.org/containers-and-resources.html
It is not clear for my needs.
--
View this message in context: http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-Plus-and-Custom-Resources-tp4662031p4662036.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: Getting Started TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Did you read about tomee.xml on tomee website?
Le 6 avr. 2013 16:08, "rajiv.jain@netbuilder.com" <ra...@netbuilder.com>
a écrit :
> Hi
>
> Is there any instructions with how to get started with TomEE?
>
> We are migrating from Tomcat 6 the Web Server to TomEE Plus which is the
> Application Server.
>
> Do you start the server with startup.bat? As when I start it the Tomcat 7
> is
> loaded.
>
> When we used Tomcat 6, we had our own custom resources. For example:
>
> <Resource name="git/GitConnectionFactory" auth="Container"
> type="com.webchannel.jndi.GitConnection"
> factory="com.webchannel.jndi.GitObjectFactory"
> gitLocation="C:\git\.git">
> </Resource>
>
> How can this be acheived with TomEE? I have seen some examples, but they
> fail.
>
> Could you help please?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Getting-Started-TomEE-tp4662031.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>