[Javassist] - Problem with GluonJ and javassist.gluonj.util.Loader
by Dmitriy Zavodnikov
Dmitriy Zavodnikov [https://community.jboss.org/people/dzavodnikov] created the discussion
"Problem with GluonJ and javassist.gluonj.util.Loader"
To view the discussion, visit: https://community.jboss.org/message/731467#731467
--------------------------------------------------------------
I have a problem with part of *GluonJ* library: javassist.gluonj.util.Loader
I have this code:
Loader loader = new Loader(Class.class.getClassLoader(), new String[0]);
Class<?> sanselan1 = loader.loadClass("org.apache.sanselan.Sanselan");
// Read image.
Method getBI = sanselan1.getMethod("getBufferedImage", new Class[]{ File.class } );
BufferedImage image = (BufferedImage) getBI.invoke(null, new Object[]{ imageIn });
And this code +work correctly+!
But this code don't works:
Method setBI = *sanselan1*.getMethod(
"writeImage",
new Class[]{ BufferedImage.class, File.class, ImageFormat.class, Map.class }
);
setBI.invoke(null, new Object[]{ image, imageOut, ImageFormat.IMAGE_FORMAT_PNG, null });
I get an error:
java.lang.NoSuchMethodException: org.apache.sanselan.Sanselan.writeImage(java.awt.image.BufferedImage, java.io.File, org.apache.sanselan.ImageFormat, java.util.Map)
But if I using standart class loader:
Class<?> *sanselan2* = Class.forName("org.apache.sanselan.Sanselan");
//...
Method setBI = *sanselan2*.getMethod(
"writeImage",
new Class[]{ BufferedImage.class, File.class, ImageFormat.class, Map.class }
);
setBI.invoke(null, new Object[]{ image, imageOut, ImageFormat.IMAGE_FORMAT_PNG, null });
Everithing works fine! It meanse, that org.apache.sanselan.Sanselan have method writeImage and I correctly called it.
But if I using javassist.gluonj.util.Loader I have an exception: NoSuchMethodException.
What is a problem?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/731467#731467]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 11 months
[jBPM] - Passing data to a work item handler
by out sider
out sider [https://community.jboss.org/people/out_sider] created the discussion
"Passing data to a work item handler"
To view the discussion, visit: https://community.jboss.org/message/731448#731448
--------------------------------------------------------------
My question is quite simple.
I know that is possible to declare a Work Item Definition where some parameters are String and alike. Then the user can simply fill those parameters using the Web Designer in More properties and data assign. But I want those parameters to be already defined programmaticly.
What I mean is this scenario:
* User fills a form provided by my application
* Work Item Definition is generated holding the data inputed
* Work Item Definition is sent to guvnor through the Rest API
* User designs a process using the Service Task corresponding to the previously defined Work Item Definition
* Work Item Handler has access to the data inputed by the User when he/she filled the form and was holded on the Work Item Definition
In fact if this worked it would be exactly what I needed:
import org.drools.process.core.datatype.impl.type.StringDataType;
[
// the Java Node work item located in:
// project/src/main/resources/META-INF/JavaNodeDefinition.conf
[
"name" : "JavaNode",
"parameters" : [
"UserName" : "John",
],
"displayName" : "Java Node",
"icon" : "icons/java.gif"
]
]
But unfortenly (at least to my understanding) parameter literal values can't be defined in the Work Item Definition...only what type it is...
As such how can I let the user define an Activity and hold data in it, place it in the Workflow using the designer and then colect data from the Work Item Definition?
The user shouldn't define anything else after the WID is done...meaning he/she won't be inputing data in the Service Task more properties within the designer...
all the info must be holded when the WID is generated.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/731448#731448]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 11 months
[JBoss Cache] - JBoss 5.1.0-GA CacheManager is NULL when trying to get from JNDI
by vadimk
vadimk [https://community.jboss.org/people/vadimk] created the discussion
"JBoss 5.1.0-GA CacheManager is NULL when trying to get from JNDI"
To view the discussion, visit: https://community.jboss.org/message/731429#731429
--------------------------------------------------------------
I'm trying to setup our application to run in Cluster, so we need to convert local cache to a distributed cache.
I'm trying to use JBossCache available in the "ALL" deployment profile.
Documentation is pretty straight forward and I was able to add my custom cache to jboss-cache-manager-jboss-beans.xml file and even "eagerStarted" it.
When I go to JMX Console I can see CacheManager and my own custom cache started successfully.
The problem is that when I try to get CacheManager in my service from JNDI as ctx.lookup("java:CacheManager") it returns null. I'm not getting NamingException, just null.
If I use CacheManagerLocator, which does the same thing under the covers, it throws IllegalStateException: CacheManager not found.
I looked at many different posts and tried their suggestions, such as
-moving my application to deploy.last folder
-adding <depends>CacheManager</depends> to jboss-web.xml
Nothing works....
I'm running JBoss 5.1.0GA on Windows 7 64bit machine. Any help will be greatly appreciated...
Vadim
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/731429#731429]
Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 11 months
[Javassist] - What's the difference between the Maven and direct-download Javassist JARs
by David Moles
David Moles [https://community.jboss.org/people/dmoles] created the discussion
"What's the difference between the Maven and direct-download Javassist JARs"
To view the discussion, visit: https://community.jboss.org/message/731394#731394
--------------------------------------------------------------
I've noticed that about 10% of the classes in javassist-3.14.0-GA.jar from Maven differ from those in javassist.jar from javassist-3.14.0-GA.zip. Specifically the classes below. Can anyone tell me what the differences are and why?
javassist/ClassPool$1.class
javassist/CtClass$1.class
javassist/JarDirClassPath$1.class
javassist/SerialVersionUID$1.class
javassist/SerialVersionUID$2.class
javassist/SerialVersionUID$3.class
javassist/bytecode/CodeIterator$Switcher.class
javassist/bytecode/Descriptor$PrettyPrinter.class
javassist/bytecode/Descriptor.class
javassist/bytecode/analysis/Executor.class
javassist/bytecode/analysis/FramePrinter.class
javassist/compiler/CodeGen$1.class
javassist/compiler/CodeGen.class
javassist/compiler/Javac$1.class
javassist/compiler/Javac$2.class
javassist/compiler/Javac$3.class
javassist/compiler/Lex.class
javassist/compiler/MemberResolver.class
javassist/compiler/Parser.class
javassist/compiler/TypeChecker.class
javassist/compiler/ast/ASTList.class
javassist/util/HotSwapper$1.class
javassist/util/proxy/ProxyFactory$1.class
javassist/util/proxy/ProxyFactory$2.class
javassist/util/proxy/RuntimeSupport.class
javassist/util/proxy/SecurityActions$1.class
javassist/util/proxy/SecurityActions$2.class
javassist/util/proxy/SecurityActions$3.class
javassist/util/proxy/SecurityActions$4.class
javassist/util/proxy/SecurityActions$5.class
javassist/util/proxy/SecurityActions$6.class
javassist/util/proxy/SerializedProxy$1.class
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/731394#731394]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 12 months
[JBoss Cache] - Is optimistic-entity an inappropriate configuration for a Hibernate 2nd level cache configuration?
by Tom Muldoon
Tom Muldoon [https://community.jboss.org/people/tmuldo] created the discussion
"Is optimistic-entity an inappropriate configuration for a Hibernate 2nd level cache configuration?"
To view the discussion, visit: https://community.jboss.org/message/731346#731346
--------------------------------------------------------------
After upgrading jgroups from 2.5.1 to 2.7.0GA, we encountered ClassNotFoundExceptions that we tracked down to class loader issues between swarmcache (our Hibernate 2^nd^ level cache provider) and jgroups. To make a long story short, we’re now attempting a cut over to jboss cache.
Some specifics…
JBoss AS 5.1.0.GA
hibernate-jbosscache2-3.3.1.GA
jbosscache-core 3.2.5GA
With that said, here’s my hibernate configuration in which we ran into DataVersioningExceptions with queries…
{code:xml}
<property name=+"hibernate.cache.use_second_level_cache"+ value=+"true"+ />
<property name=+"hibernate.cache.use_query_cache"+ value=+"true"+ />
<property name=+"hibernate.cache.region.jbc2.query.localonly"+ value=+"true"+ />
<property name=+"hibernate.cache.region.factory_class"+ value=+"org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory"+ />
<property name=+"hibernate.cache.region_prefix"+ value=+"hibernate.firstbest"+ />
{code}
Is optimistic-entity an inappropriate configuration for a Hibernate 2^nd^ level cache configuration? Assuming so, how do we deal with the DataVersioningExceptions? Is mvcc-entity a more appropriate configuration?
Sincerely, Tom
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/731346#731346]
Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 12 months
[jBPM] - Create a work item definition programmatically should be easy
by out sider
out sider [https://community.jboss.org/people/out_sider] created the discussion
"Create a work item definition programmatically should be easy"
To view the discussion, visit: https://community.jboss.org/message/731296#731296
--------------------------------------------------------------
I really can't understand how such a simple thing isn't better documented...or documented at all.
I just want to add a new work item definition using the Rest API so it can latter be used by the user when designing the Business Process in the editor.
My sequence is somehting like this:
User fills form -> work item definition parameters are defined using the form data -> work item definition is added to guvnor using the rest api -> the user can then use it within the designer as a new service task.
This seems to be quite a common thing and should be strate forward.
For what I understood there are two ways to create the WDI...uploading a file or as a XML-ATOM. I tried the first one as I didn't see any example of the other.
But the WDI doesn't appear in the service task list of the designer.
What I did was writting the WDI content to a string and then send it as a byte[] stream to the POST Rest Api Asset method (simply string.getBytes()). It *appears in the WDI list of the drools* guvnor explorer but *not in the designer*.
So what is the best way and where can I find an example of uploading a work item definition generated with user info programmatically and then use it in the designer?
Thanks in advance
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/731296#731296]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 12 months