Commit Graph
1510 Commits
Author SHA1 Message Date
Jacopo Cappellato 665e81597a Improved information logged when the method is unable to compute the approximate byte size of a cached object using serialization: instead of a useless stack trace it is returned an informative message with the name of the class that is not serializable; in case of null objects a message is also logged.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1352575 13f79535-47bb-0310-9956-ffa450edef68
2012-06-21 15:42:45 +00:00
Jacopo Cappellato 5cb3561232 Fixed bug discovered while analyzing content of caches (found null objects instead of parsed scripts).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1352539 13f79535-47bb-0310-9956-ffa450edef68
2012-06-21 14:14:21 +00:00
Jacopo Cappellato f3da3c9e6a Upgrade of Tomcat from 7.0.27 to 7.0.28; also renamed the jars containing j2ee specification apis: there was no need to append the tomcat version because they don't change in all the 7.0 releases; instead I have added a suffix to better expose the specification version.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1351734 13f79535-47bb-0310-9956-ffa450edef68
2012-06-19 14:57:25 +00:00
Adrian Crum ada9b6e78a Fixed a bug in DateTimeConverters.java where the wrong converter was being selected. The bug was due to class detection in the java.util.Date hierarchy - so the fix uses explicit classes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1350081 13f79535-47bb-0310-9956-ffa450edef68
2012-06-14 03:32:18 +00:00
Jacopo Cappellato a610e70049 As discussed in the dev list, removed the experimental jcr component; its development will continue in the proper branch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1347478 13f79535-47bb-0310-9956-ffa450edef68
2012-06-07 08:14:28 +00:00
Jacques Le Roux e4432d69e2 We agreed on that on dev ML: easier to use
GroovyUtil.runScriptAtLocation()
than 
executeScript()
In case of error or debugging

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1345840 13f79535-47bb-0310-9956-ffa450edef68
2012-06-04 06:07:19 +00:00
Adam Heath 27e88264a0 FIX: Prefix all log file names with ${ofbiz.home}, so when code is run directly from a subdir(when doing api testing), the logs are still placed at the top level. Previously, you'd end up with $PWD/runtime/logs scattered all around.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1344771 13f79535-47bb-0310-9956-ffa450edef68
2012-05-31 15:23:21 +00:00
Jacopo Cappellato fcdf07a0e6 Improved code that manages the cache:
* protected some UtilCache objects (static fields) by making them private and final

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343815 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 16:18:02 +00:00
Jacopo Cappellato 36737ad059 Improved code that manages the cache:
* protected the UtilCache object (static field) by making it private and final
* removed unnecessary synchronization



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343729 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 14:01:45 +00:00
Jacopo Cappellato 4eb06e3e00 Improved code that manages the cache:
* protected the UtilCache object (static field) by making it private and final
* removed unnecessary synchronization



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343728 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 13:57:19 +00:00
Jacopo Cappellato 126a9d40d5 Improved code that manages the cache:
* protected the UtilCache object (static field) by making it private and final
* removed unnecessary synchronization



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343727 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 13:52:32 +00:00
Jacopo Cappellato e316284fc9 Improved code that manages the cache:
* protected the UtilCache object (static field) by making it private and final
* replaced some put with putIfAbsentAndGet to slightly simplify the code



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343717 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 13:33:29 +00:00
Jacopo Cappellato 9fe920a3f7 Improved code that manages the cache:
* removed unnecessary synchronization
* protected the UtilCache object (static field) by making it private and final
* replaced non atomic containsKey+put+get with get + putIfAbsentAndGet
* replaced containsKey + null check + get with get + null check



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343692 13f79535-47bb-0310-9956-ffa450edef68
2012-05-29 12:10:54 +00:00
Jacopo Cappellato 3eecd00954 Enhanced unit test for UtilCache.putIfAbsentAndGet method to better explain its behaviour: it returns the reference to the same object passed as argument only if the key was not already found in cache.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343291 13f79535-47bb-0310-9956-ffa450edef68
2012-05-28 15:39:02 +00:00
Jacopo Cappellato 074c282c0c Improved code that manages the cache:
* protected the UtilCache object (static field) by making it private and final
* instead of using the "put" method, use the "putIfAbsentAndGet" method to prevent the risk of adding the new value if another concurrent thread added it in the meantime



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343278 13f79535-47bb-0310-9956-ffa450edef68
2012-05-28 15:25:46 +00:00
Jacopo Cappellato ee53c9452b Some cleanups and changes to logging configuration:
* some misc formatting and changes to comments
* removed the old and unused configuration for minerva
* added a new file appender for Tomcat where all Tomcat internal logging is now redirected 
* changed internal logging for FOP from info to warn to be consistent with the settings of other external components (Tomcat, Geronimo Transaction Manager, Freemarker)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343269 13f79535-47bb-0310-9956-ffa450edef68
2012-05-28 14:41:50 +00:00
Jacopo Cappellato 7c91aaa74f OFBIZ-4901 Upgraded icu4j from version 4.4 to version 49.1; thanks to Deepak Dixit for the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343261 13f79535-47bb-0310-9956-ffa450edef68
2012-05-28 14:05:29 +00:00
Jacques Le Roux b48ff3a62c Closes "Move SHARK to Attic" https://issues.apache.org/jira/browse/OFBIZ-4795
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343064 13f79535-47bb-0310-9956-ffa450edef68
2012-05-27 15:47:32 +00:00
Jacques Le Roux 7730a12e22 Renames nekohtml.jar to nekohtml-1.9.7.jar (found in MANIFEST) see http://nekohtml.sourceforge.net/index.html
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343038 13f79535-47bb-0310-9956-ffa450edef68
2012-05-27 12:33:17 +00:00
Jacques Le Roux 621a487c35 Closes "Logs not generating on linux" https://issues.apache.org/jira/browse/OFBIZ-4877
I removed log4j-over-slf4j from trunk at in order to have logs in official Trunk demo. THis is part of the JCR effort which should be removed from trunk anyway since Sascha recreated a new JCR branch. I let him handle the rest...

