[OFBiz] Users - OFBIZ 300 and stand alone Tomcat559 -- It almost works !

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

[OFBiz] Users - OFBIZ 300 and stand alone Tomcat559 -- It almost works !

Fladd !!!
Hi, i'm novice in ofbiz, so i need somebody more qualified take a look
at my problems.

Situation:
        1) Windows/Linux + Tomcat5.5.9 + ofbiz-3.0.0;
        2) I HAVE to use ofbiz with stand alone tomcat;
        3) Another application which works also under that tomcat should
           interract with ofbiz (as a matter of fact ofbiz should be used as
          part of this application).

Couple days i spent trying to make ofbiz working in described way. My steps:
        1) *.jar were copied into tomcat/shared/lib
       2) *.xml;*.properties were copied into tomcat/shared/classes
           -- this is first problem many files have same names so copying all
     of them simply in tomcat/shared/classes is probably wrong but when
         i copy them with directory structure UtilURL.fromOfbizHomePath()
         fails to find them...
        3) entityengine.xml already contains section:
            <transaction-factory class="org.ofbiz.entity.transaction.JNDIFactory">
        <user-transaction-jndi
                                jndi-server-name="default"
                                jndi-name="java:comp/UserTransaction"/>
                <transaction-manager-jndi
                                jndi-server-name="default"
                                jndi-name="java:comp/UserTransaction"/>
            </transaction-factory>
       
          instead    
       
            <transaction-factory class="org.ofbiz.entity.transaction.JotmFactory"/>
        4) Into server.xml following lines were added:
           <Context>
                  <Resource name="UserTransaction"
                                auth="Container"
                                type="javax.transaction.UserTransaction"/>
                      <ResourceParams name="UserTransaction">
                      <parameter>
        <name>factory</name>
                <value>
                                org.ofbiz.entity.transaction.TransactionFactory
                         </value>
                   </parameter>
                  </ResourceParams>
           </Context>
        5) OFBIZ_HOME was set to directory where startofbiz.bat, components... (in short
           root directory of ofbiz)
        6) All components were builded into war's and copied into tomcat/webapps
        7) Code modifications:
           :: ComponentContainer:
     -----------------------
           if (classPath == null) {
               classPath = new Classpath(System.getProperty("java.class.path"));
           }
            -----------------------
           :: JNDIFactory:
            -----------------------
           // InitialContext ic = JNDIContextFactory.getInitialContext(jndiServerName);
           // With original version namingexception were thrown
           InitialContext ic = new InitialContext();
           if (ic != null) {
               transactionManager = (TransactionManager) ic.lookup(jndiName);
           }
            -----------------------
           :: Start is activated now from InitServlet and
             jetty section was commented in the fbiz-containers.xml
 
My achivements:
        Server had started without errors, when i tried to requst accounting
login form was shown, but when i try to login the system works (it seems to me)
but works very, verY, veRY, vERY, VERY SLOWLY. I tried to debug it: JobPoller
recieves some tasks and activates them ... in short i see infinit
connection opeening (minerva and dbcp fail jdbc -- success) and data base
selects, commits and so on. In logs -- nothing,
in server output -- see log. SO HELP ME!!

---------------------------------------------------
        at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:29)
        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:346)
        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:330)
        at org.ofbiz.entity.datasource.GenericDAO.singleUpdate(GenericDAO.java:64)
        at org.ofbiz.entity.datasource.GenericDAO.customUpdate(GenericDAO.java:12)
        at org.ofbiz.entity.datasource.GenericDAO.update(GenericDAO.java:206)
        at org.ofbiz.entity.datasource.GenericHelperDAO.store(GenericHelperDAO.ava:218)
        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1522)
        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1502)
        at org.ofbiz.entity.GenericValue.store(GenericValue.java:90)
        at org.ofbiz.service.job.PersistedServiceJob.<init>(PersistedServiceJobjava:85)
        at org.ofbiz.service.job.JobManager.poll(JobManager.java:165)
        at org.ofbiz.service.job.JobPoller.run(JobPoller.java:96)
        at java.lang.Thread.run(Thread.java:595)
