[JBoss Seam] - new features in beta
by Hoffa
is there something I have to follow, when I want to make use of the new exceptions.xml? I'd like a catch-all like it's described in the docs. So I just put
| <exceptions>
| <exception>
| <redirect view-id="/failure.xhtml">Unexpected failure</redirect>
| <end-conversation/>
| </exception>
| </exceptions>
|
in the exception.xml. And to test it I put inside an action-method
| if (true)
| throw new NullPointerException("exception test");
|
but still I see the seam debug page.
Another new feature I'm trying to figure out is the no-conversation-view-id for nodes. I understand that it is now possible to do something like:
| <page view-id="/members/*" no-conversation-view-id="/members/main.xhtml"/>
|
,right? But how?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987322#3987322
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987322
19Â years, 7Â months
[Messaging, JMS & JBossMQ] - MDB does not get messages
by artemgolubev
Hi,
My MDB bean does not get messages.
On deployment it writes:
INFO [EJBContainer] STARTED EJB: com.nexplore.messagebus.ShoppingCartDispatcher ejbName: queue/ShoppingCartDispatcher
WARN [MessagingContainer] Could not find the queue destination-jndi-name=queue/ShoppingCartDispatcher
WARN [MessagingContainer] destination not found: queue/ShoppingCartDispatcher reason: javax.naming.NameNotFoundException: ShoppingCartDispatcher not bound
WARN [MessagingContainer] creating a new temporary destination: queue/ShoppingCartDispatcher
INFO [ShoppingCartDispatcher] Bound to JNDI name: queue/ShoppingCartDispatcher
INFO [EJB3Deployer] Deployed: file:/C:/Apps/JBoss405/server/nexplore/deploy/mb-ejb.jar
MDB:
@MessageDriven(name="queue/ShoppingCartDispatcher",
activationConfig={
@ActivationConfigProperty(
propertyName="destination",
propertyValue="queue/ShoppingCartDispatcher"),
@ActivationConfigProperty(
propertyName="destinationType",
propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(
propertyName="messageSelector",
propertyValue="MessageFormat = 'Version 3.4'"),
@ActivationConfigProperty(
propertyName="acknowledgeMode",
propertyValue="Auto-acknowledge")})
public class ShoppingCartDispatcher implements MessageListener {
@EJB private ShoppingCartLocal shoppingCart;
public void onMessage(Message msg) {
try {
System.out.println("OK");
} catch (Exception e) {
...
}
}
}
Sender:
public @Stateless class ShoppingCartSenderBean implements ShoppingCartSender {
@Resource(mappedName="ConnectionFactory")
private ConnectionFactory connectionFactory;
@Resource(mappedName="queue/ShoppingCartDispatcher")
private Queue queue;
public void sendPayment(String item, String amount) throws JMSException {
Connection connect = connectionFactory.createConnection();
Session session = connect.createSession(true, 0);
ObjectMessage msg = session.createObjectMessage();
MessageProducer producer = session.createProducer(queue);
PayDTO pay = new PayDTO();
pay.setItem(item);
pay.setAmount(new BigDecimal(amount));
msg.setObject(pay);
producer.send(msg);
connect.close();
}
}
I can not find out what is the problem?
May be MDB annotation is incorrect?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987319#3987319
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987319
19Â years, 7Â months
[JCA/JBoss] - Re: XA Connection error
by bocio
"weston.price(a)jboss.com" wrote : Let me see if I can explain this a bit more clearly:
|
| In your case, it does not appear that you are leveraging CMT or using the UserTransaction object from JNDI to start/commit a transaction. If that is indeed the case, you are going to want to use the
|
| <no-tx-datasource>
|
| Using this requires you to do the setAutoCommit(false) and commit explicitly, otherwise, ever statement issued will be done in the context of a seperate JDBC transaction. In that scenario your *code* was correct, but the type of datasource was wrong.
|
| If you wanted to get away from managing your own transactions and leverage J2EE transaction management there are generally two approaches:
|
| 1) Use EJB (or some other declaractive transaction technology)
|
| 2) Use the UserTransaction object from JNDI to start/commit/rollback a transaction.
|
| Typically #2 is used with straight Web (non-EJB) applications and looks something like this:
|
| Servlet or JSP
|
|
| | Context ic = new InitialContext();
| | UserTransaction ut =
| | (UserTransaction) ic.lookup("java:comp/UserTransaction");
| | ut.begin();
| | // access resources transactionally here
| | ut.commit();
| |
| |
|
| What we are talking about is transaction 'boundaries'. Technologies like EJB(2/3) allow you to declare transactions on method boundaries. Servlets/JSP do not, but allow access to the UserTransaction object (as can be seen above).
|
| Note, either approach is neither 'right' or 'wrong', it's simply a matter of what your application requires. However, since you are running in a J2EE environment, CMT or UserTransaction delinated boundaries are typcially the preferred approach.
|
|
|
One of the best post on the topic.
Why don't you add this post on the wiki?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987314#3987314
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987314
19Â years, 7Â months