Re: Users - Isolating and Using the Entity Engine

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Users - Isolating and Using the Entity Engine

Brad Plies
Thanks David, that was a great help.  I have a follow-up question
however, are Minerva/JOTM required in this setup I have described?  I
get a few errors that I presume will require some tinkering with
configuration files.

I have an internal dependency on JDK 1.5 which I have found does not
work with JOTM.   I know that Si had a link from someone who claims to
have gotten JOTM to work under 1.5, but I couldn't get them to cooperate
despite the hints.

(org.ofbiz.entity.transaction.JNDIFactory:87)[Thread-1] -
NamingException while finding TransactionManager named
java:comp/UserTransaction in JNDI.
javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
exception is:
    java.net.ConnectException: Connection refused: connect]
    at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
    at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
Caused by: java.rmi.ConnectException: Connection refused to host:
127.0.0.1; nested exception is:
    java.net.ConnectException: Connection refused: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)

So since the fancy container & component loaders aren't being used in
this pilot project, how do you setup an RMI & JNDI service for use by
the entity engine and its required transaction manager?

Brad

> Take a look at the Entity Engine Configuration Guide. You can specify entity model and entity group files right in the entityengine.xml file instead of going through the component file configuration.
>
> -David
>
>
> Brad wrote:
>  
>> > Hi everyone,
>> >
>> > I'm just trying to use the OFBIZ Entity Engine for a pilot project.  I
>> > want to use the engine standalone and embedded within another system.  I
>> > already know to use the ofbiz.jar, ofbiz-base.jar, and ofbiz-entity.jar
>> > and their dependent jars.  My question is, how do you start the entity
>> > engine?
>> >
>> > I know you can use the the org.ofbiz.base.start.Start mechanism, but
>> > this project does not need any of the container and component loading
>> > fanciness.  The project's source file layout also does not lend itself
>> > well to how OFBIZ would like files to be laid out.
>> >
>> > So far I have successfully placed entityengine.xml on the classpath and
>> > gotten the GenericDelegator to find and parse the file.  The next thing
>> > I am trying to figure out though is how to load my entitymodel.xml and
>> > entitygroup.xml files (there is only one of each for this entire project).
>> >
>> > How would that be done?  After familiarizing myself with the source code
>> > for a good long while, I'm thinking that I somehow need to use
>> > org.ofbiz.base.component.ComponentConfig and
>> > org.ofbiz.entity.model.ModelReader.  Am I on the right track?  How do I
>> > get my entity files parsed?  What might some simple sample code look like?
>> >
>> > Thanks,
>> >
>> > Brad
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Isolating and Using the Entity Engine

David E. Jones

You have to have a transaction manager (JTA implementation) in your stuff somewhere to really use the Entity Engine. If you aren't running in an app server you'll need to set one up in your own way, however you want to, and then point OFBiz to it (either through JNDI or some other means). You might want to update and use the Geronimo based stuff as it calls it directly instead of through JNDI.

Either way, this is advanced J2EE stuff and very generic. I'd recommend a good book on JTA/JTS, JNDI, and JDBC. For Entity Engine related stuff, the config guide also has a section about tx mgr setup, and with the foundational knowledge from sources described above (outside of the scope of OFBiz) you should have everything you need.

-David


Brad wrote:

