[JBoss Seam] - Re: Stateless Converter: First works, then ClassNotFoundExce
by bfo81
Hm... my cheers were to early. It's really funny, but the debug log goes like this:
Calling the edit page
em=org.hibernate.ejb.EntityManagerImpl@d8f5e8
Submitting the edit page plus redisplay afterwards (validation fault)
em=null
Cancelling, going back to list and editing something else
em=org.hibernate.ejb.EntityManagerImpl@3eed51
The EntityManager never stays the same. Sometimes it's null, and when not it's always newly instantiated (see the code at the end of org.hibernate...@).
Maybe it's the right time to finally post some code ;)
package de.beffo.test.converter;
|
| import javax.faces.component.UIComponent;
| import javax.faces.context.FacesContext;
| import javax.faces.convert.Converter;
| import javax.faces.convert.ConverterException;
| import javax.interceptor.Interceptors;
| import javax.persistence.EntityManager;
|
| import org.apache.commons.logging.LogFactory;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.ejb.SeamInterceptor;
|
| import de.beffo.test.model.Person;
|
| //@Stateless
| @Scope(ScopeType.SESSION)
| @Name("personConverter")
| @Interceptors(SeamInterceptor.class)
| public class PersonConverterBean implements Converter {
|
| @In(create=true)
| private EntityManager em;
|
| public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) throws ConverterException {
| LogFactory.getLog(this.getClass()).info("getAsObject: string=" + string + " em="+em);
| return new Person();//em.find(Person.class, Long.parseLong(string));
| }
|
| public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) throws ConverterException {
| LogFactory.getLog(this.getClass()).info("getAsString: object=" + object + " em=" +em);
|
| return object.toString();
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961052#3961052
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961052
19 years, 9 months
[JBoss jBPM] - missing
by mgommeringer
AFAIK, there is only one default destination for all async nodes (see org.jbpm.graph.def.Node and org.jbpm.command.ExecuteNodeCommand).
Since I'd like to use multiple CommandExecutorThread instances on different machines, I can configure them so that every CommandExecutorThread has its own destination:
| CommandExecutorThread cet = new CommandExecutorThread(JbpmConfiguration.getInstance());
| cet.setDestination("myDest");
| cet.start();
|
But at the current state, this CommandExecutorThread will never receive a message because all generated async messages have the destination "CMD_EXECUTOR" (see org.jbpm.command.Command.DEFAULT_CMD_DESTINATION).
Is it planned to add an additional "destination" attribute to the "node" class which can be set for async nodes?
I would find this very useful.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961051#3961051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961051
19 years, 9 months
[Messaging, JMS & JBossMQ] - Apparent threading issue in JMS client initialization
by mdpoindexter
I am using a multi-threaded client of JbossMQ which does the following:
1.) Creates a Connection on the main thread
2.) Spawns n client threads. On start, each client thread then aquires a Session from the Connection, and a MessageConsumer from the Session it created. Once the MessageConsumer is created the thread goes into a loop calling receive() on the MessageConsumer. Note that all of this has quite possibly occured before calling start() on the Connection. All this should be allowed by the spec as Connection is a thread safe object.
3.) Calls Connection.start() on the main thread.
The problem I am seeing is that I intermittently get
javax.jms.JMSException: The provided subscription does not exist
at org.jboss.mq.server.ClientConsumer.getSubscription(ClientConsumer.java:365)
at org.jboss.mq.server.JMSDestinationManager.getSubscription(JMSDestinationManager.java:867)
at org.jboss.mq.server.JMSServerInterceptorSupport.getSubscription(JMSServerInterceptorSupport.java:319)
at org.jboss.mq.security.ServerSecurityInterceptor.receive(ServerSecurityInterceptor.java:96)
at org.jboss.mq.server.TracingInterceptor.receive(TracingInterceptor.java:535)
...
Looking through the code of the interceptor stack, I believe the problem to be in the JMSDestinationManager. For several operations, including adding a MessageConsumer, it calls the method getClientConsumer(ConnectionToken tok). This method lazily creates a ClientConsumer for a given connection token the first time it is called for the connection token. This method is not synchronized in any way, so I'm guessing adding multiple MessageConsumer simultaneously triggers the creation of multiple ClientConsumer objects due to this lack of synchronization. This then leads to the stack trace above since the ClientConsumer cached for the connection token does not have all the subscriptions, since some subscriptions were mistakenly created on other ClientConsumers due to the race condition.
Is there some sort of synchronization going on here that I'm missing or is this a bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961048#3961048
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961048
19 years, 9 months
[JBoss Seam] - Re: Stateless Converter: First works, then ClassNotFoundExce
by bfo81
@petemuir:
I thought about that, too. But it's somehow unaesthetic. In this respect I'm like a little child: If there is Dependency Injection I want to have it ;).
@thomas:
Ooops. That's something I overread in the manual. Since working with EJBs all the time this was the first time I encountered problems with leaving out the Interceptor. So thanks for the hint, the Bean works now :).
But a few questions to understand everything better:
- All beans need a SeamInterceptor, otherwise Injection doesn't work, right?
- With ejb-jar.xml it's possible to put that Interceptor around every EJB automatically without needing to add it to every single EJB explicitly (very nice), correct?
- But: Why aren't there any Interceptors in the Hibernate example? I mean the action beans have a LoginInterceptor that calls BijectionInterceptor etc., but what about the entity beans?
Plus: I'm still wondering very much why the EJB converter first worked and then not.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961045#3961045
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961045
19 years, 9 months
[JBossWS] - jbossws-1.0.2 released
by heiko.braun@jboss.com
As of this post I am happy to anounce that jbossws-1.0.2.GA is released. It is a drop in replacement for jbossws-1.0.0.GA in JBossAS-4.0.4.GA and also works in standalone Tomcat. This allows you to develop standard portable J2EE-1.4 web service endpoints in Tomcat that can be deployed to JBoss whenever full app server support is required.
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWS102Install
http://labs.jboss.com/portal/jbossws/user-guide/en/html/installation.html
What's new
----------
* [JBWS-855] - Provide MTOM for document/literal
* [JBWS-920] - integrate wstools wsdl2java functionality
* [JBWS-921] - integrate wstools java2wsdl functionality
* [JBWS-992] - Tools - Java to WSDL - Facility to Ignore collections
* [JBWS-1003] - Ignore collection types in java-wsdl
* [JBWS-950] - Attributes of type xsd:QName incorrectly serialized
* [JBWS-961] - XOP: Incorrect Content-ID
* [JBWS-994] - ContextServlet search for a class that is not present in the distribution package
* [JBWS-997] - wsdl-java generates incorrect java types for base64binary values
* [JBWS-998] - wsdl-java does not correctly uppercase parameter and return types on an SEI
* [JBWS-1006] - JBossWS does not deploy on an installer generated JBoss 4.0.4.GA instance
* [JBWS-1011] - NullPointerException deploying JSR-109 deployment that contains entity beans.
* [JBWS-1027] - QName namespaces are not marshalled
* [JBWS-1049] - Namespace to package mapping does not work as described
* [JBWS-1068] - Cannot handle xsd:import of xml schema
* [JBWS-1072] - SecurityConfig not parsed for 181 deployments
* [JBWS-1073] - HandlerMeta data does not reflect "port-name" config
* [JBWS-1074] - Handler meta data does not reflect "soap-header" config
* [JBWS-1010] - Support for inherited service endpoint interfaces - JAX-RPC 5.5.4
For details see the change log.
http://jira.jboss.com/jira/browse/JBWS?report=com.atlassian.jira.plugin.s...
--
Have fun,
the JBossWS Team
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961036#3961036
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961036
19 years, 9 months