Commit Graph
2421 Commits
Author SHA1 Message Date
Adrian Crum b888457923 ComponentConfig.java refactor second pass - thread-safety for the static collections. Also fixed some flawed logic in the getComponentConfig factory method that caused redundant parsing of the XML file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1534012 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 23:57:31 +00:00
Adrian Crum 6d6ccf33ff ComponentConfig.java refactor first pass - eliminate Javolution, small code cleanups.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533960 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 20:22:38 +00:00
Adrian Crum 777d1aefa6 Reformatted ComponentConfig.java - no functional change. This is in preparation for some refactoring.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533946 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 18:42:07 +00:00
Adrian Crum 3f673c7bfe Allow JSONWriter to handle Iterators.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1533927 13f79535-47bb-0310-9956-ffa450edef68
2013-10-20 16:54:32 +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 6e93e48ea3 Renames owasp-esapi-full-java-1.4.jar to owasp-esapi-full-java-1.4-patched-by-OFBIZ-3135.jar to reflect the reality
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530678 13f79535-47bb-0310-9956-ffa450edef68
2013-10-09 15:31:16 +00:00
Jacques Le Roux c8ce55ecc9 A patch from Anahita Goljahani for Fixed mispelling of "occurred" https://issues.apache.org/jira/browse/OFBIZ-5342
jleroux: this includes a safe change in jquery.validate.js and jquery.validate.min.js

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1530341 13f79535-47bb-0310-9956-ffa450edef68
2013-10-08 16:35:40 +00:00
Adrian Crum 55f80f4fd9 Replaced HashSet with LinkedHashSet in UtilMisc.java to preserve original ordering. Suggested by Leon on the dev mailing list.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1527212 13f79535-47bb-0310-9956-ffa450edef68
2013-09-28 18:24:53 +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 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
Jacopo Cappellato 367ac26332 Upgraded Fop to 1.1 (the latest bug fix release) and barcode4j to 2.1 (version compatible with Fop 1.1).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1524835 13f79535-47bb-0310-9956-ffa450edef68
2013-09-19 20:47:37 +00:00
Adrian Crum 0e1449137d Small improvement to String-to-Date conversion: Accept either JDBC escape format or localized format.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1524133 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 17:16:50 +00:00
Adrian Crum c276d17fa4 Small change to ObjectType.java - log warning on conversion failures so we can see what went wrong.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1524132 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 17:15:20 +00:00
Adrian Crum ecb1c8e8d6 Fix a trivial compiler warning - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1524131 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 17:13:52 +00:00
Jacques Le Roux 5c4bb0a2b4 Reverts r1518777
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1522675 13f79535-47bb-0310-9956-ffa450edef68
2013-09-12 17:36:45 +00:00
Jacques Le Roux d6eaefbeb6 This fixes "Net before overhead report generates an error" https://issues.apache.org/jira/browse/OFBIZ-5267
This is related with r1361130, where the birt component was moved from framework to specialpurpose.