> Thanks David, that was a great help.  I have a follow-up question
> however, are Minerva/JOTM required in this setup I have described?  I
> get a few errors that I presume will require some tinkering with
> configuration files.
>
> I have an internal dependency on JDK 1.5 which I have found does not
> work with JOTM.   I know that Si had a link from someone who claims to
> have gotten JOTM to work under 1.5, but I couldn't get them to cooperate
> despite the hints.
>
> (org.ofbiz.entity.transaction.JNDIFactory:87)[Thread-1] -
> NamingException while finding TransactionManager named
> java:comp/UserTransaction in JNDI.
> javax.naming.ServiceUnavailableException [Root exception is
> java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
> exception is:
>     java.net.ConnectException: Connection refused: connect]
>     at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
>     at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
>     at javax.naming.InitialContext.lookup(Unknown Source)
> Caused by: java.rmi.ConnectException: Connection refused to host:
> 127.0.0.1; nested exception is:
>     java.net.ConnectException: Connection refused: connect
>     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
>     at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
>
> So since the fancy container & component loaders aren't being used in
> this pilot project, how do you setup an RMI & JNDI service for use by
> the entity engine and its required transaction manager?
>
> Brad
>
>> Take a look at the Entity Engine Configuration Guide. You can specify entity model and entity group files right in the entityengine.xml file instead of going through the component file configuration.
>>
>> -David
>>
>>
>> Brad wrote:
>>  
>>>> Hi everyone,
>>>>
>>>> I'm just trying to use the OFBIZ Entity Engine for a pilot project.  I
>>>> want to use the engine standalone and embedded within another system.  I
>>>> already know to use the ofbiz.jar, ofbiz-base.jar, and ofbiz-entity.jar
>>>> and their dependent jars.  My question is, how do you start the entity
>>>> engine?
>>>>
>>>> I know you can use the the org.ofbiz.base.start.Start mechanism, but
>>>> this project does not need any of the container and component loading
>>>> fanciness.  The project's source file layout also does not lend itself
>>>> well to how OFBIZ would like files to be laid out.
>>>>
>>>> So far I have successfully placed entityengine.xml on the classpath and
>>>> gotten the GenericDelegator to find and parse the file.  The next thing
>>>> I am trying to figure out though is how to load my entitymodel.xml and
>>>> entitygroup.xml files (there is only one of each for this entire project).
>>>>
>>>> How would that be done?  After familiarizing myself with the source code
>>>> for a good long while, I'm thinking that I somehow need to use
>>>> org.ofbiz.base.component.ComponentConfig and
>>>> org.ofbiz.entity.model.ModelReader.  Am I on the right track?  How do I
>>>> get my entity files parsed?  What might some simple sample code look like?
>>>>
>>>> Thanks,
>>>>
>>>> Brad
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Isolating and Using the Entity Engine

Jacques Le Roux
Administrator
> Either way, this is advanced J2EE stuff and very generic. I'd recommend a good
book on JTA/JTS, JNDI, and JDBC. For Entity Engine related stuff, the config
guide also has a section about tx mgr setup, and with the foundational knowledge
from sources described above (outside of the scope of OFBiz) you should have
everything you need.
>
> -David

Hi David,

For JTA/JTS, JNDI, JDBC and such, which book would you recommend, please ?

Thanks

Jacques

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Isolating and Using the Entity Engine

David E. Jones


Jacques Le Roux wrote:
> For JTA/JTS, JNDI, JDBC and such, which book would you recommend, please ?


Good question... It's been so long since I studied these that the books I used would be well obsolete by now... I remember Wrox having pretty good books, especially big fat ones for references. Your best bet is to head to a book store or look at the more popular ones on Amazon or something. These are _very_ widely used things and there are lots of good books around with a regular market for them. I guess what I mean to say is that I'm not really the best person to ask...

If anyone with more recent experiences has any feedback, that would be much better.

-David
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Isolating and Using the Entity Engine

Firas A.-2
In reply to this post by Brad Plies

Hi Brad,

Here's, IMO, a more user-friendly set-up guide for running OFBiz under JDK 1.5. It worked  for me, without any complications.

1) Download Carol and JOTM source code.
 
1.1 Compile Carol under JDK5.
 
1.2 Copy $CAROL_SRC/output/dist/lib/ow_carol.jar to $JOTM_SRC/externals.
1.2.1 Compile JOTM under JDK5
 
1.3 Copy these files:
  ow_carol.jar (rename it to carol.jar)
  howl.jar
  jotm.jar
  jotm_iiop_stubs.jar
  jotm_jrmp_stubs.jar
 
from: $JOTM_SRC/output/dist/lib
to: $OFBIZ_HOME/framework/jotm/lib

2)  NOTEThe following change should be made from inside your IDE so you don't miss the source dependencies and exceptions the need to be catched.
 
Modify $OFBIZ_HOME/framework/jotm/src/org/ofbiz/jotm/container/JotmContainer.java.
Replace this code:
org.objectweb.carol.util.configuration.ProtocolConfiguration.init();
// load the defined properties file
org.objectweb.carol.util.configuration.ProtocolConfiguration.loadCarolConfiguration(carolProps);
 
