[JBoss Tools] - CDI Builder error while parse seam-beans.xml
by Ronaldo Campos
Ronaldo Campos [https://community.jboss.org/people/ronaldocwb] created the discussion
"CDI Builder error while parse seam-beans.xml"
To view the discussion, visit: https://community.jboss.org/message/725744#725744
--------------------------------------------------------------
I started haven trouble when I added to seam-beans.xml some additional config. My seam-beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:ee"
xmlns:t="urn:java:org.jboss.seam.transaction"
xmlns:ft="urn:java:org.jboss.seam.faces.transaction"
xmlns:sc="urn:java:org.jboss.solder.core"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://docs.jboss.org/cdi/beans_1_0.xsd">
<t:SeSynchronizations>
<s:modifies />
</t:SeSynchronizations>
<t:EntityTransaction>
<s:modifies />
</t:EntityTransaction>
<sc:Veto>
<s:Qualifier />
</sc:Veto>
<ft:TransactionPhaseListener>
<s:replaces />
<sc:Veto />
</ft:TransactionPhaseListener>
</beans>
The error:
Errors occurred during the build.
Errors running builder 'CDI (Context and Dependency Injection) Builder' on project 'VeereJSF'.
java.lang.NullPointerException
Eclipse log:
!MESSAGE Errors running builder 'CDI (Context and Dependency Injection) Builder' on project 'VeereJSF'.
!STACK 0
java.lang.NullPointerException
at org.jboss.tools.cdi.seam.config.core.ConfigDefinitionContext.addAnnotation(ConfigDefinitionContext.java:149)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.scanAnnotation(SeamDefinitionBuilder.java:140)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.scanElement(SeamDefinitionBuilder.java:101)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.scanRoot(SeamDefinitionBuilder.java:85)
at org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder.createDefinition(SeamDefinitionBuilder.java:75)
at org.jboss.tools.cdi.seam.config.core.CDISeamConfigExtension.buildDefinitions(CDISeamConfigExtension.java:147)
at org.jboss.tools.cdi.core.CDICoreBuilder.build(CDICoreBuilder.java:227)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
My app is running on Tomcat 7 normally, but CDI Builder keeps throwing this error and I havo no code completitions on my JSF pages. Is it a bug?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/725744#725744]
Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 3 months
[jBPM] - JBPM Workflow colliding with Task Service
by vchmakov
vchmakov [https://community.jboss.org/people/vchmakov] created the discussion
"JBPM Workflow colliding with Task Service"
To view the discussion, visit: https://community.jboss.org/message/725969#725969
--------------------------------------------------------------
Hi,
As recommended in JBPM/Drools documentation to support my workflow/Drools operations I’m exposing a singleton service object. The workload on the JBPM/Drools engine is very lite at the moment and therefore I create one session and serialize all commands receiving them via the message queue. Everything seems to be working fine. Now, when the Task Server (MINA implementation) is completing tasks and resuming suspended workflows they inevitably collide with the execution of the main trunk. It is not a problem to make my service singleton thread-safe, however I’m also exposing a transactional context including one-per-transaction instance of the Entity Manager which obviously should be different for the Task Completion thread. Besides I have no control over the transactional context of the Task Server and therefore unable to prepare the data and services for processing of the command.
Here come the questions:
* Is there a solution for the issue?
* Is there an issue at all or I’m overlooking/misunderstanding something?
* What is the best practices for programming such sort of operations in JBPM?
* Has anyone been dealing with such kind of problems working with JBPM?
I do not mind looking through the sources of the JBPM/Drools which I do all the time when debugging, but if possible I’d like to hear from the gurus.
Any advice is highly appreciated.
Thanks,
Vlad
1. P.S.: the current version I’m working with is 5.1.2, however, my tests show the same results working with 5.2.0. Besides, I’m working with modified version of the 5.1.2 Human Tasks code, where I implement JTA-style transactions, which is now standard in 5.2.0.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/725969#725969]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 3 months
[Javassist] - ClassCastException when modifiying JOptionPane behaviour
by Telcontar Thorongil
Telcontar Thorongil [https://community.jboss.org/people/telcontarvi] created the discussion
"ClassCastException when modifiying JOptionPane behaviour"
To view the discussion, visit: https://community.jboss.org/message/725909#725909
--------------------------------------------------------------
I'm triying to modify the JOptionPane behaviour to log all the user responses. If do it when the class is loaded with HotsSapper is OK, but i can't do it whith the HotSwapper because the application it's launched by Java Web Start and i haven't be able to open the needed socket.
If i try to modify the class before it's loaded i have an ClassCastException throwed by BasicOptionPaneUI. there is the code i use:
public class Test2 {
public static void main(String[] args) throws Exception {
ClassPool cp = ClassPool.getDefault();
CtClass cc = cp.get("javax.swing.JOptionPane");
CtMethod[] methods = cc.getMethods();
for (CtMethod method : methods) {
if (method.getName().equals("showConfirmDialog")) {
if(method.getLongName().equals("javax.swing.JOptionPane.showConfirmDialog(java.awt.Component,java.lang.Object, java.lang.String,int,int,javax.swing.Icon)")){
String after = "System.out.println(\"User answered: \" + $_ );";
method.insertAfter(after);
}
}
}
try{
Class c=cc.toClass();
c.newInstance();
}catch(CannotCompileException ex){
ex.printStackTrace();
}
JOptionPane.showConfirmDialog(null,"Yer or Not?");
}
}
Why is this happening? how can i fix it?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/725909#725909]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 3 months
[EJB3] - Re: Why application exceptions are wrapped in EJBException on AS 6.1?
by spangaer
spangaer [https://community.jboss.org/people/spangaer] created the discussion
"Re: Why application exceptions are wrapped in EJBException on AS 6.1?"
To view the discussion, visit: https://community.jboss.org/message/725880#725880
--------------------------------------------------------------
Ive put in in jboss\server\default\lib in a jar. And my a small modification to respect inheritence.
public class BMTTxInterceptorFactoryCustom extends BMTTxInterceptorFactory {
@SuppressWarnings("unused")
private static final Logger log = Logger.getLogger(BMTTxInterceptorFactoryCustom.class);
public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) {
// We have to do this until AOP supports matching based on annotation attributes
TransactionManagementType type = TxUtil.getTransactionManagementType(advisor);
if (type != TransactionManagementType.BEAN)
return new NullInterceptor();
TransactionManager tm = TxUtil.getTransactionManager();
boolean stateful = advisor.resolveAnnotation(Stateful.class) != null;
// Both MessageDriven and Stateless are stateless
if (stateful)
return new StatefulBMTInterceptor(tm);
else
return new StatelessBMTInterceptor(tm) {
@SuppressWarnings("unused")
protected void handleException(Invocation invocation, Exception ex) throws Exception {
if (ex == null) {
return;
}
ApplicationException ae = (ApplicationException) invocation.getAdvisor()
.resolveAnnotation(ApplicationException.class);
// it's an application exception, so just throw it back as-is
if (ae != null || ex.getClass().isAnnotationPresent(ApplicationException.class)
|| isApplicationExceptionPresentInParent(ex.getClass().getSuperclass())) {
throw ex;
}
if (ex instanceof EJBException) {
throw (EJBException) ex;
} else {
throw new EJBException(ex);
}
}
};
}
private boolean isApplicationExceptionPresentInParent(Class<?> parent) {
if (Object.class.equals(parent))
return false;
ApplicationException anot = parent.getAnnotation(ApplicationException.class);
if (anot != null)
return anot.inherited();
else
return isApplicationExceptionPresentInParent(parent.getSuperclass());
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/725880#725880]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 3 months