The fix is to create the possibility of a loose coupling from applications controllers to specialpurpose controllers. For that an if-present attribute is added to the include element. When used, if the included controller does not exist, instead of an error and a stack trace, a warning is thrown (only in English, for developers) suggesting to checkout the component from trunk. Indeed, in the current case, this situation should only arise in release after 12.04 where the birt component, like all others but the ecommerce component, had been removed. This can be used in other cases, but for now only the component level is covered.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1518777 13f79535-47bb-0310-9956-ffa450edef68
2013-08-29 19:37:44 +00:00
Adrian Crum 2eb8a4ddfb Added a FIXME note for a bug introduced in revision 1089946.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1513195 13f79535-47bb-0310-9956-ffa450edef68
2013-08-12 16:55:57 +00:00
Hans Bakker afb70f3469 corrections of errors introduced with r1511742
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1512129 13f79535-47bb-0310-9956-ffa450edef68
2013-08-09 02:35:39 +00:00
Jacques Le Roux 1956e731a3 No functional changes, only formatting.
While looking for other cases like r1459222 and r1509164 introduced by r1300812 and r1305309. I noticed there were a lot of wrong for loops formatting (miss a white space after for), this changes it

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1511742 13f79535-47bb-0310-9956-ffa450edef68
2013-08-08 12:28:01 +00:00
Adrian Crum 9d76e3b412 Improved the parsing logic in FlexibleStringExpander.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1506151 13f79535-47bb-0310-9956-ffa450edef68
2013-07-23 16:41:02 +00:00
Hans Bakker ad8ae088de add a csv import/export invoices at an organizational level with partyid and productid translation functions, more imports/exports will follow
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1502093 13f79535-47bb-0310-9956-ffa450edef68
2013-07-11 03:14:30 +00:00
Adrian Crum c563479956 Removed support for runtime nested expressions in FlexibleStringExpander.java. This fixes the vulnerability CVE-2013-2250
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1500772 13f79535-47bb-0310-9956-ffa450edef68
2013-07-08 14:37:37 +00:00
Jacopo Cappellato 498ab7e68c Fix for typo in a comment.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1499706 13f79535-47bb-0310-9956-ffa450edef68
2013-07-04 09:34:20 +00:00
Adam Heath e746f4da83 FIX: java.sql.Timestamp extends java.util.Date, and both have converters
registered.  In some cases, however, the Date convertor would be used
instead of the more correct Timestamp convertor.  This fix implements a
most-specific type algorithm to find the better convertor.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1497890 13f79535-47bb-0310-9956-ffa450edef68
2013-06-28 19:08:16 +00:00
Jacques Le Roux 5dba698b83 No functional changes while working on OFBIZ-4794
* Organize imports
* Fix wrong comments

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1495807 13f79535-47bb-0310-9956-ffa450edef68
2013-06-23 11:02:41 +00:00
Jacopo Cappellato a4db370bbc Removed appender-ref reference that I forgot to remove as part of 1489461; thanks to Deepak Dixit for reporting this.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1493658 13f79535-47bb-0310-9956-ffa450edef68
2013-06-17 06:57:40 +00:00
Adrian Crum 5fe2414094 Much smarter UtilXml.java nodeNameToJavaName method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1493473 13f79535-47bb-0310-9956-ffa450edef68
2013-06-16 07:34:46 +00:00
Adrian Crum 34704f3fdc Some work on the security component:
1. Fixed the XSD.
2. Fixed a bad config file.
3. Removed cached DOM code.
4. Simplified Security factory code.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1491345 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 05:53:54 +00:00
Jacques Le Roux e07c466c36 Implement the change for "Currently we can dynamically change the log level in webtools but not for a class or a package." https://issues.apache.org/jira/browse/OFBIZ-5207
If in Webtools Log Configuration, I check all debugging levels (ie add verbose to OOTB default), I don't get simple verbose lines in log, same with OFBiz trunk and all releases, but old R4.0 from 2007 where you get tons of lines (including debug lines from 3rd parties libs, this last feature still works in newer code versions).

By simple verbose lines I mean
{code}
Debug.logVerbose()
{code}
or
{code}
if (Debug.verboseOn()) Debug.logVerbose()
{code}
contrary to
{code}
if (Debug.verboseOn()) Debug.logInfo()
{code}
Which are of course shown ,if you force the debugging levels to verbose (I noted this scheme is often used in OFBiz OOTB).

When you set a logger to ALL (aka verbose) for a specific package or class, then also it does not work (no Debug.logVerbose() lines printed in logs)
I tried in webtools log config to add a logger to a class or/and package, set to DEBUG or ALL, and to even to use -DDEBUG=true system property (found in Debug class code), to no avail.

I barely checked the situation is the same from OFBiz R9.04 (included) to trunk.

Let me clarify again:
* Setting, dynamically or not, the verbose level, you get all Debug.log() levels lines in log, including lower levels like DEBUG (not used in OFBiz but in 3rd parties libs), but not the OFBiz Debug.logVerbose() lines
* Adding a logger for a class or package with ALL level does not work. You don't get the verbose lines of this class/package in logs.

With trunk demo, you can easily try both Webtools Log Configurations and any combinations running the getPartyFromEmail service from Webtools (paramater: ofbiztest@example.com) and checking the log: https://demo-trunk.ofbiz.apache.org/webtools/control/LogView.

I believe the previous behaviour (like in R4.0) where, when you set all debugging levels, you get all log lines including Debug.logVerbose() ones, is not wanted. You then get too much lines and it's barely usable (too much information kills the information). What I want: see only Debug.logVerbose() lines for a class or package, I don't want to see all Debug.logVerbose() lines (you never get them at the moment anyway) or if (Debug.verboseOn()) lines (you get them when checking all debugging levels).

I thought this was working, but I must say I never succeeded to get it working. So I thought it was my way of doing it. But now, I'm quite sure  it's an incomplete feature, that I even qualify a bug (we need that, even in previous releases)

