Showing posts with label jboss. Show all posts
Showing posts with label jboss. Show all posts

I was trying to integrate spring security on my application but got a bit disappointed with it. Comparing it to jboss rules engine (drools), I find spring security a bit harder to be understood. The documentation and example is not very clear, most of the example on the documentation covers only xml based configuration and It didnt cover programmatic usage of the library.

Although its too early to conclude which one is better, right now I feel that jboss rules engine is a better choice since its much easier to use and understand. But anyway I'm gonna continue playing around with spring security because I may have missed something.

I was trying to look for an easier way to clone objects (easier than using java.lang.Cloneable class) and I found out that using the jboss serialization library is easier and faster. The following code shows how to clone an object:

try {
JBossObjectOutputStream jbossSerializer = new JBossObjectOutputStream(null);
User newUser = (User) jbossSerializer.smartClone(user);
System.out.println(newUser);
}
catch(Exception e) {
System.out.println("EXCEPTION CAUGHT: " + e.getMessage());
}


using jboss serialization, you can also clone "Non serializable" objects.

you will need jboss-serialization.jar


Reference:

http://blogs.jboss.com/blog/clebert/

I was trying my first integration test but just using the default generated test class and xml meta data by jboss tools, i get the following error:

ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Instantiated: name=DeploymentFilter state=Described
java.lang.IllegalStateException: Class not found: [Ljava.lang.String;
at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:174)

i tried the following things:

1. followed this http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassNotFoundJava.lang.StringInJDK6
2. downloaded jboss embedded beta
3. upgraded to seam 2.1.0 AI

none of them worked for me.

lastly, i tried downloading seam 2.0.1 GA and installed jdk 1.5. i configured the test project's compiler compliance level to 5.0 instead of 6.0 (6.0 default for some reason. maybe because my default jdk is 1.6) and the result were so much better.

to remove the error message saying something like this:
Could not instantiate Seam component: authenticator
drools related libraries needs to be included since we are using the rule based engine and Identity class is part of it. just include the seam/lib/drools-core.jar, seam/lib/drools-compiler.jar and seam/lib/core.jar.

after copying the drools related libraries and executing the test, a different kind of error is thrown. this time an error saying that the "security.drl is missing" you will need to copy that file from seam/seam-gen/resource/security.drl and place it to projectname-test/bootstrap/deploy/ folder.

run it again and the test will be successful!

embedded jboss is needed when testing seam components or ejb's but based on the jboss seam integration testing documenation, the stable version have problems when using jdk 1.6. since there are compatability issues when testing using seam 2.0 GA on jdk 1.6, i think staying with 2.0.1GA and jdk 1.5 is better at the moment.

Older Posts Home

Blogger Template by Blogcrowds