[JBoss Portal] - Help needed on portal and jackrabbit: ClassCastException
by gsferra@imnet.it
Hi,
I've developed a stand alone application using latest Jackrabbit libraries and now I wish to evolve it in a jboss service (sar) useable in my application. Sadly, while deploying on server, I get "ClassCastException", caused (so I believe) by conflicts between jackrabbit classes provided by my application and portal. I tried to set up a classloaders isolation but it didn't work. My application structure is:
app.ear
- /lib
- /lib/a-lot-of.jar <- here are latest jackrabbit libraries too
- /META-INF
- /META-INF/application.xml
- myservice.sar
- /com/.../my-packages/.../my.class
- /META-INF/jboss-service.xml
Questions are:
- Where to place jackrabbit's libraries? (EAR/lib, SAR/lib, etc...)
- How to force my service to work with that libraries?
- How to avoid conflicts between my service and portal?
Thank you,
--
GaS
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203966#4203966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203966
17 years, 3 months
[JBoss AOP] - ObjectInput
by slv
Hello,
I am currently playing around with JBoss AOP, but I can't seem to make my pointcuts work.
This is the xml file:
| <aop>
| <aspect class="main.Aspect" />
| <bind pointcut="execution(void $instanceof{java.io.ObjectOutput}->writeObject($instanceof{java.lang.Object}))">
| <around aspect="main.Aspect" name="secureWrite" />
| </bind>
| <bind pointcut="execution($instanceof{java.lang.Object} $instanceof{java.io.ObjectInput}->readObject())">
| <around aspect="main.Aspect" name="secureRead" />
| </bind>
| </aop>
|
My Aspect class is this:
| package main;
|
| import org.jboss.aop.joinpoint.MethodInvocation;
|
| public class Aspect {
| private final SecureCommunication secure;
|
| public Aspect() {
| secure = new SecureCommunicationRSA();
| }
|
| public Object secureWrite(MethodInvocation invocation) throws Throwable {
| System.out.println("Writing secure");
| Object[] args = invocation.getArguments();
| for (int i = 0; i < args.length; i++) {
| args = secure.encrypt(args);
| }
| return invocation.invokeNext();
| }
|
| public Object secureRead(MethodInvocation invocation) throws Throwable {
| System.out.println("Reading secure");
| return secure.decrypt(invocation.invokeNext());
| }
| }
|
And the class I want to instrument is this:
package main;
|
| import java.io.File;
| import java.io.FileInputStream;
| import java.io.FileOutputStream;
| import java.io.IOException;
| import java.io.ObjectInput;
| import java.io.ObjectInputStream;
| import java.io.ObjectOutput;
| import java.io.ObjectOutputStream;
|
| public class Main {
|
| /**
| * @param args
| */
| public static void main(String[] args) throws IOException,
| ClassNotFoundException {
| ObjectOutput out = new ObjectOutputStream(new FileOutputStream(
| new File("test")));
| out.writeObject("this");
| out.writeObject("is");
| out.writeObject("a test");
| out.close();
|
| ObjectInput in = new ObjectInputStream(new FileInputStream(new File(
| "test")));
| System.out.println(in.readObject());
| System.out.println(in.readObject());
| System.out.println(in.readObject());
|
| }
|
| }
|
When I try to apply the aspects, I get the following message
anonymous wrote :
| [aop-debug] org.jboss.aop.instrument.Instrumentor trying to transform main.Main
| [aop-debug] org.jboss.aop.instrument.CallerTransformer There are no caller pointcuts!
| [aop-debug] org.jboss.aop.instrument.JoinpointSimpleClassifier javassist.CtMethod@44a4fe33[public static main ([Ljava/lang/String;)V] matches no pointcuts
| [aop-debug] org.jboss.aop.instrument.JoinpointSimpleClassifier javassist.CtConstructor@176e552[public Main ()V] matches no pointcuts
| [aop-debug] org.jboss.aop.instrument.Instrumentor was main.Main converted: false
| [no comp needed] /home/slv/Desktop/EncryptionTest/classes/main/Main.class
|
Can you please help me? I tried so many things and I can't make it work.
Thank you,
Silviu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203960#4203960
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203960
17 years, 3 months