1726839[  ConnectionFactory.java:74 :ERROR] There was an error getting a DBCP dtasource.java.lang.NullPointerException
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknownource)
        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSurce.java:110)
        at org.ofbiz.entity.transaction.DBCPConnectionFactory.getConnection(DBCConnectionFactory.java:61)
        at org.ofbiz.entity.jdbc.ConnectionFactory.tryGenericConnectionSources(onnectionFactory.java:71)
        at org.ofbiz.entity.transaction.JNDIFactory.getConnection(JNDIFactory.jva:161)
        at org.ofbiz.entity.transaction.TransactionFactory.getConnection(TransationFactory.java:103)
        at org.ofbiz.entity.jdbc.ConnectionFactory.getConnection(ConnectionFactry.java:53)
        at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:29)
        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:346)
        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:330)
        at org.ofbiz.entity.datasource.GenericDAO.singleUpdate(GenericDAO.java:64)
        at org.ofbiz.entity.datasource.GenericDAO.customUpdate(GenericDAO.java:12)
        at org.ofbiz.entity.datasource.GenericDAO.update(GenericDAO.java:206)
        at org.ofbiz.entity.datasource.GenericHelperDAO.store(GenericHelperDAO.ava:218)
        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1522)
        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1502)
        at org.ofbiz.entity.GenericValue.store(GenericValue.java:90)
        at org.ofbiz.service.job.PersistedServiceJob.<init>(PersistedServiceJobjava:85)
        at org.ofbiz.service.job.JobManager.poll(JobManager.java:165)
        at org.ofbiz.service.job.JobPoller.run(JobPoller.java:96)
        at java.lang.Thread.run(Thread.java:595)
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: [OFBiz] Users - OFBIZ 300 and stand alone Tomcat559 -- It almost works !

Andrew Sykes
Fladd,

I know this doesn't exactly answer your question, but why not use a more
recent OFBiz...

Which would use Tomcat by default.

Then you could import your other app into the OFBiz tomcat - I'm
assuming you know this other app much better, so no doubt it would make
your life quite a bit easier.

Kind Regards
--
Andrew Sykes <[hidden email]>
Sykes Development Ltd

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

Re: [OFBiz] Users - OFBIZ 300 and stand alone Tomcat559 -- It almost works !

Ray Barlow
In reply to this post by Fladd !!!
This is not likely the answer you are looking for but may still be worth
considering and it may prompt others to share their experience of these
configurations.

OFBiz has lots of files and jars that need to be on the classpath and
replicating that manually into a standard alone instance of Tomcat, or
any other webserver, is not a small job and carries a high risk of
problems. Another approach that may be more workable is to deploy your
additional non-OFBiz application in the OFBiz instance of Tomcat.
Personally I've not used/tested this and I am only working on the shady
memory of a past post that this is possible so you need to check that
out, on top of that it may also only be in more recent versions than 3.0.0.

Ray

Fladd !!! wrote:

