Commit Graph
122 Commits
Author SHA1 Message Date
Adrian Crum 1ac3b31bda Added comment about a warning, no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649930 13f79535-47bb-0310-9956-ffa450edef68
2015-01-06 20:17:46 +00:00
Jacques Le Roux d6c2d35d34 Inconsistencies related to the "java -jar ofbiz.jar" commands when used with arguments https://issues.apache.org/jira/browse/OFBIZ-5872
The help gives you:
c:\projectsASF\ofbiz>java -jar ofbiz.jar -help

Usage: java -jar ofbiz.jar [command] [arguments]
-both    -----> Run simultaneously the POS (Point of Sales) application and OFBiz standard
-help, -? ----> This screen
-install -----> Run install (create tables/load data)
-pos     -----> Run the POS (Point of Sales) application
-setup -------> Run external application server setup
-start -------> Start the server
-status ------> Status of the server
-shutdown ----> Shutdown the server
-test --------> Run the JUnit test script
[no config] --> Use default config
[no command] -> Start the server w/ default config

But actually only the -help, -status and -shutdown command need a dash. 

For now we decided to change the documentation generated by the help command to remove dashes when they are not needed.

To change 
-install -----> Run install (create tables/load data)
by
-load-data -----> Create tables/load data

To comment out the 
-setup -------> Run external application server setup
line

When done, we will try to have things consistent and re-add the missing dashes to the commands and in the help. Then the "Technical production setup guide" should be updated, pfew...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1640588 13f79535-47bb-0310-9956-ffa450edef68
2014-11-19 16:27:49 +00:00
Jacopo Cappellato aada10a520 Removed 4 no more needed configuration properties (and associated fields).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1633380 13f79535-47bb-0310-9956-ffa450edef68
2014-10-21 13:53:24 +00:00
Jacopo Cappellato ac7bfdfbed Cleaned up the way the classloaders are setup at startup by removing duplicate logic and responsibilities between the start and base components.
Before this change the following classloader hierarchy was setup:
1) the "application" classloader for the "start" component
2) one "native lib" classloader for the "base" component
3) one "native lib" classloader for the all the other (non "base") framework/application/specialpurpose/hot-deploy components
4) one "web app" classloader for each of the webapplications

After this commit the hierarchy is simplified by merging #2 and #3:
a) the "application" classloader for the "start" component
b) one "native lib" classloader for the all the framework/application/specialpurpose/hot-deploy components (including the "base" component)
c) one "web app" classloader for each of the webapplications