With this one:
URL resource = Thread.currentThread().getContextClassLoader().getResource(carolPropName);
ConfigurationRepository.init( resource);
NameServiceManager.startNS();

3) Modify the iiop.properties in the $OFBIZ_HOME/framework/jotm/config directory
 
# activated protocols
#remove carol.protocols=jrmp,iiop
carol.protocols=jrmp
 
#carol.jrmp.context.factory=com.sun.jndi.rmi.registry.RegistryContextFactory
carol.jrmp.context.factory=org.objectweb.carol.jndi.spi.JRMPContextWrapperFactory
 
#carol.iiop.PortableRemoteObjectClass=com.sun.corba.se.impl.javax.rmi.PortableRemoteObject
carol.iiop.PortableRemoteObjectClass=org.objectweb.carol.rmi.multi.JacORBPRODelegate

# carol.iiop.NameServiceClass=org.objectweb.carol.jndi.ns.IIOPCosNaming
carol.iiop.NameServiceClass=org.objectweb.carol.jndi.ns.JacORBCosNaming
 
#carol.iiop.context.factory=org.objectweb.carol.jndi.iiop.IIOPReferenceContextWrapperFactory
carol.iiop.context.factory=org.objectweb.carol.jndi.iiop.IIOPContextWrapperFactory

OFBiz is now ready to run under JDK 1.5.
 
Hope this'll work for you,
 
</Firas>
 
--------------------------------------------------------- ORIGINAL MESSAGE:
From: Brad <[hidden email]>
Subject: Re: [OFBiz] Users - Isolating and Using the Entity Engine
 
Thanks David, that was a great help. I have a follow-up question however, are Minerva/JOTM required in this setup I have described? I get a few errors that I presume will require some tinkering with configuration files.
I have an internal dependency on JDK 1.5 which I have found does not
work with JOTM. I know that Si had a link from someone who claims to
have gotten JOTM to work under 1.5, but I couldn't get them to cooperate despite the hints.

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Isolating and Using the Entity Engine

BJ Freeman
In reply to this post by David E. Jones
I have used Google to search for material on the web:
like "JNDI BOOKS"
I find the results to be update and usually free.
http://java.sun.com/products/jndi/tutorial/

David E. Jones sent the following on 6/6/06 1:04 AM:

>
> Jacques Le Roux wrote:
>
>>For JTA/JTS, JNDI, JDBC and such, which book would you recommend, please ?
>
>
>
> Good question... It's been so long since I studied these that the books I used would be well obsolete by now... I remember Wrox having pretty good books, especially big fat ones for references. Your best bet is to head to a book store or look at the more popular ones on Amazon or something. These are _very_ widely used things and there are lots of good books around with a regular market for them. I guess what I mean to say is that I'm not really the best person to ask...
>
> If anyone with more recent experiences has any feedback, that would be much better.
>
> -David
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
>
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Isolating and Using the Entity Engine

Jacques Le Roux
Administrator
Thanks BJ,

Will have a look at it.

Jacques

----- Original Message -----
From: "BJ Freeman" <[hidden email]>
To: "OFBiz Users / Usage Discussion" <[hidden email]>
Sent: Tuesday, June 06, 2006 11:40 AM
Subject: Re: [OFBiz] Users - Isolating and Using the Entity Engine


> I have used Google to search for material on the web:
> like "JNDI BOOKS"
> I find the results to be update and usually free.
> http://java.sun.com/products/jndi/tutorial/
>
> David E. Jones sent the following on 6/6/06 1:04 AM:
> >
> > Jacques Le Roux wrote:
> >
> >>For JTA/JTS, JNDI, JDBC and such, which book would you recommend, please ?
> >
> >
> >
> > Good question... It's been so long since I studied these that the books I
used would be well obsolete by now... I remember Wrox having pretty good books,
especially big fat ones for references. Your best bet is to head to a book store
or look at the more popular ones on Amazon or something. These are _very_ widely
used things and there are lots of good books around with a regular market for
them. I guess what I mean to say is that I'm not really the best person to
ask...
> >
> > If anyone with more recent experiences has any feedback, that would be much
better.

> >
> > -David
> >
> > _______________________________________________
> > Users mailing list
> > [hidden email]
> > http://lists.ofbiz.org/mailman/listinfo/users
> >
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users