You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by saravanan6 <sa...@gmail.com> on 2010/09/17 10:53:02 UTC

how to automatically invoke the java file whenever ofbiz starts?...

Hi to all,


We are using Apache ofbiz9.0 for our application.Now i want to automatically
invoke the java file whenever ofbiz application starts?.

How i do it?  Please give me your tips abt this problem...


I am very much expecting your valuable reply in this regard....


Thanks in Advance

Thanks & Regards,
Saravanan.P

saravanan.ppm@gmail.com






-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/how-to-automatically-invoke-the-java-file-whenever-ofbiz-starts-tp2543570p2543570.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: how to automatically invoke the java file whenever ofbiz starts?...

Posted by saravanan6 <sa...@gmail.com>.
Hi Scott,


                    i followed ur step with my sample pgm like below....


public class startupTest implements org.ofbiz.base.container
{

   startupTest()
   {
         System.out.println("********************************");
	 System.out.println("********************************");
	 System.out.println("********************************");
	 System.out.println("*******Ofbiz Application Started********");
         System.out.println("********************************");
	 System.out.println("********************************");
	 System.out.println("********************************");
   }
}



but it raised exception like ....

                                               package org.ofbiz.base does
not exist.....

acutally the interface container located in
C:\ofbiz-trunk\framework\base\src\org\ofbiz\base\container


plz give me the solution to avoid this exception...



Dont mistake me for asking question like this.coz, i am new to ofbiz....

Saravanan

-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/how-to-automatically-invoke-the-java-file-whenever-ofbiz-starts-tp2543570p2544893.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: how to automatically invoke the java file whenever ofbiz starts?...

Posted by Scott Gray <sc...@hotwaxmedia.com>.
The ofbiz-containers.xml file in /base/
If you create a class that implements org.ofbiz.base.container and register it in the containers file like this:
<container name="my-java-thread-container" class="my.custom.container.MyJavaThreadContainer"/>
then ofbiz will call init(...) and start() on your class during startup and then stop() during shutdown.

The containers are loaded in the order they are listed in the file.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 18/09/2010, at 6:37 PM, saravanan6 wrote:

> 
> Hi scott,
> 
>           Can u tell me abt how to register my java thread class in
> ofbiz-containers.xml?
> 
> Acutually, we have 2 ofbiz containers in the ofbiz folder. which one  i want
> to use?
> 
> Location1 : framework/base/config/ofbiz-container.xml
> Location2 : framework/appserver/config/ofbiz-container.xml
> 
> i am new to ofbiz,,, so, plz explain your thoughts little bit easy ?
> 
> 
> Thanks for your reply and also expecting too
> 
> Thanks & Regards,
> P.SARAVANAN
> 
> -- 
> View this message in context: http://ofbiz.135035.n4.nabble.com/how-to-automatically-invoke-the-java-file-whenever-ofbiz-starts-tp2543570p2544783.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: how to automatically invoke the java file whenever ofbiz starts?...

Posted by saravanan6 <sa...@gmail.com>.
Hi scott,

           Can u tell me abt how to register my java thread class in
ofbiz-containers.xml?

Acutually, we have 2 ofbiz containers in the ofbiz folder. which one  i want
to use?

Location1 : framework/base/config/ofbiz-container.xml
Location2 : framework/appserver/config/ofbiz-container.xml

i am new to ofbiz,,, so, plz explain your thoughts little bit easy ?


Thanks for your reply and also expecting too

Thanks & Regards,
P.SARAVANAN

-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/how-to-automatically-invoke-the-java-file-whenever-ofbiz-starts-tp2543570p2544783.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: how to automatically invoke the java file whenever ofbiz starts?...

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Create a class that implements Container and then register it in ofbiz-containers.xml

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 18/09/2010, at 4:25 PM, saravanan6 wrote:

> 
> hi freeman,
> 
>                    i want to create a thread whenever ofbiz starts?
> 
> so, i want to activate that java file automatically at startup
> 
> 
> Plz give me the solution...
> 
> Saravanan
> 
> -- 
> View this message in context: http://ofbiz.135035.n4.nabble.com/how-to-automatically-invoke-the-java-file-whenever-ofbiz-starts-tp2543570p2544720.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: how to automatically invoke the java file whenever ofbiz starts?...

Posted by BJ Freeman <bj...@free-man.net>.
I suggest you study the framework/base code.
also I don't recommend you take this approach  with out first 
understanding how ofbiz works.
you don't have to get into threads to use ofbiz.

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
saravanan6 sent the following on 9/17/2010 9:25 PM:

>
> hi freeman,
>
>                      i want to create a thread whenever ofbiz starts?
>
> so, i want to activate that java file automatically at startup
>
>
> Plz give me the solution...
>
> Saravanan
>

Re: how to automatically invoke the java file whenever ofbiz starts?...

Posted by saravanan6 <sa...@gmail.com>.
hi freeman,

                    i want to create a thread whenever ofbiz starts?

so, i want to activate that java file automatically at startup


Plz give me the solution...

Saravanan

-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/how-to-automatically-invoke-the-java-file-whenever-ofbiz-starts-tp2543570p2544720.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: how to automatically invoke the java file whenever ofbiz starts?...

Posted by BJ Freeman <bj...@free-man.net>.
can you expand on what you want to do.
we compile java and it does get loaded.
we use groovy for java like code that can modified on the fly so to speak.


saravanan6 sent the following on 9/17/2010 1:53 AM:
>
> Hi to all,
>
>
> We are using Apache ofbiz9.0 for our application.Now i want to automatically
> invoke the java file whenever ofbiz application starts?.
>
> How i do it?  Please give me your tips abt this problem...
>
>
> I am very much expecting your valuable reply in this regard....
>
>
> Thanks in Advance
>
> Thanks&  Regards,
> Saravanan.P
>
> saravanan.ppm@gmail.com
>
>
>
>
>
>