on 12-19-2011 10:40 AM
I am using a JAVA user defined function within a message mapping.
The JAVA function class requires classes in two reference libraries org.apache.commons.collections and org.apache.commons.beanutils.
When I try to import these two jar files as archives, there are some classes which exist in both libraries and the import fails.
I'm new to JAVA, is there anything that can be done to resolve this conflict and let me load both libraries as archives ?
Thanks
Hi Paul,
It sounds like you might have the wrong version of the beanutils package. See below for information I pulled from the apache website:
Since the 1.7.0 release BeanUtils has distributed three jars:
u2022commons-beanutils.jar - contains everything <------- You probably have this one
u2022commons-beanutils-core.jar - excludes Bean Collections classes <------- You want this one
u2022commons-beanutils-bean-collections.jar - only Bean Collections classes
The main commons-beanutils.jar has an optional dependency on Commons Collections
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ryan
Thanks, but I've already tried this core class.
It still contains some collections classes which are in the commons-collection class also.
org.apache.commons.collections.ArrayStack.class
org.apache.commons.collections.Buffer.class
org.apache.commons.collections.BufferUnderflowException.class
org.apache.commons.collections.FastHashMap.class
Hi Ryan
I need the ListOrderedMap class from the commons-collections and the DynaBean class from the commons-beanutils.
So I need elements of both classes.
Despite what commons-beanutils-core is described as, both classes contain
org.apache.commons.collections.ArrayStack.class
org.apache.commons.collections.Buffer.class
org.apache.commons.collections.BufferUnderflowException.class
org.apache.commons.collections.FastHashMap.class
which is causing the issue.
There are a number of internet comments about the clash in commons-collections and commons-beanutils, but I've not found a suggestion as to how we can get around this.
If you need that one class file from the beanutils package then I think you can extract it from the .jar using something like WinZip and then use the WinZip utility to repackage it and then you would only need to import the one archive but still have all the classes you need.
Regards,
Ryan Crosby
Hi,
Could you try importing the jar files in two diffrent archives within same SWCV.
When you call this from UDF in same SWCV, i think this will work.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.