[JBoss ESB Development] - Exception handling between actions and ftp-listener
by Phillip Schulte
Phillip Schulte [http://community.jboss.org/people/phillip.schulte] created the discussion
"Exception handling between actions and ftp-listener"
To view the discussion, visit: http://community.jboss.org/message/564097#564097
--------------------------------------------------------------
Hello.
Thats one service in my jboss-esb.xml
<service category="de.eskalon.kn.garuda.invoice.HistoricalExchangeRates" name="HistoricalExchangeRateImporter" description="Imports historical exchange rates from ftp directory files" invmScope="GLOBAL">
<service category="de.eskalon.kn.garuda.invoice.HistoricalExchangeRates" name="HistoricalExchangeRateImporter" description="Imports historical exchange rates from ftp directory files" invmScope="GLOBAL">
<listeners>
<ftp-listener busidref="currency-ftp-in" is-gateway="true" maxThreads="2" name="ftp-listener-gateway" scheduleidref="everyminute" />
</listeners>
<actions mep="OneWay">
<action name="transform" class="org.jboss.soa.esb.actions.converters.ByteArrayToString">
<property name="encoding" value="UTF-8" />
</action>
<action name="properties" class="de.eskalon.kn.garuda.esb.GetPropertiesFromMessage"> </action>
<action class="org.jboss.soa.esb.actions.EJBProcessor" name="callPersist">
<property name="ejb3" value="true" />
<property name="jndi-name" value="garuda-invoicing/HistoricalExchangeRatesManagerBean/remote" />
<property name="initial-context-factory" value="org.jnp.interfaces.NamingContextFactory" />
<property name="provider-url" value="localhost:1099" />
<property name="method" value="persistRate" />
<property name="ejb-params">
<arg0 type="java.lang.String">FILE_NAME</arg0>
<arg1 type="java.lang.String">org.jboss.soa.esb.message.defaultEntry</arg1>
</property>
</action>
</actions>
</service>
<listeners>
And here my ftp-provider
<ftp-provider hostname="${currency.ftp.host}" name="currency-provider">
<ftp-bus busid="currency-ftp-in">
<ftp-message-filter directory="${currency.ftp.directory}" error-delete="false" error-suffix=".HAS_ERROR"
input-suffix=".csv"
passive="true" password="${currency.ftp.password}" post-delete="false" post-rename="true"
post-suffix=".COMPLETE" username="${currency.ftp.username}" work-suffix=".garudaWorking" />
</ftp-bus>
</ftp-provider>
So its possible tthat something goes wrong in my persistRate method. But in any case the ftp-listener will rename the file to <filename>.COMPLETE independently of throwing an exception in my method. So my question is how do I handle this correctly. What I want to have is, if anything goes wrong rename the file to <filename>.HAS_ERROR
Best regards
Phillip
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/564097#564097]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[JBoss Messaging Development] - Failed to write property - java.lang.NullPointerException - infinity messages
by Alexei J
Alexei J [http://community.jboss.org/people/a_subscriber] created the discussion
"Failed to write property - java.lang.NullPointerException - infinity messages"
To view the discussion, visit: http://community.jboss.org/message/565750#565750
--------------------------------------------------------------
JBoss AS 5.1 - success started
I have a simple jms application
private void run(String customerName) throws Exception {
try {
Context initial = new InitialContext();
ConnectionFactory cf = (ConnectionFactory) initial.lookup("/ConnectionFactory");
Destination notifyTopic = (Destination) initial.lookup("topic/testTopic");
Destination requestTopic = (Destination) initial.lookup("topic/testDurableTopic");
logger.trace("Creating Connection...");
connection = cf.createConnection();
connection.setClientID(customerName);
logger.trace("Creating Session...");
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
logger.trace("Creating MessageProducer to send messages to the specified destination. ...");
producer = session.createProducer(requestTopic);
logger.trace("Creating a MessageConsumer for the specified destination. ...");
consumer = session.createConsumer(notifyTopic);
logger.trace("Starts (or restarts) a connection's delivery of incoming messages...");
connection.start();
for (;;) {
listen(customerName);
}
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
} finally {
if (connection != null)
connection.close();
}
}
jndi.properties file:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099
I create jar and deploy it to the %JBOSS_HOME%/server/default/messaging/myapplication/customers/Xavier/
run application on the jboss:
java -cp myproject.jar;%JBOSS_HOME%/client/jbossall-client.jar com.mycompany.myproject.Customer Xavier
and I get infinity the next messages:
[11 ieo 2010 12:03:00.963] com.mycompany.myproject.Customer.main(Customer.java:123) TRACE:
Start customer
[11 ieo 2010 12:03:01.041] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
createSocket, hostAddr: localhost/127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0
[11 ieo 2010 12:03:01.713] org.jboss.logging.Logger.trace(Logger.java:160) TRACE:
org.jboss.aop.classpool.AOPClassPool@1389188011 [class path: sun.misc.Launcher$AppClassLoader@3326b249;] - dcl:sun.misc.Launcher$AppClassLoader@3326b249 creating pool for loader sun.misc.Launcher$AppClassLoader@3326b249 searchStrategy:org.jboss.aop.classpool.AOPClassPool$SearchAllRegisteredLoadersSearchStrategy@26302a05 isTemp:false
[11 ieo 2010 12:03:01.776] com.mycompany.myproject.Customer.run(Customer.java:69) TRACE:
Creating Connection...
[11 ieo 2010 12:03:01.807] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
Remoting version: 2.5.3.SP1 (Flounder)
[11 ieo 2010 12:03:01.822] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
Client[1699270891:5c4o56o-d5cpbk-gf547yym-1-gf547yym-2].connect(null)
[11 ieo 2010 12:03:01.822] org.jboss.logging.Logger.trace(Logger.java:160) TRACE:
Client[1699270891:5c4o56o-d5cpbk-gf547yym-1-gf547yym-2]: metadata = null
[11 ieo 2010 12:03:01.885] org.jboss.logging.Logger.trace(Logger.java:160) TRACE:
Mapping properties for bean: SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457]
[11 ieo 2010 12:03:01.885] org.jboss.logging.Logger.trace(Logger.java:160) TRACE:
Property editor found for: marshaller, editor: java.beans.PropertyDescriptor@40f7af00, setter: public void org.jboss.remoting.MicroRemoteClientInvoker.setMarshaller(org.jboss.remoting.marshal.Marshaller)
[11 ieo 2010 12:03:01.901] org.jboss.logging.Logger.trace(Logger.java:160) TRACE:
Failed to find property editor for: marshaller
[11 ieo 2010 12:03:01.901] org.jboss.logging.Logger.trace(Logger.java:171) TRACE:
Failed to write property
java.lang.NullPointerException
at org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(PropertyEditors.java:377)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.mapJavaBeanProperties(MicroSocketClientInvoker.java:1359)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.setup(MicroSocketClientInvoker.java:533)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.<init>(MicroSocketClientInvoker.java:292)
at org.jboss.remoting.transport.socket.SocketClientInvoker.<init>(SocketClientInvoker.java:78)
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.<init>(BisocketClientInvoker.java:166)
at org.jboss.remoting.transport.bisocket.TransportClientFactory.createClientInvoker(TransportClientFactory.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.remoting.InvokerRegistry.loadClientInvoker(InvokerRegistry.java:460)
at org.jboss.remoting.InvokerRegistry.createClientInvoker(InvokerRegistry.java:359)
at org.jboss.remoting.Client$6.run(Client.java:724)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.remoting.Client.connect(Client.java:720)
at org.jboss.remoting.Client.connect(Client.java:668)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:343)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$getClientAOPStack$aop(ClientConnectionFactoryDelegate.java:246)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPStack(ClientConnectionFactoryDelegate.java)
at org.jboss.jms.client.ClientAOPStackLoader.load(ClientAOPStackLoader.java:75)
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:192)
at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)
at com.mycompany.myproject.Customer.run(Customer.java:70)
at com.mycompany.myproject.Customer.main(Customer.java:127)
[11 ieo 2010 12:03:01.901] org.jboss.logging.Logger.trace(Logger.java:160) TRACE:
Property editor found for: timeout, editor: java.beans.PropertyDescriptor@5f20829f, setter: null
[11 ieo 2010 12:03:01.901] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
[11 ieo 2010 12:03:01.901] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] setting shouldCheckConnection to false
[11 ieo 2010 12:03:01.901] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] setting timeout to 300000
[11 ieo 2010 12:03:01.901] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] constructed
[11 ieo 2010 12:03:01.916] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
[11 ieo 2010 12:03:01.916] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] setting shouldCheckConnection to false
[11 ieo 2010 12:03:01.916] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] setting timeout to 300000
[11 ieo 2010 12:03:01.916] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] connecting
[11 ieo 2010 12:03:01.916] org.jboss.logging.Logger.debug(Logger.java:228) DEBUG:
Creating semaphore with size 50
[11 ieo 2010 12:03:01.932] org.jboss.logging.Logger.trace(Logger.java:160) TRACE:
SocketClientInvoker[2afa14cb, bisocket://127.0.0.1:4457] added new pool ([]) as ServerAddress[127.0.0.1:4457, NO enableTcpNoDelay timeout 300000 ms, maxPoolSize=50]
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/565750#565750]
Start a new discussion in JBoss Messaging Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[JBoss AS7 Development] - Checkstyle
by David Lloyd
David Lloyd [http://community.jboss.org/people/david.lloyd%40jboss.com] created the discussion
"Checkstyle"
To view the discussion, visit: http://community.jboss.org/message/560961#560961
--------------------------------------------------------------
I've introduced checkstyle into the AS7 codebase. Right now it prints violations out on the console, however in the (near) future it will cause the build to fail if a violation is detected.
This means a few things.
1. Make sure your patches do not introduce new violations.
2. People with topic branches beware: at some point (soon) the existing violations in trunk will be fixed, which can cause merge conflicts when a rebase is performed *unless* you rebase using this command: *git --whitespace=fix rebase upstream/master*
3. To avoid productivity loss in the future, make sure your IDE matches the code style, in particular the following points:1. Strip trailing whitespace from modified lines
2. Do *not* use tab characters under any circumstances
3. Remove unused and star imports, or imports of classes from the same package
4. Do not specify redundant modifiers (like "public" on interface methods)
The existing violation corrections will be going in over the next couple of days; once they're all gone, the build will no longer proceed if a violation is introduced.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/560961#560961]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[jBPM Development] - Impossible to get group tasks paged and ordered
by Fabio Spiga
Fabio Spiga [http://community.jboss.org/people/Spiga] created the discussion
"Impossible to get group tasks paged and ordered"
To view the discussion, visit: http://community.jboss.org/message/566407#566407
--------------------------------------------------------------
Hi everybody,
I need to get the group tasks for which a user is candidate in a manner ORDERED e PAGED, so the API findGroupTasks is not sufficient.
Therefore, I have replaced findGroupTasks() with the following code:
+ taskList = getTaskService().createTaskQuery()
.candidate(filter.getUsername())
.orderDesc(TaskQuery.PROPERTY_CREATEDATE)
.page(startRow, maxResults)
.list();+
The problem is that the resulting list is not ordered.
By debugging jBPM sources, I've found that the problem is in the class org.jbpm.pvm.internal.query.TaskQueryImpl within the method
+public String hql()+
Here the ORDER BY clause is added only if I'm not searching for Candidate. The original code is the following:
+....
+
+if (candidate == null && !count)
appendOrderByClause(hql);+
+....+
Why in your opinion is there such a condition?
How can I do to obtain an ordered and paged list for a candidate user?
Thanks you in advance,
Fabio
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/566407#566407]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[jBPM Development] - Create a flexible workflow and deploy it in JBPM on the fly
by Thee R
Thee R [http://community.jboss.org/people/thee] created the discussion
"Create a flexible workflow and deploy it in JBPM on the fly"
To view the discussion, visit: http://community.jboss.org/message/567144#567144
--------------------------------------------------------------
Hi Experts,
I'm a new JBPM starter and looking for a solution to create a flexible workflow. I've a requirement to use Spring platform connecting to JBPM.
User story: Tom wants to create a workflow which requires 1)John, 2)Mike and 3)David to approve a job respectively. Someday later, Tom want to add Mary to be a new approver parallel with Mike. Mary and Mike both have to approve before going to David. The new workflow is 1)John, 2) Mike and Mary and 3)David. All inprogress jobs, which David is reviewing and not submit yet, have to be sent back to be reviewed by Mary as well.
Limitation: Tom can edit the workflow on the fly without modifying Java code and restarting JBPM.
I know Anees advised how to create the workflow programmatically in http://aneesjavaee-osgi.blogspot.com/2008/08/creating-jbpm-workflow-progr... http://aneesjavaee-osgi.blogspot.com/2008/08/creating-jbpm-workflow-progr.... So I can create a workflow programmatically on the fly. However as I know, may be wrong, I have to stop JBPM and deploy the workflow.
Is there anybody has an experience with this kind of requirement? Please advise.
Thanks & Regards,
Thee
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/567144#567144]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[JBoss ESB Development] - Re: JCRMessageStoreImpl store only message body?
by jack lista
jack lista [http://community.jboss.org/people/jackalista] created the discussion
"Re: JCRMessageStoreImpl store only message body?"
To view the discussion, visit: http://community.jboss.org/message/572331#572331
--------------------------------------------------------------
I am looking at the MessageStore and am interested in a browse-able, query-able interface for the store, and came across this and another thread talking about using JCR implemetations as either the store itself or as merely a way to provide JCR functionality with the message being stored elsewhere (I'm assuming the actual store would still be inm the DB in this case?).
I did find the JCRMessageStoreImpl class, I'm not familiar with the code per se but it looks like the payload is being extracted so I'd guess that the entire message is not being stored, is this correct? That also seems to be the status put forth by a few JIRA entries ( https://jira.jboss.org/browse/JBESB-1769 https://jira.jboss.org/browse/JBESB-1769, https://jira.jboss.org/browse/JBESB-2205 https://jira.jboss.org/browse/JBESB-2205, https://jira.jboss.org/browse/MODE-119 https://jira.jboss.org/browse/MODE-119 & https://jira.jboss.org/browse/MODE-280 https://jira.jboss.org/browse/MODE-280) and the consensus seems to be that the use of this JCR technology for the MessageStore will not be as useful as one might want without the entire message being stored.
Is this the current status of this stuff and am I understanding the situation correctly? So I'm guessing that this does not provide a way to browse and query a MessageStore? Long story short, I'm looking for an audit oriented MessageStore with as high level an API as possible, and not sure what functinality exists and where it's headed, I'd like to leverage the work you guys are doing if it makes sense but I am not sure what the best current thinking is on this and am searching this stuff to try to figure it out. It kind of looks like this stuff is either a dead end, or perhaps is slated for dev sometime in the future but I can't tell which.
Can anyone advise on the best currently available MessageStore functionality for browsing and querying the MessageStore and any other needed functionality to provide audit logging features? Or, if appropriate, can you share what road map exists so that we can use what's there now and remain properly positioned to be ready to take advanatage of further features as they come online? Thanks...
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/572331#572331]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years