Compiere - switching servers in Eclipse

For those who got the Open Source fever, sharing only makes you hot!

Moderator: neilg

Compiere - switching servers in Eclipse

Postby neilg » Mon Jun 20, 2005 1:09 am

How do I develop an app in Eclipse, and dynamically switch between servers (e.g. dev and production)?

I found it is a bit too tricky and risky to rely on the switch servers dialog in Compiere (the one on the first login screen) and also it is a hassle.

First on your machine create a directory structure as follows:

somedir/properties/active
somedir/properties/company1
somedir/properties/company2

Find the Compiere.properties you are pointing to when you start Compiere from Eclipse (e.g. /home/somedir/Compiere.properties). You should remove or rename this file to make sure you get a clean copy.

Then run Compiere login to company1.

You should get a screen asking you to agree to the license agreement. If not - you're in the wrong company. Start again, find the Compiere.properties and remove it.

After you've logged in it will create a Compiere.properties file.

Copy the Compiere.properties to somedir/properties/company1

Then run Compiere login to company2.

You should get a screen asking you to agree to the license agreement. If not - you're in the wrong company. Start again, find the Compiere.properties and remove it.

After you've logged in it will create a Compiere.properties file.

Copy the Compiere.properties to somedir/properties/company2

(Make double sure you are in the correct company above - there is an old bug in Compiere which didn't switch companies well. This potentially dangerous problem is avoided by removing the existing Compiere.properties every time).

In the 'run' dialog in Eclipse, switch to 'arguments' and under vm arguments paste the following code:


Code: Select all
-Dlog4j.ignoreTCL=true -DPropertyFile=somedir/properties/active/Compiere.properties -DCOMPIERE_HOME=somedir/properties/active


Whenever you need to change companies, simply copy the Compiere.properties from either company1 or company2 to the directory 'active' as mentioned at the beginning of this post.
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm

Postby trifon » Tue Jun 21, 2005 4:35 pm

Hi neilq,

thank you for this information.
Just one questoin, isn't it possible to create two "Run" configirations in Eclipse and just start one of two insead of always copying one of the properties file to "active" directory?

Regards,
Trifon
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby neilg » Wed Jun 22, 2005 12:59 am

trifon wrote:Just one questoin, isn't it possible to create two "Run" configirations in Eclipse and just start one of two insead of always copying one of the properties file to "active" directory?


Trifon,
Of course you are correct and I think I will also use that way sometimes (e.g. for the main Compiere launch), now that you mention it.

So there will be a Compiere_Live and a Compiere_Dev.

I think the original approach I posted is also useful for if like me you sometimes test your individual classes without starting Compiere (with a main method)? (Starting the main Compiere takes time.....)

I mean that I have many different launch configurations so I can change all of them in one go with the approach detailed above.
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm


Return to Contributor's Corner

Who is online

Users browsing this forum: No registered users and 1 guest