[JBoss Messaging] - MDB Message Visibility Redux
by thammoud
Hello,
This topic has been discussed several times before. Basically, the commit order when a row is inserted into the database and a JMS message notifying interested listeners of that fact. Given that JTA does not dictate the commit order, the MDB might get the message first without the row being comitted in the database. This is a serious shotcoming yet a very common pattern that we all use.
Most answers in the forum suggest not having to depend on the transaction manager implementation. However, no suggestions is given on how to work around this issue.
In our implementation, we must be getting lucky because we do not see the problem. Just because we do not see it, it does not mean it is not there. Are we getting lucky because our code is somehow enlisting the DB Datasource before JMSXA? Is the JMS layer enlisting itself "last" in the resource list?
Does anyone have a suggestion or a pattern on how to get around this issue without major "reinventing the wheel" or adding a delivery delay to the MDB? We have a requirement of the message being processed as soon as a record is inserted in the database.
We are migrating away from the combination of JBOSSMQ and ActiveMQ to JBOSS messaging and it truly has been great working with this product. Thank you very much.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209093#4209093
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209093
17 years, 5 months
[Beginners Corner] - Re: EJB3 on Oracle
by kkangsar
Thanks for your fast response.
I have configured the persistence.xml as below:
<persistence-unit name="examplePersistenceUnit">
<jta-data-source>java:/OracleDS</jta-data-source>
</persistence-unit>
and created Oracle database source (oracle-ds.xml) in deployed folder.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: oracle-ds.xml 23720 2004-09-15 14:37:40Z loubyansky $ -->
<!-- ==================================================================== -->
<!-- Datasource config for Oracle originally from Steven Coy -->
<!-- ==================================================================== -->
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@localhost:1521:wm</connection-url>
<!--
Here are a couple of the possible OCI configurations.
For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.92...
<connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
or
<connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
Clearly, its better to have TNS set up properly.
-->
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>wm</user-name>
wm
<!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
<!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource>
Is it enough to link to oracle database?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209092#4209092
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209092
17 years, 5 months
[Management, JMX/JBoss] - Re: Bug? Multiple interfaces in the implementation causes De
by jaikiran
anonymous wrote : @Service(objectName=StaffImportScanner.OBJECT_NAME)
| | @Management(StaffImportScannerService.class)
| | public class StaffImportScanner implements StaffImportScannerService, TriggerListener {
| | ...
| | }
| |
|
|
|
| TriggerListener is an interface from the quartz framework. StaffImportScannerService is an own defined interface that I want to expose.
@Service is an extension to EJB3 session beans. So the @Service should have either a remote or local business interface defined. If you don't specify the local or remote business interface (either through xml or through annotation), then the server tries to discover this information. So if you have something like:
| @Service(objectName=StaffImportScanner.OBJECT_NAME)
| @Management(StaffImportScannerService.class)
| public class StaffImportScanner implements StaffImportScannerService
The server will consider the StaffImportScannerService as the @Local business interface (even though you haven't explicitly specified that). This works when the bean class implements just one interface. If the class implements more than one interface, then there is no way to infer which one of the interfaces is expected to be the business interface of the bean. And hence the error. In such cases, the bean developer is expected to explicitly specify either the @Local or @Remote interface (through annotation or xml). Here's how you can do it through annotation:
@Service(objectName=StaffImportScanner.OBJECT_NAME)
| @Management(StaffImportScannerService.class)
| @Remote (StaffImportScannerService.class)
| public class StaffImportScanner implements StaffImportScannerService, TriggerListener {
| ...
| }
|
|
It's upto you to decide whether you want @Remote or @Local.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209089#4209089
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209089
17 years, 5 months
[JBossWS] - Receiving Compressed WebService Requests
by hannes.koller
Hi,
I have built a simple JAX-WS WebService (on JBoss 4.2.3.GA) which is supposed to receive a rather large data structure from clients. In order to speed up the transmission I would like the clients of my service to use http compressed requests.
I have tried using SoapUI to test the service. As long as I turn off request compression in SoapUI everything works fine. When I set Request compression to "GZIP" or "DEFLATE" I get the following error from JBoss:
| 14:35:33,042 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| org.jboss.ws.core.CommonSOAPFaultException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
| at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:93)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:280)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:195)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:447)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:284)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:201)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:134)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
|
It appears that the request is not uncompressed before it is forwarded to the SAX Parser. I am wondering how I can tell JBoss to run compressed requests through gzip before passing them to the SAX Parser? Or is it possible to write a custom HttpConnectionHandler in order to perform request decompression? I would be most thankful for any pointers you can give me. TIA :)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209073#4209073
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209073
17 years, 5 months