This has been achieved by merging the code that was setting up classloader #2 in the start component (for the "base" component) with the code that was setting up the classloader #3 in the base component: now all the code is in the start component.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1633182 13f79535-47bb-0310-9956-ffa450edef68
2014-10-20 16:13:33 +00:00
Jacopo Cappellato 1a71a69ea6 Removed the ClassLoaderContainer: it is no more used.
Moved the portOffset field from ClassLoaderContainer to the Start/Config class.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1624700 13f79535-47bb-0310-9956-ffa450edef68
2014-09-13 06:57:02 +00:00
Jacopo Cappellato fa8115dba5 Removed the custom CachedClassLoader and related artifacts in favour of a simpler bootstrap process and a simpler classpath tree; now the classpath tree is made of: bootstrap classloader (primordial+ext) -> system classloader (aka applications or classpath classloader) -> two custom classloaders (one loads the framework/base classes and one loads all the other classes) -> Webapp classloaders (one per web application).
Junit tests are included. The two custom classloaders could be merged into one but this will be addressed in a second phase because it will require some changes to the bootstrap componenr and process.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1624549 13f79535-47bb-0310-9956-ffa450edef68
2014-09-12 13:49:17 +00:00
Jacopo Cappellato 189b8a4b34 A series of simplifications, cleanups of old code, and improvements to the code that setup the class paths for the OFBiz classloaders; the former code was setting the same jars (e.g. ofbiz.jar and all the base libs) in both the parent/child classloaders; it was unnecessarily setting the classpath system property when not required/useful.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1623352 13f79535-47bb-0310-9956-ffa450edef68
2014-09-08 10:38:28 +00:00
Jacopo Cappellato 12303aa5a4 Removed the "rmi" loader from test startup configuration: it was loading the ComponentContainer two times.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1623305 13f79535-47bb-0310-9956-ffa450edef68
2014-09-08 06:51:22 +00:00
Jacopo Cappellato 0136f12d3a Removed some obsolete properties set at startup.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622468 13f79535-47bb-0310-9956-ffa450edef68
2014-09-04 12:40:15 +00:00
Jacopo Cappellato 0a5af77359 Moved the constructor at the top of the class, removed 2 static methods that were used to construct the object and embedded the logic in the constructor.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622441 13f79535-47bb-0310-9956-ffa450edef68
2014-09-04 10:01:07 +00:00
Jacopo Cappellato 1c904a98d8 The Config class, that was used as an immutable object, is now effectively immutable.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622427 13f79535-47bb-0310-9956-ffa450edef68
2014-09-04 09:05:32 +00:00
Jacopo Cappellato 8796e166d0 Removed unused field.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1622412 13f79535-47bb-0310-9956-ffa450edef68
2014-09-04 07:44:41 +00:00
Adrian Crum b6c4dd5315 Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1617938 13f79535-47bb-0310-9956-ffa450edef68
2014-08-14 13:36:33 +00:00
Adrian Crum 4462994828 Fixed a bug in Start.java reported by Justen Walker (https://issues.apache.org/jira/browse/OFBIZ-5710):
The singleton pattern was broken by adding Commons Daemon support code to the class - resulting in multiple instances when using Commons Daemon.

I extracted the Commons Daemon code to a separate class - which delegates to the singleton Start instance. Users of Commons Daemon will need to update their scripts/etc to point to the new class instead of Start.

I also added a comment describing the design of Start.java, so hopefully this will help others maintain the code without breaking it.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1617936 13f79535-47bb-0310-9956-ffa450edef68
2014-08-14 13:27:39 +00:00
Jacopo Cappellato 80e2f28c1c Removed some code that was checking, in a rather weak way, the Java version at startup.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1616492 13f79535-47bb-0310-9956-ffa450edef68
2014-08-07 14:17:41 +00:00
Jacopo Cappellato 3cfa3cff3e OFBIZ-5651: fixed broken settings for the appserver execution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605977 13f79535-47bb-0310-9956-ffa450edef68
2014-06-27 07:37:22 +00:00
Adrian Crum 714050ef33 Updated build files to use/require Java 7.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1605524 13f79535-47bb-0310-9956-ffa450edef68
2014-06-25 17:59:46 +00:00
Jacques Le Roux 606501012e Revert r1589562, it was not the origin of the issue Hans thought he crossed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1590630 13f79535-47bb-0310-9956-ffa450edef68
2014-04-28 13:31:11 +00:00
Hans Bakker 25312fa05c adminport in start.properties was ignored. fixed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1589562 13f79535-47bb-0310-9956-ffa450edef68
2014-04-24 03:57:06 +00:00
Jacques Le Roux 8860a9459d Fixes a bug introduced with r1574404 (forgot that shutdown and status historicaly have a prefixing dash), thanks to Youseek Khaye who spotted it and sent me a mail (the stop target was no longer working). I tested them only with a portoffset, my bad.
While working on this I spotted another error introduced earlier with r1533839. Now, status and stop work again as before. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1577744 13f79535-47bb-0310-9956-ffa450edef68
2014-03-14 22:20:34 +00:00
Jacques Le Roux 1e99cffcb1 Completes descriptions of ant targets which have portoffset parameter
Completes code in Config.java for start-debug only (adds "start-debug" to pick start.properties when portoffset is used). 
The rest of the changes is only refactoring to have the replacement to pick start.properties only in getInstance()

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1574404 13f79535-47bb-0310-9956-ffa450edef68
2014-03-05 09:46:26 +00:00
Jacques Le Roux ae2d3dedf3 Running OFBiz with start-batch, stopping it then or checking its status was missing, this completes these aspects.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1574201 13f79535-47bb-0310-9956-ffa450edef68
2014-03-04 21:02:13 +00:00
Adrian Crum ba484bafa6 Fixed a C&P error in the startup code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1542513 13f79535-47bb-0310-9956-ffa450edef68
2013-11-16 13:55:25 +00:00
Jacques Le Roux c386f6ab30 Set different ports for testing in a CI environment (e.g. Jenkins) https://issues.apache.org/jira/browse/OFBIZ-4794
*What's for?*
Finally, OOTB the port offset is interesting in 2 cases:
# To eventually run Sonar on OFBiz sources https://issues.apache.org/jira/browse/INFRA-3590
# To simultaneously run the demos without having to change much things, just one parameter (this will need to have the same commited in R13.07... to be discussed...)

Of course, It can be used for other purposes outside of the ASF context...

*How it's done?*
Basically, I just added a portoffset integer parameter to 3 ant targets (of course this JVM param can also be used in a Java call from command line): start, start-pos, start-both,

The portoffset parameter is set to zero by default in ClassLoaderContainer.java. 
If a value is passed, it's then grabed by Config.java and passed to ClassLoaderContainer.java, where it's set to this value.

 The portoffset is then used to change in one shoot all the default ports values defined (in config or hardcoded), and the admin port value
This is done in following classes:
CatalinaContainer
NamingServiceContainer
ServiceEngine through ServiceLocation
RmiServiceContainer
XMLRPCClientEngine
XmlRpcTests

To avoid hardcoding locations in services definitions, I also created 2 service-locations: main-http and main-soap

*To summarize:* these changes will be used to run "ant start" with a portoffset value which will take care of all ports values, including admin port. For running R12.04 demo as stable we will still need to create a patch for the last time. R13.07 could have a similar patch applied since it's not yet released...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533839 13f79535-47bb-0310-9956-ffa450edef68
2013-10-19 22:07:35 +00:00
Jacques Le Roux 0ef1ff543e Reverts revisions: 1525909 + 1526533 + 1526560, OFBIZ-4794 is not yet ready
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1526583 13f79535-47bb-0310-9956-ffa450edef68
2013-09-26 15:44:40 +00:00
Jacques Le Roux 59f4630664 Set different ports for testing in a CI environment (e.g. Jenkins) https://issues.apache.org/jira/browse/OFBIZ-4794
Complete previous work because of INFRA-6790

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1526533 13f79535-47bb-0310-9956-ffa450edef68
2013-09-26 14:58:47 +00:00
Jacques Le Roux c86a579cf8 Set different ports for testing in a CI environment (e.g. Jenkins) https://issues.apache.org/jira/browse/OFBIZ-4794
*What's for?*
OOTB the port offset is interesting in at least 3 cases:
# To simultaneously run tests on the same Buildbot machine. This is related to http://mail-archives.apache.org/mod_mbox/www-builds/201209.mbox/%3C002101cd991b$0a16de50$1e449af0$@16degrees.com.au%3E
# To simultaneously run the demos without having to change much things, just one parameter
# To eventually run Sonar on OFBiz sources https://issues.apache.org/jira/browse/INFRA-3590

*How it's done?*
Basically, I just added a portoffset integer parameter to some ant targets (of course this JVM param can also be used in a Java call from command line):
* in trunk and R13.07: start, start-batch, start-debug, start-pos, start-both, run-tests and run-test
* in R12.04 and R11.04: run-tests, run-test. I did not set start targets because anyway it would miss the admin port offset, withouh much changes. So can't be used to demonstrate. We will continue to use the current paches for those.

The portoffset parameter is set to zero by default in ClassLoaderContainer.java. 
If a value is passed, it's then grabed by Config.java and passed to ClassLoaderContainer.java, where it's set to this value.

 The portoffset is then used to change in one shoot all the default ports values defined (in config or hardcoded), and the admin port value in R13.07 and trunk.
This is done in following classes:
CatalinaContainer
NamingServiceContainer
ServiceEngine through ServiceLocation
RmiServiceContainer
XMLRPCClientEngine
XmlRpcTests

To avoid hardcoding locations in services definitions, I also had to create some service-locations: main-local-soap and main-remote-soap 

*What are the constraints?*
* For demos: the offset should not be applied to trunk because <service-location name="main-remote-soap" location="http://demo-trunk.ofbiz.apache.org:8080/webtools/control/SOAPService"/> is used for tests by trunk *and all releases*. It's useless to apply to trunk anyway,  offsetting port in releases is enough.
* I did not take into account the Ideal payment harcoded port values in IdealPaymentServiceTest.java. Weirdly I did not cross error during tests, though it seems there are tests using an harcoded port in url.

*What is the status?*
Locally (on Win XP)  I ran many tests combinations with <<ant load-demo run-tests>>.  
Applying the portoffset on a sole running test instance has no effects. I have still some fails (no errors) but those are not related to my changes, they appear also without.
But when I run a combination of any releases/trunk but with R11.04, I get a time out error with testSOAPSimpleService, that I can't explain so far. 
If I run the trunk alone with the portoffset no errors occur. Same if I run a release with portoffset and only testSOAPSimpleService in trunk (w/ or w/o portoffset)

*To summarize:* these changes will be used to run Buildot tests instances simultaneously . And, for coming releases, to run demos without having to create patches. Simply running ant start with a portoffset value which will take care of all ports values, including admin port. For running R12.04 demo as stable we will still need to create a patch for the last time.

*What I will to do for now:* commit the patches and test if I cross the same issue on Buildbot. If it's the same (99% chances it will) I will revert and will continue to locally try to find the reason . I believe this issue is unrelated to the changes I implemened.  And it's just because it's now possible to simultaneously run tests that it appears. 

BTW I just noticed that when you run R11.04 with R12.04, R12.04 takes almost all the CPU (XP is not very, while when running any combinations w/o R11.04 the CPU load is shared. 
Also there are far less tests in R11.04, which coul be the reason when I run it with another test run instance there are no issues.  Because R11.04 tests finish before the other instance gets to run testSOAPSimpleService.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1525909 13f79535-47bb-0310-9956-ffa450edef68
2013-09-24 14:47:30 +00:00
Adam Heath 523ffda8be FIX: Make commons-daemon reflection access work again; this was broken
because the constructor was private, and the init(String[]) method was
removed.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1481999 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 18:01:39 +00:00
Adam Heath 0dde029713 FORMATTING: The empty constructor body is no longer on a single line.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1481998 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 18:01:32 +00:00
Jacopo Cappellato 27c1c384a4 Moved the appserver component from framework to specialpurpose.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1465276 13f79535-47bb-0310-9956-ffa450edef68
2013-04-06 17:25:01 +00:00
Jacques Le Roux 87a9e9b312 This prevented to load both web and pos simultaneously (both-containers.xml does not exist anymore).
It needs a compilation to work again.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1451879 13f79535-47bb-0310-9956-ffa450edef68
2013-03-02 12:32:11 +00:00
Scott Gray 04df9cb162 Add a bunch of missing Override annotations
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1418651 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 12:06:40 +00:00
Scott Gray 0af4184d61 Remove a bunch of unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1418650 13f79535-47bb-0310-9956-ffa450edef68
2012-12-08 12:06:01 +00:00
Adrian Crum 0828388d85 More work on Start.java - added the capability for client code to query the class for server state.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1374720 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 09:59:31 +00:00
Adrian Crum 9a7cbede73 Some work on Start.java:
1. Removed unused method.
2. Consolidated/separated the Commons Daemon implementation - this just makes it easier to distinguish it from the rest of the code.
3. Changed some public methods to private, and added a private constructor.
4. Made ServerState enum public.

These changes are in preparation for enabling client code to query the class for the server's state.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1374711 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 08:46:21 +00:00
Adrian Crum 3425bca428 Re-organize and format code in Start.java - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1374705 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 08:05:46 +00:00
Adrian Crum 5b24afe6ab Fixed generics in Config.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1374704 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 08:04:43 +00:00
Jacques Le Roux 368c3d43a2 Fixes generic warning
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1363690 13f79535-47bb-0310-9956-ffa450edef68
2012-07-20 09:10:30 +00:00
Jacques Le Roux c46b891ca8 Removes dead code, organize imports
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1363689 13f79535-47bb-0310-9956-ffa450edef68
2012-07-20 09:09:38 +00:00
Jacopo Cappellato 6137a3bf47 Minor change to set a consistent naming format for all the threads started by OFBiz.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1362417 13f79535-47bb-0310-9956-ffa450edef68
2012-07-17 09:05:33 +00:00
Jacopo Cappellato 78a8738a8f Minor change to use the Runtime class to get the number of processors rather than MxBeans.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1361955 13f79535-47bb-0310-9956-ffa450edef68
2012-07-16 09:54:27 +00:00
Jacopo Cappellato 20b343d1f5 Unified all the different variants of *-containers.xml files into one; this has been made possible because now you can declare the container loaders in the startup properties; also moved some container definitions from base/config to the proper component.
It is now very easy to control the way containers are loaded.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1360637 13f79535-47bb-0310-9956-ffa450edef68
2012-07-12 11:34:41 +00:00
Jacopo Cappellato 068430fb8b Moved a few container definitions from the base/config/*-containers.xml files to their own component's ofbiz-component.xml file; this is a demonstration of the usage of the new ability to define component level containers; this is still experimental and there is room for improvements (and I am working on them and going to discuss a few details in the dev list) but this should already give a good idea of how we can remove redundancy from the various *-containers.xml files, remove dependencies between framework components and make the components self deployable.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1355466 13f79535-47bb-0310-9956-ffa450edef68
2012-06-29 16:43:51 +00:00
Hans Bakker 32b7ee65bf reverting 1334331: unwanted commit
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334333 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 07:52:25 +00:00
Hans Bakker 42341068ec set memory back to 640k and add demo message
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334331 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 07:43:19 +00:00
Adam Heath b24617935b FEATURE: Start supporting commons-daemon explicitly.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327257 13f79535-47bb-0310-9956-ffa450edef68
2012-04-17 19:58:09 +00:00
Adam Heath ba177f3aca OPTIMIZE: Add a new FAIL Control, and move the processing into a method on the
enum.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327256 13f79535-47bb-0310-9956-ffa450edef68
2012-04-17 19:58:03 +00:00
Adam Heath ecefbd3452 OPTIMIZE: Don't use static Strings to hold the commands sent over the
socket; instead, use an enum.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327255 13f79535-47bb-0310-9956-ffa450edef68
2012-04-17 19:57:57 +00:00
Adam Heath fffea48b81 FIX: Fix race condition in startup code; it's possible for all loaders to be
started, a shutdown command get's issued, stopping is occurring, but
then the server state ends up being set to RUNNING.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327254 13f79535-47bb-0310-9956-ffa450edef68
2012-04-17 19:57:50 +00:00
Adam Heath 39db7dfc5a OPTIMIZE: Remove the 2 boolean variables that encoded the startup/shutdown state,
and instead use a single reference, and an enum.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1327253 13f79535-47bb-0310-9956-ffa450edef68
2012-04-17 19:57:44 +00:00