I guess [Bridging legacy APIs|http://www.slf4j.org/legacy.html] has not been followed in details 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1342893 13f79535-47bb-0310-9956-ffa450edef68
2012-05-26 13:05:35 +00:00
Jacopo Cappellato 8de34f3f44 Upgraded Ant from 1.8.3 to 1.8.4 and "Commons Compress" from 1.4 to 1.4.1 in order to protect the system from vulnerability reported in CVE-2012-2098: Apache Commons Compress and Apache Ant denial of service vulnerability.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1342326 13f79535-47bb-0310-9956-ffa450edef68
2012-05-24 16:36:09 +00:00
Adam Heath 49c0e405a9 FEATURE: Upgrade freemarker to a custom version that contains an
upcoming fix, filed in bug upstream at:
https://sourceforge.net/tracker/?func=detail&atid=100794&aid=3527625&group_id=794

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341056 13f79535-47bb-0310-9956-ffa450edef68
2012-05-21 14:40:23 +00:00
Adam Heath 7c59f9068e OPTIMIZE: Add a static method that configures a BeansWrapper instance
for ofbiz use.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341055 13f79535-47bb-0310-9956-ffa450edef68
2012-05-21 14:40:13 +00:00
Adam Heath 410079c235 OPTIMIZE: Move the getDefaultOfbizWrapper to earlier in the class; this
reflects the notion that BeansWrapper needs to be accessed/configured
earlier than Configuration, so ideally should come earlier in the list
of methods.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1341054 13f79535-47bb-0310-9956-ffa450edef68
2012-05-21 14:40:05 +00:00
Jacques Le Roux 69a54d528a Hastily removed at r1340414, needed by macros.xml (taskdefs javacc & jjtree)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340638 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 08:33:05 +00:00
Jacopo Cappellato 79ae52492a Refactored code to use the default BeansWrapper defined by FreemarkerWorker; this is important according to comment from one of the Freemarker committers:
"As of creating new BeansWrapper, be sure you create it only once during the application life-cycle and then reuse the same instance, or else it will have to rebuild the class introspection cache again and again."

Thanks to Adam Heath for the comment.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340631 13f79535-47bb-0310-9956-ffa450edef68
2012-05-20 07:49:45 +00:00
Jacques Le Roux e1183b6d16 Following https://issues.apache.org/jira/browse/OFBIZ-4833?focusedCommentId=13275249&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13275249
Moves to Attic:
    framework/base/lib/ant/ant-nodeps-1.8.1.jar => can be removed IMO. It was added with ant 1.8 by Hans, not sure why (no comment about need), seems to contains no needed stuff
    framework/base/lib/javacc can be removed IMO. The Java Compiler Compiler tm (JavaCC tm) - The Java Parser Generator, not used OOTB, was added by Marco, not sure why (no comment about need)
    framework/base/lib/Tidy.jar was used at bottom of eCommerce pages before, no longer needed
    framework/base/lib/ant-trax-1.8.0.jar can be removed IMO. It was added with ant 1.8 by Hans, not sure why (no comment about need), contains XSLT task
    framework/base/lib/commons/commons-vfs-20070730.jar certainly added with Webslinger can be removed now


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340414 13f79535-47bb-0310-9956-ffa450edef68
2012-05-19 10:57:40 +00:00
Jacopo Cappellato c60e7870fd Added new method "putIfAbsentAndGet" to UtilCache: it is similar to putIfAbsent but it always return the value even if the value was missing and added to the cache by method.
This can be useful to improve code like:

cache.putIfAbsent("key", "value");
value = cache.get("key"); // if a concurrent thread has cleared the cache the value could be null

into this:

value = cache.putIfAbsentAndGet("key", "value");



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340351 13f79535-47bb-0310-9956-ffa450edef68
2012-05-19 06:36:41 +00:00
Jacopo Cappellato 363ce98d69 Made the static variable Debug.dateFormat a private and final field because it is only used locally and DateFormat is not thread safe.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1340347 13f79535-47bb-0310-9956-ffa450edef68
2012-05-19 06:18:07 +00:00
Jacopo Cappellato 4aebe81b8f Based on suggestion from Daniel Dekany (committer/maintainer of the Freemarker's project):
"Since BeansWrapper.getDefaultInstance() returns an instance that is
 shared in the scope of the class-loader that defined the FreeMarker
 classes, and since possibly multiple independently developed
 components in your system use FreeMarker and thus getDefaultInstance
 (and you may don't even know about it), and since the returned
 BeanWrapper can be configured (not read-only), you never know how the
 returned BeanWrapper is configured. So you add a 3rd party component,
 and if you are unlucky, suddenly your other component is broken.
 As of creating new BeansWrapper, be sure you create it only once
 during the application life-cycle and then reuse the same instance, or
 else it will have to rebuild the class introspection cache again and
 again."
 
 I have replaced the usage of the static instance of the BeansWrapper with a newly created object. 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1339504 13f79535-47bb-0310-9956-ffa450edef68
2012-05-17 07:25:13 +00:00
Adrian Crum f5fa8dcb5b Added a comment to UtilXml.java - no functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1339089 13f79535-47bb-0310-9956-ffa450edef68
2012-05-16 09:41:07 +00:00
Jacques Le Roux 2da70363b5 Revert all the changes related to CommonEmptyHeader, apart base-catalog.xml and labels in CommonUiLabels.xml.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1339081 13f79535-47bb-0310-9956-ffa450edef68
2012-05-16 09:27:31 +00:00
Jacques Le Roux d8088bdd77 Deprecates w/out keepSpace versions of UtilXml.createOutputTransformer() and UtilXml.writeXmlDocument()
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338974 13f79535-47bb-0310-9956-ffa450edef68
2012-05-16 02:42:09 +00:00
Jacques Le Roux aede4717e1 Fixes and complete r1338831
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338845 13f79535-47bb-0310-9956-ffa450edef68
2012-05-15 19:26:39 +00:00
Jacques Le Roux 1c972bf684 Fixes https://issues.apache.org/jira/browse/OFBIZ-4652 "The Label Manager is wrongly overriding CommonEmptyHeader"
* Adds a keepSpace boolean to UtilXml.writeXmlDocument(), this allows to use xsl:preserve-space into UtilXml.createOutputTransformer()
* Uses it into SaveLabelsToXmlFile.saveLabelsToXmlFile()
* Adds some French labels into CommonUiLabels.xml using Labels Manager to test the new functionality 
* Adds the xml:space attribute into the valueType complexType
* Adds the ofbiz-properties.xsd schema into the base-catalog.xml

I got an issue when 1st trying to commit: 
Commit failed (details follow):
While preparing
 'D:\workspace\ofbizClean\framework\common\config\CommonUiLabels.xml' for commit
Inconsistent line ending style

So I forced the EOLs to my locale platform value (Win XP)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338831 13f79535-47bb-0310-9956-ffa450edef68
2012-05-15 19:03:26 +00:00
Adrian Crum f09c0db4d1 Change new FlexibleMapAccessor static method to an object method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338372 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 19:57:25 +00:00
Adrian Crum b4c01f24ff Small fixup for my last commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338366 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 19:45:20 +00:00
Adrian Crum 025a75b632 Added a utility method to FlexibleMapAccessor.java to test for nested expressions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338361 13f79535-47bb-0310-9956-ffa450edef68
2012-05-14 19:43:18 +00:00
Jacopo Cappellato 53d6c971e9 Improved implementation of concurrent access to the cache of parsed Groovy scripts to avoid the risk of a NPE in the unlucky event that, between the execution of the cache.putIfAbsent and cache.get methods, the cache entry was removed (e.g. cache cleared/expired).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337789 13f79535-47bb-0310-9956-ffa450edef68
2012-05-13 07:16:18 +00:00
Jacopo Cappellato 4c5561546f Based on review from Adam Heath, refactored/simplified the implementation of thread safe code using the parsedScripts object.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337046 13f79535-47bb-0310-9956-ffa450edef68
2012-05-11 07:50:43 +00:00
Ashish Vijaywargiya b256c3d7cc Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

If conditional check is used for some debug level lets say "Verbose" then the containing Debug statement will be Debug.logVerbose() instead of Debug.logInfo() - Comment from Jacopo and Adrian. 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1337024 13f79535-47bb-0310-9956-ffa450edef68
2012-05-11 04:46:26 +00:00
Ashish Vijaywargiya e0971b304c Applied similar fix as we did on trunk r1300463.
On production systems you can't suppress Debug.log( message by the use of debug.properties file. It is always good to use Debug.* statements that are having log level setup in debug.properties file. The real problem comes with Debug.log( statement when you are printing any list or map object that contains so many records(or data) in it. Here I am changing all the occurrence of Debug.log( with Debug.logInfo(, Debug.logError( or Debug.logWarning( so that we can have better control of Debug.* statements on production system. :-)

Bad use of Debug statement. On production system you will get false alarm that you are having error in code base although the resultant statement is only giving additional information instead of error message.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335927 13f79535-47bb-0310-9956-ffa450edef68
2012-05-09 05:28:17 +00:00
Adam Heath 31b721aaa6 FIX: Bare passwords(circa 595296) comparisons were broken; they actually
used the oldFunnyHex encoding, not the fixed correct hex encoding.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335267 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 21:27:25 +00:00
Adrian Crum 1a9c764f4e Minor code cleanup in ObjectType.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334840 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 00:13:35 +00:00
Adrian Crum ae64f8dfc8 FlexibleStringExpander performance improvement - eliminate costly call to UtilValidate.isEmpty(Object).
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334575 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 08:59:24 +00:00
Adrian Crum a14a4384ab Refactored FlexibleLocation.java - removed unnecessary synchronized lazy-load code (LocationResolvers don't cost anything to build), and made the class thread-safe. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334426 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 15:02:36 +00:00
Adrian Crum 2044f8779a Small fixup for my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334382 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 10:17:44 +00:00
Adrian Crum 38430074c5 Added UTF-8 encoding to UtilPropertiesTests, simplified the code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334370 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 09:53:16 +00:00
Adam Heath f1be0a1e0c FEATURE: Add key-encrypting-key support; this is to bring ofbiz *much*
closer to PCI compliance.  This key handler is *still* not active.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334257 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:37:06 +00:00
Adam Heath a0108243f5 FIX/DEPRECATION: Fix all the HashCrypt deprecated uses. All proper methods in HashCrypt
now follow the same form: (String hashType, ..., String valueToHash).
Some methods also follow a polish notation suffix.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334172 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:45 +00:00