As I said, putting the whole on Verbose level works but is not enough. You are then facing too much information and it blurs/clutters logs too much
Dynamically setting the log level for a class or package is most useful when willing to debug core features and even custom ones.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1491188 13f79535-47bb-0310-9956-ffa450edef68
2013-06-09 12:05:33 +00:00
Adrian Crum c3ceb113ea More work on ResourceLoader.java:
1. ResourceLoader instances are now thread-safe, though the static methods that cache DOM objects are not.
2. Code cleanup and better XML validation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1489801 13f79535-47bb-0310-9956-ffa450edef68
2013-06-05 10:38:06 +00:00
Adrian Crum 6073ef6dea Some first steps in fixing the concurrency issues in ResourceLoader.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1489748 13f79535-47bb-0310-9956-ffa450edef68
2013-06-05 08:56:58 +00:00
Jacopo Cappellato 4ae936a5f3 The content rendered in the Webtools "view log" screen is now rendered from the ofbiz.log file rather then the ofbiz.html file in order to provide more control on the html code rendered in the screen. This fixes the vulnerability CVE-2013-2137
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1489461 13f79535-47bb-0310-9956-ffa450edef68
2013-06-04 14:48:40 +00:00
Adrian Crum 33f04b40e7 New method for UtilXml.java - convert a DOM node name to a Java field name or Java class name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1489360 13f79535-47bb-0310-9956-ffa450edef68
2013-06-04 09:41:34 +00:00
Jacques Le Roux 334c716283 Add a mean to collect and show the Requests Events durations using Metrics https://issues.apache.org/jira/browse/OFBIZ-5198
This has involuntarily slipped in, thanks to Adrian who reviewed

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1485620 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 09:05:38 +00:00
Jacques Le Roux eb9f05e7aa Add a mean to collect and show the Requests Events durations using Metrics https://issues.apache.org/jira/browse/OFBIZ-5198
Fulfill the goal with some more:
* makes the Metrics main parameters (estimationSize, estimationTime and smoothing) dynamically changeable (added in serverstats.properties)
* there is no threshold handling for event metrics


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1485601 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 07:55:14 +00:00
Adrian Crum e0ccd44b0f Small improvement to the Performance Metrics feature - sort by name the list of metrics.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1484150 13f79535-47bb-0310-9956-ffa450edef68
2013-05-18 17:31:45 +00:00
Adrian Crum 9bd42ec3a2 Reverted revision 1483822.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1484134 13f79535-47bb-0310-9956-ffa450edef68
2013-05-18 16:12:50 +00:00
Jacques Le Roux 929a06dfd5 Improves the Metrics stats by adding a new column used only by requests. It's quite useful to measure the real (not smoothed) durations of events in notably *chained* requests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1483822 13f79535-47bb-0310-9956-ffa450edef68
2013-05-17 14:21:02 +00:00
Adam Heath 8133384848 FEATURE: Add TimestampToString converter; this parallels the existing StringToTimestamp implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482507 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:09:22 +00:00
Adam Heath 01822c38e0 FEATURE: Add safeAdd, which protects against BigDecimal addition when the right operand is null.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482506 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:09:16 +00:00
Adam Heath 4e5c0a7647 FIX: in urlEncodeArgs, don't call obj.toString if the obj is an Array or
a Collection; instead, iterate over each memeber and encode that.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482131 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 22:31:12 +00:00
Adam Heath 2046bec01a FIX: Forgot to add this new file when I added the ability to disable ssl
certificate checking.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482126 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 22:30:32 +00:00
Adam Heath 2cbd5ac701 FEATURE: Add a join() variant that takes a collection.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482069 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:06:11 +00:00
Adam Heath 92079f7a65 OPTIMIZE: join() now calls UtilValidate.isEmpty().
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482067 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:06:03 +00:00
Adam Heath 105854b8f6 FEATURE: Add ability to disable client and server side certificate
checking.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482064 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:05:33 +00:00
Adam Heath a5385a682f FEATURE: Reworked to expose a getSSLContext helper method, called by
everything else.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482062 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:05:26 +00:00
Adam Heath 3cfa43e2b1 FIX: In stripNamedParamsFromQueryString, prevent && from occuring in the
resultant buffer.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482061 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:05:18 +00:00
Adam Heath 432ce20711 FEATURE: Switch derby <inline-jdbc> to use the external
passwords.properties.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482057 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:04:59 +00:00
Adam Heath 158bc8b1de FEATURE: Allow for passwords in entityengine.xml to come from an
external passwords.properties file; nothing actually uses this yet,
however.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482056 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 20:04:51 +00:00
Adam Heath dbbc11d18e FEATURE: Switch ResourceLoader.getXmlDocument() to a version of
UtilXml.readXmlDocument that records line/column information.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1482003 13f79535-47bb-0310-9956-ffa450edef68
2013-05-13 18:02:01 +00:00