[Design of AOP on JBoss (Aspects/JBoss)] - Can I create class using reflection?
by bornmw
Hi!
I assume my question is about design of JBossAOP since users couldn't help me.
My question is simple.
I have a class that is post processed by aopc.
Does JBossAOP design let me I instantiate it using reflection?
When I try doing it I get this:
| java -cp .:/projects/lib/jboss-aop_1.5.5.GA/lib-50/jboss-aop-jdk50.jar:/usr/local/pluto-1.1.4/shared
| /lib/portlet-api-1.0.jar:/usr/local/pluto-1.1.4/webapps/AOPPortlet/WEB-INF/lib/concurrent.jar:/usr/l
| ocal/pluto-1.1.4/webapps/AOPPortlet/WEB-INF/lib/javassist-snapshot.jar:/usr/local/pluto-1.1.4/webapp
| s/AOPPortlet/WEB-INF/lib/jboss-common.jar:/usr/local/pluto-1.1.4/webapps/AOPPortlet/WEB-INF/lib/trov
| e.jar ConstrTest
| constructor = public Test()
| Exception in thread "main" java.lang.VerifyError: (class: org/jboss/aop/advice/ViewAspect0, method: invoke signature: (Lorg/jb
| oss/aop/joinpoint/Invocation;)Ljava/lang/Object;) Unable to pop operand off an empty stack
| at java.lang.Class.getDeclaredConstructors0(Native Method)
| at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
| at java.lang.Class.getConstructor0(Class.java:2699)
| at java.lang.Class.newInstance0(Class.java:326)
| at java.lang.Class.newInstance(Class.java:308)
| at org.jboss.aop.advice.PerVmAdvice.generateInterceptor(PerVmAdvice.java:132)
| at org.jboss.aop.advice.PerVmAdvice.generateOptimized(PerVmAdvice.java:56)
| at org.jboss.aop.advice.AdviceFactory.create(AdviceFactory.java:68)
| at org.jboss.aop.Advisor.createInterceptorChain(Advisor.java:618)
| at org.jboss.aop.Advisor.pointcutResolved(Advisor.java:888)
| at org.jboss.aop.Advisor.resolveMethodPointcut(Advisor.java:650)
| at org.jboss.aop.ClassAdvisor.createInterceptorChains(ClassAdvisor.java:607)
| at org.jboss.aop.ClassAdvisor.access$300(ClassAdvisor.java:82)
| at org.jboss.aop.ClassAdvisor$1.run(ClassAdvisor.java:299)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.aop.ClassAdvisor.attachClass(ClassAdvisor.java:271)
| at org.jboss.aop.AspectManager.initialiseClassAdvisor(AspectManager.java:591)
| at org.jboss.aop.AspectManager.getAdvisor(AspectManager.java:579)
| at Test.<clinit>(Test.java)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
| 39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm
| pl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
| at java.lang.Class.newInstance0(Class.java:355)
| at java.lang.Class.newInstance(Class.java:308)
| at ConstrTest.main(ConstrTest.java:16)
|
My code is:
| ClassLoader loader = Thread.currentThread().getContextClassLoader();
| Class clazz = loader.loadClass("Test");
| for (int j = 0; j < clazz.getConstructors().length; j++) {
| Constructor constructor = clazz.getConstructors()[j];
| System.out.println("constructor = " + constructor);
| }
| Test t = (Test) clazz.newInstance();
| System.out.println("t = " + t);
|
Test is a simple class with default constructor and one method that has aspect attached to it.
What am I doing wrong? Or is it not possible to construct aspectized classes using reflection at all?
Many thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115044#4115044
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115044
17 years, 1 month
[Design of JBoss jBPM] - Unique constraint violated using sub-process in Oracle db
by epaquette75
I'm having issues when I execute a second instance of a sub-process in a Oracle database:
[20/12/07 14:25:33:757 EST] 00000029 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl initialize FFDC0009I: FFDC opened incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\logs\ffdc\server1_6500650_07.12.20_14.25.33_0.txt
[20/12/07 14:25:33:978 EST] 00000029 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\logs\ffdc\server1_6500650_07.12.20_14.25.33_0.txt
[20/12/07 14:25:34:018 EST] 00000029 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl open FFDC0009I: FFDC opened incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\logs\ffdc\server1_6500650_07.12.20_14.25.34_0.txt
[20/12/07 14:25:34:859 EST] 00000029 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file C:\Program Files\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\logs\ffdc\server1_6500650_07.12.20_14.25.34_0.txt
[20/12/07 14:25:35:249 EST] 00000029 SystemOut O 14:25:34,929 User:admin ERROR [ui.common.Utils] A system error happened during the operation: Transaction didn't commit: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
javax.transaction.RollbackException: Transaction didn't commit: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:430)
at org.alfresco.web.bean.workflow.ManageTaskDialog.transition(ManageTaskDialog.java:396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
at javax.faces.component.UICommand.broadcast(UICommand.java:109)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
Caused by: org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:622)
at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:714)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:583)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:420)
... 40 more
Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:218)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2174)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:575)
... 44 more
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (NHPOLS.SYS_C007328) violated
at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:4368)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteBatch(WSJdbcPreparedStatement.java:808)
at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeBatch(WSJdbcStatement.java:612)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:4
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
... 59 more
Here's my script calling the sub-process:
<process-state name="test1">
<sub-process name="moduleb" />
</process-state>
moduleb
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="moduleb">
admin
<start-state name="start">
</start-state>
<task-node name="task1">
</task-node>
<end-state name="end1"></end-state>
</process-definition>
Same issue occur for this guy:
http://lists.jboss.org/pipermail/jboss-user/2007-August/078277.html
Can you please help me on this one
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115033#4115033
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115033
17 years, 1 month
[Design of POJO Server] - Making JBoss Test VFS aware
by alesj
When testing deployment/deployers I ran into some problems with URL mappings.
This lead to a simple discovery that our Test project is completely VFS unaware. :-)
The code that previously worked out-of-the-box (JBossTestServices)
| protected URL getDeployURL(final String filename)
| throws MalformedURLException
| {
| // First see if it is already a complete url.
| try
| {
| return new URL(filename);
| }
| catch (MalformedURLException e)
| {
| log.debug(filename + " is not a valid URL, " + e.getMessage());
| }
|
| // OK, lets see if we can figure out what it might be.
| String deployDir = System.getProperty("jbosstest.deploy.dir");
| if (deployDir == null)
| {
| deployDir = "output/lib";
| }
| String url = deployDir + "/" + filename;
| log.debug("Testing file: " + url);
| // try to canonicalize the strings a bit.
| File file = new File(url);
| if (file.exists())
| {
| log.debug(file.getAbsolutePath() + " is a valid file");
| return file.toURL();
| }
| else
| {
| log.debug("File does not exist, creating url: " + url);
| return new URL(url);
| }
| }
|
now fails if there is no plain-mapping --> vfs-mapping in the middle.
And for subdeployments, there is no such mapping, since old MainDeployer only keeps reference/mapping for the top level deployment.
So if you want to do a isDeployed test for some subdeployment, there is no way to get a useful result unless you do some similar hacking:
| public boolean isDeployed(URL url)
| {
| String name = contextMap.get(url);
| if (name == null)
| {
| if (log.isTraceEnabled())
| log.trace("No such context: " + url);
| if (url == null)
| throw new IllegalArgumentException("Null url");
| String urlString = url.toString();
| // remove this once the JBoss-test is updated with VFS usage
| if (urlString.startsWith("vfs") == false)
| return checkDeployed("vfs" + urlString);
| else
| return checkDeployed(urlString);
| }
|
| return checkDeployed(name);
| }
|
This is just one of the problems, I'm sure there are more VFS related issues.
On the other hand, we're also missing some VFS performance tests.
The current tests with Seam examples showed a horrible performance hit.
We need to include this in both, VFS and AS tests.
I can go and change the first issue(s), but would need some help on how to start/impl with the second, performance testing.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115013#4115013
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115013
17 years, 1 month
[Design of JBoss Web Services] - Re: WS-RM Prototype Ready for Preview
by richard.opalka@jboss.com
"thomas.diesler(a)jboss.com" wrote :
| I propose to get the initial implementation going first. Then we investigate the pros/cons of a standalone decoupled RM implementation.
IMO RM Sender/Receiver must be decoupled from client proxy/endpoint. However I was following just three goals when writing this first RM prototype:
* finish it till the end of this year
* provide the functional test suite covering all scenarios from Microsoft interop
* cover the WS-Security combinations too
"thomas.diesler(a)jboss.com" wrote : After all, if a RM implementation cannot provide reliable messaging (because of its coupling) - it is pointless to use it from the customer point of view ;-)
Again, you're absolutely right and I'm happy you're diving into RM dilemma too because our communication about it becomes meaningful ;-) I'm figuring out this pointless RM implementation, but it's not final solution. It's just first prototype that works. But there's still a lot of work to make it better and more meaningful not only from customer point of view.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114983#4114983
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114983
17 years, 1 month