>Hi, i'm novice in ofbiz, so i need somebody more qualified take a look
>at my problems.
>
>Situation:
> 1) Windows/Linux + Tomcat5.5.9 + ofbiz-3.0.0;
> 2) I HAVE to use ofbiz with stand alone tomcat;
> 3) Another application which works also under that tomcat should
>   interract with ofbiz (as a matter of fact ofbiz should be used as
>          part of this application).
>
>Couple days i spent trying to make ofbiz working in described way. My steps:
> 1) *.jar were copied into tomcat/shared/lib
>       2) *.xml;*.properties were copied into tomcat/shared/classes
>   -- this is first problem many files have same names so copying all
>    of them simply in tomcat/shared/classes is probably wrong but when
>         i copy them with directory structure UtilURL.fromOfbizHomePath()
>         fails to find them...
> 3) entityengine.xml already contains section:
>    <transaction-factory class="org.ofbiz.entity.transaction.JNDIFactory">
>       <user-transaction-jndi
> jndi-server-name="default"
> jndi-name="java:comp/UserTransaction"/>
>        <transaction-manager-jndi
> jndi-server-name="default"
> jndi-name="java:comp/UserTransaction"/>
>    </transaction-factory>
>
>  instead    
>
>    <transaction-factory class="org.ofbiz.entity.transaction.JotmFactory"/>
> 4) Into server.xml following lines were added:
>   <Context>
>  <Resource name="UserTransaction"
> auth="Container"
> type="javax.transaction.UserTransaction"/>
>      <ResourceParams name="UserTransaction">
>      <parameter>
>       <name>factory</name>
>       <value>
> org.ofbiz.entity.transaction.TransactionFactory
> </value>
>            </parameter>
>  </ResourceParams>
>   </Context>
> 5) OFBIZ_HOME was set to directory where startofbiz.bat, components... (in short
>   root directory of ofbiz)
> 6) All components were builded into war's and copied into tomcat/webapps
> 7) Code modifications:
>   :: ComponentContainer:
>    -----------------------
>           if (classPath == null) {
>               classPath = new Classpath(System.getProperty("java.class.path"));
>           }
>    -----------------------
>   :: JNDIFactory:
>    -----------------------
>           // InitialContext ic = JNDIContextFactory.getInitialContext(jndiServerName);
>           // With original version namingexception were thrown
>           InitialContext ic = new InitialContext();
>           if (ic != null) {
>               transactionManager = (TransactionManager) ic.lookup(jndiName);
>           }
>    -----------------------
>   :: Start is activated now from InitServlet and
>             jetty section was commented in the fbiz-containers.xml
>
>My achivements:
> Server had started without errors, when i tried to requst accounting
>login form was shown, but when i try to login the system works (it seems to me)
>but works very, verY, veRY, vERY, VERY SLOWLY. I tried to debug it: JobPoller
>recieves some tasks and activates them ... in short i see infinit
>connection opeening (minerva and dbcp fail jdbc -- success) and data base
>selects, commits and so on. In logs -- nothing,
>in server output -- see log. SO HELP ME!!
>
>---------------------------------------------------
>        at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:29)
>        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:346)
>        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:330)
>        at org.ofbiz.entity.datasource.GenericDAO.singleUpdate(GenericDAO.java:64)
>        at org.ofbiz.entity.datasource.GenericDAO.customUpdate(GenericDAO.java:12)
>        at org.ofbiz.entity.datasource.GenericDAO.update(GenericDAO.java:206)
>        at org.ofbiz.entity.datasource.GenericHelperDAO.store(GenericHelperDAO.ava:218)
>        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1522)
>        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1502)
>        at org.ofbiz.entity.GenericValue.store(GenericValue.java:90)
>        at org.ofbiz.service.job.PersistedServiceJob.<init>(PersistedServiceJobjava:85)
>        at org.ofbiz.service.job.JobManager.poll(JobManager.java:165)
>        at org.ofbiz.service.job.JobPoller.run(JobPoller.java:96)
>        at java.lang.Thread.run(Thread.java:595)
>1726839[  ConnectionFactory.java:74 :ERROR] There was an error getting a DBCP dtasource.java.lang.NullPointerException
>        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknownource)
>        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSurce.java:110)
>        at org.ofbiz.entity.transaction.DBCPConnectionFactory.getConnection(DBCConnectionFactory.java:61)
>        at org.ofbiz.entity.jdbc.ConnectionFactory.tryGenericConnectionSources(onnectionFactory.java:71)
>        at org.ofbiz.entity.transaction.JNDIFactory.getConnection(JNDIFactory.jva:161)
>        at org.ofbiz.entity.transaction.TransactionFactory.getConnection(TransationFactory.java:103)
>        at org.ofbiz.entity.jdbc.ConnectionFactory.getConnection(ConnectionFactry.java:53)
>        at org.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:29)
>        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:346)
>        at org.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.jav:330)
>        at org.ofbiz.entity.datasource.GenericDAO.singleUpdate(GenericDAO.java:64)
>        at org.ofbiz.entity.datasource.GenericDAO.customUpdate(GenericDAO.java:12)
>        at org.ofbiz.entity.datasource.GenericDAO.update(GenericDAO.java:206)
>        at org.ofbiz.entity.datasource.GenericHelperDAO.store(GenericHelperDAO.ava:218)
>        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1522)
>        at org.ofbiz.entity.GenericDelegator.store(GenericDelegator.java:1502)
>        at org.ofbiz.entity.GenericValue.store(GenericValue.java:90)
>        at org.ofbiz.service.job.PersistedServiceJob.<init>(PersistedServiceJobjava:85)
>        at org.ofbiz.service.job.JobManager.poll(JobManager.java:165)
>        at org.ofbiz.service.job.JobPoller.run(JobPoller.java:96)
>        at java.lang.Thread.run(Thread.java:595)
>
>_______________________________________________
>Users mailing list
>[hidden email]
>http://lists.ofbiz.org/mailman/listinfo/users
>
>  
>
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users