[Beginners Corner] - Re: jBoss and Hibernate
by MarcelK1607
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
| at $Proxy2.findMedewerker(Unknown Source)
| at nl.capgemini.inzetmanagement.client.Client.main(Client.java:27)
| Caused by: java.lang.ClassNotFoundException: org.hibernate.hql.ast.QuerySyntaxException
| at org.jboss.remoting.serialization.ClassLoaderUtility.loadClass(ClassLoaderUtility.java:103)
| at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:86)
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
| at java.lang.Class.forName0(Native Method)
This happens when i use this code:
@Override
| public Medewerker findMedewerker(int id) {
| Query createQuery = entityManager.createQuery("SELECT m FROM medewerker m");
| Collection<Medewerker> result = createQuery.getResultList();
| System.out.println(result);
| return null;
| }
Ths is what I put in my remote bean.
So do I have something missing in my libs? Do i need hibernate in the libs dir?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241481#4241481
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241481
16 years, 9 months
[JBoss Messaging] - Bridge Stuck after reconnect
by mclu
Using 1.4.4 GA
I have 2 Servers where messages are bridged from 2 Queues via 2 bridges.
Server A Server B
outgoing >>---OutgoingBridge_Liberte2--->> local_outgoing
incoming <<---IncomingBridge_Liberte2---<< local_incoming
Sometimes the messages stuck at the Server B site:
Before that happens the bridge losts the connection and reconnects. Here are the logs:
13:49:37,942 WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] [com.arjuna.ats.internal.jta.resources.arjunacore.preparefailed] XAResourceRecord.prepare - prepare failed with exception XAException.XA_RETRY
| 13:49:37,942 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_36] - BasicAction.End() - prepare phase of action-id a046bd8:bcc:4a4c98a3:2fdbb failed.
| 13:49:37,942 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_38] - Action Aborting
| 13:49:38,223 WARN [org.jboss.jms.server.bridge.Bridge] jboss.messaging:name=OutgoingBridge_Liberte2,service=Bridge Failed to send + acknowledge batch, closing JMS objects
| javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
| at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commit(TransactionImple.java:255)
| at org.jboss.jms.server.bridge.Bridge.sendBatchXA(Bridge.java:1322)
| at org.jboss.jms.server.bridge.Bridge.sendBatch(Bridge.java:1382)
| at org.jboss.jms.server.bridge.Bridge.access$2000(Bridge.java:68)
| at org.jboss.jms.server.bridge.Bridge$BatchTimeChecker.run(Bridge.java:1648)
| at java.lang.Thread.run(Unknown Source)
| 13:49:38,426 WARN [org.jboss.remoting.Client] unable to remove remote callback handler: Can not remove callback listener from target server with id of a42z60-xlstvn-fwne1cca-1-fwne21xq-27+a42z60-xlstvn-fwne1cca-1-fwne21y6-2a as it does not exist as a registered callback listener.
| 13:49:38,442 ERROR [org.jboss.jms.client.container.ClosedInterceptor] ClosedInterceptor.ClientSessionDelegate[c2-mb22enwf-1-acc1enwf-nvtslx-06z24a]: method getXAResource() did not go through, the interceptor is CLOSED
| 13:49:38,442 WARN [org.jboss.jms.server.bridge.Bridge] jboss.messaging:name=OutgoingBridge_Liberte2,service=Bridge Will retry after a pause of 10000 ms
| 13:49:49,598 INFO [org.jboss.jms.server.bridge.Bridge] jboss.messaging:name=OutgoingBridge_Liberte2,service=Bridge Succeeded in reconnecting to servers
|
After that I have some messages in the incoming. And it seams that the incomming bridge is not working anymore.
After I restarted the bridges and the Queues it starts bridging again.
See log:
| 14:00:17,266 INFO [Aeos.BridgeGeneratorServiceImpl] Stopping bridge 'jboss.messaging:name=IncommingBridge_Liberte2,service=Bridge'.
| 14:00:18,688 WARN [org.jboss.remoting.Client] unable to remove remote callback handler: Can not remove callback listener from target server with id of a42z60-xlstvn-fwne1cca-1-fwne1zkn-1f+a42z60-xlstvn-fwne1cca-1-fwne21ij-1m as it does not exist as a registered callback listener.
| 14:00:18,688 INFO [Aeos.BridgeGeneratorServiceImpl] Stopping bridge 'jboss.messaging:name=OutgoingBridge_Liberte2,service=Bridge'.
|
| ... see that the Warning is on the incoming bridge.
|
| 14:01:45,250 INFO [Aeos.BridgeGeneratorServiceImpl] Started bridge jboss.messaging:name=IncommingBridge_Liberte2,service=Bridge. Source: /queue/local_incomingSyncRequests Target: /queue/incomingSyncRequests
| 14:01:45,968 INFO [Aeos.BridgeGeneratorServiceImpl] Started bridge jboss.messaging:name=OutgoingBridge_Liberte2,service=Bridge. Source: /queue/outgoingSyncRequests_Liberte2 Target: /queue/local_outgoingSyncRequests
|
After restarting the 2 Bridges the messages are send again...
I use a self written BridgeGeneratorServiceImpl that dynamically configures and starts the Bridge.
The transport is ssl.
Any Idea why the message stuck after this connection error at the other bridge?
Greets
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241479#4241479
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241479
16 years, 9 months
[JBossWS] - sending Soap message with timeout
by sbutt
Hi Folks,
I have implemented a basic soap client (javax.xml.soap.*).
|
| public Message processSOAPRequest(Message message) {
| try {
| MessageFactory msgFactory = MessageFactory.newInstance();
| SOAPMessage soap = msgFactory.createMessage();
| SOAPPart soapPart = soap.getSOAPPart();
|
| byte[] buffer = ((String) message.getBody().get()).getBytes();
| ByteArrayInputStream stream = new ByteArrayInputStream(buffer);
| StreamSource source = new StreamSource(stream);
| soapPart.setContent(source);
| String action = config.getAttribute(SOAP_ACTION);
| if (action != null) {
| MimeHeaders headers = soap.getMimeHeaders();
| headers.addHeader("SOAPAction", action);
| }
|
| /////////////////////////////////////////////////////////
|
| SOAPMessage reply = sendSOAPMessage(soap);
|
| /////////////////////////////////////////////////////////
|
| ByteArrayOutputStream out = new ByteArrayOutputStream();
| reply.writeTo(out);
| String soapMessage = new String(out.toByteArray());
| message.getBody().add(soapMessage);
|
| } catch (SOAPException e) {
| logger.error("SOAPException : " + e);
|
| } catch (IOException e) {
| logger.error("IOException : " + e);
| }
|
| return message;
|
| }
|
|
| private SOAPMessage sendSOAPMessage(SOAPMessage soap) {
| SOAPConnection connection = null;
| SOAPMessage reply = null;
| try {
| SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory
| .newInstance();
| connection = soapConnFactory.createConnection();
| String destination = config.getAttribute(URL_ENDPOINT);
|
| reply = connection.call(soap, destination);
|
|
|
| } catch (Exception e) {
| logger.error(e);
| } finally {
| try {
| if (connection != null) {
| connection.close();
| }
| } catch (SOAPException e) {
| logger.error(e);
| }
| }
|
| return reply;
| }
|
|
The input message is JBossEsb message, which I convert to soap message and then send it using SOAPConnection, which works fine.
The problem with SOAPConnection class is that it does not provide setTimeout(..) method. I read some where that there is another class SOAPConnectionImpl (by axis), which extends SOAPConnection and has this setTimeout method.
I have tried to convert my existing implementation to SOAPConnectionImpl but i always get a classcast exceptions.
Could somebody help me in suggesting a solution to this problem? My main concern is to include timeout feature that is my WS consumer/client should timeout after a certain period if the server does not reply.
Any other soap message sending implementation with timeout feature are also good.
I have included
| <dependency>
| <groupId>axis</groupId>
| <artifactId>axis</artifactId>
| <version>1.4</version>
| </dependency>
|
maven dependencies for axis.
Awaiting replies.
Thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241472#4241472
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241472
16 years, 9 months