[JBossWS] - MTOM enabled webservice, no access to base64 fields / not ma
by mfueser
Hi!
I am building an MTOM enabled Webservice. A client sends in SOAP with MTOM enabled. The Mapping to the XML structures is working so far, but I dot have access to the "document"-tag part of the message. The resulting document list is always empty.
This is a message sent by the client:
| -MIMEBoundaryurn_uuid_3B788247A69DDDCBAE1233055309739
| Content-Type:
| application/xop+xml; charset=UTF-8; type="application/soap+xml"
| Content-Transfer-Encoding: binary
| Content-ID: <0.urn:uuid:3B788247A69DDDCBAE1233055309740@apache.org>
|
| <?xml version='1.0' encoding='UTF-8'?>
| <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
| xmlns:wsa="http://www.w3.org/2005/08/addressing">
| <soapenv:Header>
| <wsa:To>http://localhost:8888/Repository/Repository
| </wsa:To>
| <wsa:MessageID>urn:uuid:3B788247A69DDDCBAE1233055309629
| </wsa:MessageID>
| <wsa:Action>urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b
| </wsa:Action>
| </soapenv:Header>
| <soapenv:Body>
| <xdsb:ProvideAndRegisterDocumentSetRequest
| xmlns:xdsb="urn:ihe:iti:xds-b:2007">
| <lcm:SubmitObjectsRequest
| xmlns:lcm="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0">
| <rim:RegistryObjectList
| xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
| <rim:ExtrinsicObject id="Document01" mimeType="text/plain"
| objectType="urn:uuid:7edca82f-054d-47f2-a032-9b2a5b5186c1">
| <rim:Slot name="creationTime">
| <rim:ValueList>
| <rim:Value>20051224</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="languageCode">
| <rim:ValueList>
| <rim:Value>en-us</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="serviceStartTime">
| <rim:ValueList>
| <rim:Value>200412230800</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="serviceStopTime">
| <rim:ValueList>
| <rim:Value>200412230801</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="sourcePatientId">
| <rim:ValueList>
| <rim:Value>89765a87b^^^fj34r</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="sourcePatientInfo">
| <rim:ValueList>
| <rim:Value>PID-3|pid1^^^domain</rim:Value>
| <rim:Value>PID-5|Doe^John^^^</rim:Value>
| <rim:Value>PID-7|19560527</rim:Value>
| <rim:Value>PID-8|M</rim:Value>
| <rim:Value>PID-11|100 Main St^^Metropolis^Il^44130^USA
| </rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="Physical"></rim:LocalizedString>
| </rim:Name>
| <rim:Description></rim:Description>
| <rim:Classification
| classificationScheme="urn:uuid:93606bcf-9494-43ec-9b4e-a7748d1a838d"
| classifiedObject="Document01" nodeRepresentation=""
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_1">
| <rim:Slot name="authorPerson">
| <rim:ValueList>
| <rim:Value>^Smitty^Gerald^^^</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorInstitution">
| <rim:ValueList>
| <rim:Value>Cleveland Clinic</rim:Value>
| <rim:Value>Parma Community</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorRole">
| <rim:ValueList>
| <rim:Value>Attending</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorSpecialty">
| <rim:ValueList>
| <rim:Value>Orthopedic</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:93606bcf-9494-43ec-9b4e-a7748d1a838d"
| classifiedObject="Document01" nodeRepresentation=""
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_2">
| <rim:Slot name="authorPerson">
| <rim:ValueList>
| <rim:Value>^Dopplemeyer^Sherry^^^
| </rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorInstitution">
| <rim:ValueList>
| <rim:Value>Cleveland Clinic</rim:Value>
| <rim:Value>Berea Community</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorRole">
| <rim:ValueList>
| <rim:Value>Primary Surgon</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorSpecialty">
| <rim:ValueList>
| <rim:Value>Orthopedic</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:41a5887f-8865-4c09-adf7-e362475b143a"
| classifiedObject="Document01" nodeRepresentation="History and Physical"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_3">
| <rim:Slot name="codingScheme">
| <rim:ValueList>
| <rim:Value>Connect-a-thon classCodes</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="History and Physical"></rim:LocalizedString>
| </rim:Name>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:f4f85eac-e6cb-4883-b524-f2705394840f"
| classifiedObject="Document01" nodeRepresentation="1.3.6.1.4.1.21367.2006.7.101"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_4">
| <rim:Slot name="codingScheme">
| <rim:ValueList>
| <rim:Value>Connect-a-thon confidentialityCodes
| </rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="Clinical-Staff"></rim:LocalizedString>
| </rim:Name>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:a09d5840-386c-46f2-b5ad-9c3699a4309d"
| classifiedObject="Document01" nodeRepresentation="CDAR2/IHE 1.0"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_5">
| <rim:Slot name="codingScheme">
| <rim:ValueList>
| <rim:Value>Connect-a-thon formatCodes</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="CDAR2/IHE 1.0"></rim:LocalizedString>
| </rim:Name>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:f33fb8ac-18af-42cc-ae0e-ed0b0bdb91e1"
| classifiedObject="Document01" nodeRepresentation="Outpatient"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_6">
| <rim:Slot name="codingScheme">
| <rim:ValueList>
| <rim:Value>Connect-a-thon
| healthcareFacilityTypeCodes</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="Outpatient"></rim:LocalizedString>
| </rim:Name>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:cccf5598-8b07-4b77-a05e-ae952c785ead"
| classifiedObject="Document01" nodeRepresentation="General Medicine"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_7">
| <rim:Slot name="codingScheme">
| <rim:ValueList>
| <rim:Value>Connect-a-thon practiceSettingCodes
| </rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="General Medicine"></rim:LocalizedString>
| </rim:Name>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:f0306f51-975f-434e-a61c-c59651d33983"
| classifiedObject="Document01" nodeRepresentation="34108-1"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_8">
| <rim:Slot name="codingScheme">
| <rim:ValueList>
| <rim:Value>LOINC</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="Outpatient Evaluation And Management"></rim:LocalizedString>
| </rim:Name>
| </rim:Classification>
| <rim:ExternalIdentifier
| identificationScheme="urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427"
| value="fca50fea3a5e41a^^^&1.3.6.1.4.1.21367.2005.3.7&ISO"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExternalIdentifier"
| id="id_9" registryObject="Document01">
| <rim:Name>
| <rim:LocalizedString value="XDSDocumentEntry.patientId"></rim:LocalizedString>
| </rim:Name>
| </rim:ExternalIdentifier>
| <rim:ExternalIdentifier
| identificationScheme="urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab"
| value="129.6.58.92.21012357"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExternalIdentifier"
| id="id_10" registryObject="Document01">
| <rim:Name>
| <rim:LocalizedString value="XDSDocumentEntry.uniqueId"></rim:LocalizedString>
| </rim:Name>
| </rim:ExternalIdentifier>
| </rim:ExtrinsicObject>
| <rim:RegistryPackage id="SubmissionSet01"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:RegistryPackage">
| <rim:Slot name="submissionTime">
| <rim:ValueList>
| <rim:Value>20041225235050</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="Physical"></rim:LocalizedString>
| </rim:Name>
| <rim:Description>
| <rim:LocalizedString value="Annual physical"></rim:LocalizedString>
| </rim:Description>
| <rim:Classification
| classificationScheme="urn:uuid:a7058bb9-b4e4-4307-ba5b-e3f0ab85e12d"
| classifiedObject="SubmissionSet01" nodeRepresentation=""
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_11">
| <rim:Slot name="authorPerson">
| <rim:ValueList>
| <rim:Value>^Dopplemeyer^Sherry^^^
| </rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorInstitution">
| <rim:ValueList>
| <rim:Value>Cleveland Clinic</rim:Value>
| <rim:Value>Berea Community</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorRole">
| <rim:ValueList>
| <rim:Value>Primary Surgon</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Slot name="authorSpecialty">
| <rim:ValueList>
| <rim:Value>Orthopedic</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| </rim:Classification>
| <rim:Classification
| classificationScheme="urn:uuid:aa543740-bdda-424e-8c96-df4873be8500"
| classifiedObject="SubmissionSet01" nodeRepresentation="History and Physical"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"
| id="id_12">
| <rim:Slot name="codingScheme">
| <rim:ValueList>
| <rim:Value>Connect-a-thon contentTypeCodes
| </rim:Value>
| </rim:ValueList>
| </rim:Slot>
| <rim:Name>
| <rim:LocalizedString value="History and Physical"></rim:LocalizedString>
| </rim:Name>
| </rim:Classification>
| <rim:ExternalIdentifier
| identificationScheme="urn:uuid:96fdda7c-d067-4183-912e-bf5ee74998a8"
| value="129.6.58.92.21012358"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExternalIdentifier"
| id="id_13" registryObject="SubmissionSet01">
| <rim:Name>
| <rim:LocalizedString value="XDSSubmissionSet.uniqueId"></rim:LocalizedString>
| </rim:Name>
| </rim:ExternalIdentifier>
| <rim:ExternalIdentifier
| identificationScheme="urn:uuid:554ac39e-e3fe-47fe-b233-965d2a147832"
| value="1.3.6.1.4.1.21367.2009.1.2.182"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExternalIdentifier"
| id="id_14" registryObject="SubmissionSet01">
| <rim:Name>
| <rim:LocalizedString value="XDSSubmissionSet.sourceId"></rim:LocalizedString>
| </rim:Name>
| </rim:ExternalIdentifier>
| <rim:ExternalIdentifier
| identificationScheme="urn:uuid:6b5aea1a-874d-4603-a4bc-96a0a7b38446"
| value="fca50fea3a5e41a^^^&1.3.6.1.4.1.21367.2005.3.7&ISO"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExternalIdentifier"
| id="id_15" registryObject="SubmissionSet01">
| <rim:Name>
| <rim:LocalizedString value="XDSSubmissionSet.patientId"></rim:LocalizedString>
| </rim:Name>
| </rim:ExternalIdentifier>
| </rim:RegistryPackage>
| <rim:Classification classifiedObject="SubmissionSet01"
| classificationNode="urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd"
| id="ID_27168535_1"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Classification"></rim:Classification>
| <rim:Association
| associationType="urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember"
| sourceObject="SubmissionSet01" targetObject="Document01" id="ID_27168535_2"
| objectType="urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Association">
| <rim:Slot name="SubmissionSetStatus">
| <rim:ValueList>
| <rim:Value>Original</rim:Value>
| </rim:ValueList>
| </rim:Slot>
| </rim:Association>
| </rim:RegistryObjectList>
| </lcm:SubmitObjectsRequest>
| <xdsb:Document id="Document01">
| <xop:Include
| href="cid:1.urn:uuid:3B788247A69DDDCBAE1233055309835@apache.org"
| xmlns:xop="http://www.w3.org/2004/08/xop/include" />
| </xdsb:Document>
| </xdsb:ProvideAndRegisterDocumentSetRequest>
| </soapenv:Body>
| </soapenv:Envelope>
| --MIMEBoundaryurn_uuid_3B788247A69DDDCBAE1233055309739
| Content-Type:
| text/plain
| Content-Transfer-Encoding: binary
| Content-ID: <1.urn:uuid:3B788247A69DDDCBAE1233055309835@apache.org>
|
| This is my document.
|
| It is great!
|
|
| --MIMEBoundaryurn_uuid_3B788247A69DDDCBAE1233055309739--
Somehow the reference to the Attachment is not working.
The annotated class with the inner-class "document", generated by wsconsume:
|
| /**
| * <p>Java class for ProvideAndRegisterDocumentSetRequestType complex type.
| *
| * <p>The following schema fragment specifies the expected content contained within this class.
| *
| * <pre>
| * <complexType name="ProvideAndRegisterDocumentSetRequestType">
| * <complexContent>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
| * <sequence>
| * <element ref="{urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0}SubmitObjectsRequest"/>
| * <sequence minOccurs="0">
| * <element name="Document" maxOccurs="unbounded">
| * <complexType>
| * <simpleContent>
| * <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
| * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
| * </extension>
| * </simpleContent>
| * </complexType>
| * </element>
| * </sequence>
| * </sequence>
| * </restriction>
| * </complexContent>
| * </complexType>
| * </pre>
| *
| *
| */
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "ProvideAndRegisterDocumentSetRequestType", propOrder = {
| "submitObjectsRequest",
| "document"
| })
| public class ProvideAndRegisterDocumentSetRequestType {
|
| @XmlElement(name = "SubmitObjectsRequest", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0", required = true)
| protected SubmitObjectsRequest submitObjectsRequest;
| @XmlElement(name = "Document")
| protected List<ProvideAndRegisterDocumentSetRequestType.Document> document;
|
| /**
| * Gets the value of the submitObjectsRequest property.
| *
| * @return
| * possible object is
| * {@link SubmitObjectsRequest }
| *
| */
| public SubmitObjectsRequest getSubmitObjectsRequest() {
| return submitObjectsRequest;
| }
|
| /**
| * Sets the value of the submitObjectsRequest property.
| *
| * @param value
| * allowed object is
| * {@link SubmitObjectsRequest }
| *
| */
| public void setSubmitObjectsRequest(SubmitObjectsRequest value) {
| this.submitObjectsRequest = value;
| }
|
| /**
| * Gets the value of the document property.
| *
| * <p>
| * This accessor method returns a reference to the live list,
| * not a snapshot. Therefore any modification you make to the
| * returned list will be present inside the JAXB object.
| * This is why there is not a <CODE>set</CODE> method for the document property.
| *
| * <p>
| * For example, to add a new item, do as follows:
| * <pre>
| * getDocument().add(newItem);
| * </pre>
| *
| *
| * <p>
| * Objects of the following type(s) are allowed in the list
| * {@link ProvideAndRegisterDocumentSetRequestType.Document }
| *
| *
| */
| public List<ProvideAndRegisterDocumentSetRequestType.Document> getDocument() {
| if (document == null) {
| document = new ArrayList<ProvideAndRegisterDocumentSetRequestType.Document>();
| }
| return this.document;
| }
|
|
| /**
| * <p>Java class for anonymous complex type.
| *
| * <p>The following schema fragment specifies the expected content contained within this class.
| *
| * <pre>
| * <complexType>
| * <simpleContent>
| * <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
| * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
| * </extension>
| * </simpleContent>
| * </complexType>
| * </pre>
| *
| *
| */
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "", propOrder = {
| "value"
| })
| public static class Document {
|
| @XmlValue
| @XmlMimeType("*/*")
| protected DataHandler value;
| @XmlAttribute(required = true)
| @XmlSchemaType(name = "anyURI")
| protected String id;
|
| /**
| * Gets the value of the value property.
| *
| * @return
| * possible object is
| * {@link DataHandler }
| *
| */
| public DataHandler getValue() {
| return value;
| }
|
| /**
| * Sets the value of the value property.
| *
| * @param value
| * allowed object is
| * {@link DataHandler }
| *
| */
| public void setValue(DataHandler value) {
| this.value = value;
| }
|
| /**
| * Gets the value of the id property.
| *
| * @return
| * possible object is
| * {@link String }
| *
| */
| public String getId() {
| return id;
| }
|
| /**
| * Sets the value of the id property.
| *
| * @param value
| * allowed object is
| * {@link String }
| *
| */
| public void setId(String value) {
| this.id = value;
| }
|
| }
|
| }
|
A call like:
body.getDocument().size()); results in 0 documents.
I hope the code-tags remain readable.
Thanks in advance!
-- Michael
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204964#4204964
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204964
17 years, 2 months
[EJB 3.0] - Re: How to inject sessionbean from sessionbean from another
by j-n00b
Master.java
package ae;
|
| import javax.annotation.Resource;
|
| import org.apache.log4j.Logger;
|
| import ae.Calculator;
|
| public class Master implements MasterMBean {
| private static final Logger log = Logger.getLogger(Master.class);
|
| @Resource(mappedName = Calculator.JNDI_NAME)
| private Calculator additionBean;
|
| public void start() throws Exception {
| if (additionBean == null) {
| log.error("### unable to inject CalculatorBean!!!");
| return;
| }
|
| long result = additionBean.add(new int[] { 1, 2, 3 });
| log.info(result);
|
| // TODO use a quartz job to run a calculation every 5 seconds!
| }
|
| public void stop() {}
| }
|
master-mbean-service.xml:
<?xml version="1.0" encoding="UTF-8"?>
|
| <server>
| <mbean code="ae.Master" name="ae:service=Master">
| <depends>
| jboss.j2ee:jar=SubEJB.jar,name=CalculatorBean,service=EJB3
| </depends>
| </mbean>
| </server>
|
Calculator.java:
| package ae;
|
| public interface Calculator {
| public static final String JNDI_NAME = "AECalculator";
| public long add(int... summands);
| }
|
CalculatorBean.java:
| package ae;
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
|
| import org.apache.log4j.Logger;
| import org.jboss.ejb3.annotation.Clustered;
|
| @Clustered
| @Stateless(mappedName = Calculator.JNDI_NAME)
| @Remote(Calculator.class)
| public class CalculatorBean implements Calculator {
| private static final Logger log = Logger.getLogger(CalculatorBean.class);
|
| public long add(int... summands) {
| long result = 0;
| for (int i : summands) {
| result += (long) i;
| }
| log.info(result);
| return result;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204949#4204949
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204949
17 years, 2 months
[JNDI/Naming/Network] - JNDI lookup fail for Websphere MQ Administered objects
by kutts4u
Hi
I am trying to interface a web application with Websphere MQ series. The basic requirement is that I need to send a xml message to a MQ queue. And then listen to another MQ queue for the response and display the response back to the web user.
I tried a simple program that worked OK as follows -
1. Created/ Defined the Websphere MQ Connection factory / Queue using the JMSAdmin tool (Webspeher MQ 6.0 is installed on Solaris 10).
2. The JNDI context used for the JMSAdmin tool was the JNDI namespace of the JBoss server that is on another machine.
The JNDI was sucessfully accepted by JMSAdmin since the following is displayed when starting JMSAdmin
Initializing JNDI Context...
INITIAL_CONTEXT_FACTORY: org.jnp.interfaces.NamingContextFactory
PROVIDER_URL: jnp://192.168.84.55:2099/
Done.
3. Defined the connection factory as follows
DEFINE CF(java:/jms.cnxFactory) +
SYNCPOINTALLGETS(YES) +
TRAN(client) +
HOST(192.168.14.204) CHAN(SVRCONN.MYSRV) PORT(1414) QMGR(MYSRV.QMGR)
DEFINE Q(java:/jms.myOwnQueue) QMGR(MYSRV.QMGR) QUEUE(MYQUEUE)
4. I wrote a simple java program that did the following
java.util.Hashtable environment = new java.util.Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
environment.put(Context.PROVIDER_URL, "jnp://192.168.84.55:2099/");
Context ctx = new InitialDirContext( environment );
ConnectionFactory factory = (ConnectionFactory) ctx.lookup("java:/jms.cnxFactory");
And then I did a lookup of the queue and was able to put messages to the MQ sucessfully. I was also able to read from the same queue via JMS.
5. I then tried out the same on my web application that uses struts - ejb (session beans only). I did the same call as above from my struts layer. I was expecting the context to be retrived and that I can send the messages. But I got a Naming exception saying the jndi name was not bound. The web application is deployed on the same Jboss server.
Why is it that the jndi lookup fails when called from the web application while it is OK from a simple java program that is outside the jboss container ?
6. I would want to move the context looup and send / receive of messages via JMS into/from the MQ queue using session beans. I could only find MDB examples. My requirement requires that I manage the transaction such that session bean handles the message send / recieve to simulate a synchronous call. So, I cannot use MDB since it would then be async. Any thought on where I could get some documentation to configure Jboss to allow the session beans to do the jndi lookup to the JMS queues whihc have teh Webpshere MQ as the provider ?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4204947#4204947
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4204947
17 years, 2 months