[JBossWS] - Multithreading in Jboss 4.0.1
by pranav.akiri
Hi,
We are trying to connect to a third party webservice to propagate the changes to the thirdparty system(in the suggeted JNDI look up pattern described in the jboss-webservice tutorial and it is working fine)
Since the number of propagation updates are large,now we wanted to have parallel updates to the third party system,which is like having a master thread creaing few child threads,each will take,say 1000 records and updates in the 3rd party system using the webservices in parallel.
Now,we are having an issue while using multiple threads.If I understand correctly,I guess the issue is because,we are sharing websevice client name registered in the JNDI,and it is giving exceptions.
Has anyone have any idea of how can invoke multi threading with webservices.In the other way,we are trying to have multiple threads connecting the same webservice concurrently in the same appserver.
we are using JBoss 4.0.1 and jdk 1.4
Any suggestions would be appreciated.Following is the code snippet for conencting to webservices:
==========================================
private boolean connect() throws Exception
{
if(!isConnected)
{
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client:org.jboss.naming");
env.setProperty(Context.PROVIDER_URL, JNDI_URL);
env.setProperty("j2ee.clientName", "nn-ws4ee-client");
try
{
InitialContext iniCtx = new InitialContext(env);
Service service = (Service)iniCtx.lookup(NN_CLIENT_JNDI_NAME);
nrdInterface = (NRD)service.getPort(NRD.class);
((Stub)nrdInterface)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, url);
isConnected = true;
}
catch(Exception exc)
{
logger.fatal("NN Client Wrapper initialization exception. " +
"The JNDI may not be correctly configured as follows: JNDI Location: " + JNDI_URL +
" NN Client JNDI Name: " + NN_CLIENT_JNDI_NAME);
logger.fatal("NN Client Wrapper initialization exception:", exc);
isConnected = false;
throw exc;
}
}
return isConnected;
}
============================
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095404#4095404
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095404
17 years
[JBossWS] - Problems with wstools
by abdujaparov
Hi, I've many problems with the tools in the bin directory of jbossws2.1, when I try to start wsprovide or wstools or wsconsume I receve an error message like this:
| C:\Documents and Settings\Angelo>wsprovide
| Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/wsf/spi/too
| ls/cmd/WSProvide
|
But if I try to run
java org.jboss.wsf.spi.tools.cmd.WSProvide
manually it run, why?
Another question when I try to generate jax-ws artifacts I have this problem:
| C:\Documents and Settings\Angelo\workspace\WebServiceJbossWS>java org.jboss.wsf.
| spi.tools.cmd.WSProvide -w somma.Somma
| Error: Could not load class [somma.Somma]. Did you specify a valid --classpath?
|
In the directory somma there's the file Somma.class.
Thanks to all.
Bye Bye.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095291#4095291
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095291
17 years
[JBossWS] - Re: org.jboss.ws.WSException: Cannot obtain java type mappin
by tpawankumar
Hi,
Thank you for your suggestion alessio.soldano.
I have resolved this issue.yes,it is related to mapping of xml artifacts,java classes by using jbossws 1.0.4.
I am also using the interfaces/classes generated by Weblogic.I must use these interfaces/classes which were generated by weblogic.I should not use classes generated by tools provided by jboss. This is my requirement.It deployed successfully.It published the WSDL file and i am able to view WSDL file.
Now when i run the client initially i got the following exception
jboss.ws.WSException: Cannot find java method: processVendorOrder
at org.jboss.ws.metadata.OperationMetaData.getJavaMethod(OperationMetaData.java:213)
at org.jboss.ws.binding.EndpointInvocation.getJavaMethod(EndpointInvocation.java:82)
at org.jboss.ws.server.ServiceEndpointInvokerJSE.invokeServiceEndpoint(ServiceEndpointInvokerJSE.java:87)
at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:115)
at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Then i modified jaxrpc-mapping.xml file such that it refers exact classes.
This exception i got because weblogic uses XMLBeans to generate interfaces/classes the implementation classes for the interfaces were there in under impl directory so i have modified jaxrpc-mapping.xml to refer for the classes under impl directory.
But now i am getting different exception
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Neither fromValue(java.lang.String p) nor fromValue(java.lang.String p1, javax.xml.namespace.NamespaceContext p2) were found in interface com.covad.xsd.smo.vendororder.AreaCode
at org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtUtil.invokeUnmarshalMethod(RtUtil.java:350)
at org.jboss.xb.binding.sunday.unmarshalling.impl.runtime.RtCharactersHandler.unmarshal(RtCharactersHandler.java:104)
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endElement(SundayContentHandler.java:872)
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endElement(SundayContentHandler.java:160)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.endElement(SaxJBossXBParser.java:295)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:174)
... 34 more
I think from the stack trace i understood that it is referring to interface and not to actual implementation class.AreaCode is a simple type.
I want to know wheather jbossws supports XMLBeans or not?
If supports ,which version of jbossws supports XMLBeans.
Please help me.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095212#4095212
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095212
17 years
[JBossWS] - Re: soap message not correct?
by jtestori
tested with 1.2.1 and 2.0.1. then i deployed jbossws-2.0.1, same problem.
strange thing is that it works when i use the generated classes it in a simple main-class without jboss, so i guess there must be a classpath-problem. but i don't deploy any webservice-related jar-file together with my application.
maybe the generated source code can help:
| package com.shark.ewob.services.approveactivity;
|
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
|
| /**
| * This class was generated by the JAX-WS RI.
| * JAX-WS RI 2.1.1-b03-
| * Generated source version: 2.0
| *
| */
| @WebService(name = "ApproveActivity", targetNamespace = "http://xmlns.oracle.com/ApproveActivity")
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| public interface ApproveActivity {
|
|
| /**
| *
| * @param payload
| * @return
| * returns com.shark.ewob.services.approveactivity.ApproveActivityOUT
| */
| @WebMethod(action = "process")
| @WebResult(name = "ApproveActivityOUT", targetNamespace = "http://www.example.org", partName = "payload")
| public ApproveActivityOUT process(
| @WebParam(name = "ApproveActivityIN", targetNamespace = "http://www.example.org", partName = "payload")
| ApproveActivityIN payload);
|
| }
|
|
| package com.shark.ewob.services.approveactivity;
|
| import java.net.MalformedURLException;
| import java.net.URL;
| import javax.xml.namespace.QName;
| import javax.xml.ws.Service;
| import javax.xml.ws.WebEndpoint;
| import javax.xml.ws.WebServiceClient;
|
|
| /**
| * This class was generated by the JAX-WS RI.
| * JAX-WS RI 2.1.1-b03-
| * Generated source version: 2.0
| *
| */
| @WebServiceClient(name = "ApproveActivity", targetNamespace = "http://xmlns.oracle.com/ApproveActivity", wsdlLocation = "http://localhost:8888/orabpel/default/ApproveActivity/1.0/ApproveActivity...")
| public class ApproveActivity_Service
| extends Service
| {
|
| private final static URL APPROVEACTIVITY_WSDL_LOCATION;
|
| static {
| URL url = null;
| try {
| url = new URL("http://localhost:8888/orabpel/default/ApproveActivity/1.0/ApproveActivity...");
| } catch (MalformedURLException e) {
| e.printStackTrace();
| }
| APPROVEACTIVITY_WSDL_LOCATION = url;
| }
|
| public ApproveActivity_Service(URL wsdlLocation, QName serviceName) {
| super(wsdlLocation, serviceName);
| }
|
| public ApproveActivity_Service() {
| super(APPROVEACTIVITY_WSDL_LOCATION, new QName("http://xmlns.oracle.com/ApproveActivity", "ApproveActivity"));
| }
|
| /**
| *
| * @return
| * returns ApproveActivity
| */
| @WebEndpoint(name = "ApproveActivityPort")
| public ApproveActivity getApproveActivityPort() {
| return (ApproveActivity)super.getPort(new QName("http://xmlns.oracle.com/ApproveActivity", "ApproveActivityPort"), ApproveActivity.class);
| }
|
| }
|
| package com.shark.ewob.services.approveactivity;
|
| import javax.xml.bind.annotation.XmlAccessType;
| import javax.xml.bind.annotation.XmlAccessorType;
| import javax.xml.bind.annotation.XmlElement;
| import javax.xml.bind.annotation.XmlRootElement;
| import javax.xml.bind.annotation.XmlType;
|
|
| /**
| * <p>Java class for anonymous complex type.
| *
| * <p>The following schema fragment specifies the expected content contained within this class.
| *
| * <pre>
| * <complexType>
| * <complexContent>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
| * <sequence>
| * <element name="activityId">
| * <simpleType>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}int">
| * <minInclusive value="0"/>
| * </restriction>
| * </simpleType>
| * </element>
| * <element name="action">
| * <simpleType>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
| * <enumeration value="approve"/>
| * <enumeration value="reject"/>
| * </restriction>
| * </simpleType>
| * </element>
| * <element name="approverId">
| * <simpleType>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}int">
| * <minExclusive value="0"/>
| * </restriction>
| * </simpleType>
| * </element>
| * <element name="comment">
| * <simpleType>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
| * <maxLength value="255"/>
| * </restriction>
| * </simpleType>
| * </element>
| * </sequence>
| * </restriction>
| * </complexContent>
| * </complexType>
| * </pre>
| *
| *
| */
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "", propOrder = {
| "activityId",
| "action",
| "approverId",
| "comment"
| })
| @XmlRootElement(name = "ApproveActivityIN")
| public class ApproveActivityIN {
|
| protected int activityId;
| @XmlElement(required = true)
| protected String action;
| protected int approverId;
| @XmlElement(required = true)
| protected String comment;
|
| /**
| * Gets the value of the activityId property.
| *
| */
| public int getActivityId() {
| return activityId;
| }
|
| /**
| * Sets the value of the activityId property.
| *
| */
| public void setActivityId(int value) {
| this.activityId = value;
| }
|
| /**
| * Gets the value of the action property.
| *
| * @return
| * possible object is
| * {@link String }
| *
| */
| public String getAction() {
| return action;
| }
|
| /**
| * Sets the value of the action property.
| *
| * @param value
| * allowed object is
| * {@link String }
| *
| */
| public void setAction(String value) {
| this.action = value;
| }
|
| /**
| * Gets the value of the approverId property.
| *
| */
| public int getApproverId() {
| return approverId;
| }
|
| /**
| * Sets the value of the approverId property.
| *
| */
| public void setApproverId(int value) {
| this.approverId = value;
| }
|
| /**
| * Gets the value of the comment property.
| *
| * @return
| * possible object is
| * {@link String }
| *
| */
| public String getComment() {
| return comment;
| }
|
| /**
| * Sets the value of the comment property.
| *
| * @param value
| * allowed object is
| * {@link String }
| *
| */
| public void setComment(String value) {
| this.comment = value;
| }
|
| }
|
| package com.shark.ewob.services.approveactivity;
|
| import javax.xml.bind.annotation.XmlAccessType;
| import javax.xml.bind.annotation.XmlAccessorType;
| import javax.xml.bind.annotation.XmlElement;
| import javax.xml.bind.annotation.XmlRootElement;
| import javax.xml.bind.annotation.XmlType;
|
|
| /**
| * <p>Java class for anonymous complex type.
| *
| * <p>The following schema fragment specifies the expected content contained within this class.
| *
| * <pre>
| * <complexType>
| * <complexContent>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
| * <sequence>
| * <element name="result">
| * <simpleType>
| * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
| * <enumeration value="success"/>
| * <enumeration value="error"/>
| * </restriction>
| * </simpleType>
| * </element>
| * <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
| * </sequence>
| * </restriction>
| * </complexContent>
| * </complexType>
| * </pre>
| *
| *
| */
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "", propOrder = {
| "result",
| "message"
| })
| @XmlRootElement(name = "ApproveActivityOUT")
| public class ApproveActivityOUT {
|
| @XmlElement(required = true)
| protected String result;
| @XmlElement(required = true, nillable = true)
| protected String message;
|
| /**
| * Gets the value of the result property.
| *
| * @return
| * possible object is
| * {@link String }
| *
| */
| public String getResult() {
| return result;
| }
|
| /**
| * Sets the value of the result property.
| *
| * @param value
| * allowed object is
| * {@link String }
| *
| */
| public void setResult(String value) {
| this.result = value;
| }
|
| /**
| * Gets the value of the message property.
| *
| * @return
| * possible object is
| * {@link String }
| *
| */
| public String getMessage() {
| return message;
| }
|
| /**
| * Sets the value of the message property.
| *
| * @param value
| * allowed object is
| * {@link String }
| *
| */
| public void setMessage(String value) {
| this.message = value;
| }
|
| }
|
|
| package com.shark.ewob.services.approveactivity;
|
| import javax.xml.bind.annotation.XmlRegistry;
|
|
| /**
| * This object contains factory methods for each
| * Java content interface and Java element interface
| * generated in the com.shark.ewob.services.approveactivity package.
| * <p>An ObjectFactory allows you to programatically
| * construct new instances of the Java representation
| * for XML content. The Java representation of XML
| * content can consist of schema derived interfaces
| * and classes representing the binding of schema
| * type definitions, element declarations and model
| * groups. Factory methods for each of these are
| * provided in this class.
| *
| */
| @XmlRegistry
| public class ObjectFactory {
|
|
| /**
| * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.shark.ewob.services.approveactivity
| *
| */
| public ObjectFactory() {
| }
|
| /**
| * Create an instance of {@link ApproveActivityOUT }
| *
| */
| public ApproveActivityOUT createApproveActivityOUT() {
| return new ApproveActivityOUT();
| }
|
| /**
| * Create an instance of {@link ApproveActivityIN }
| *
| */
| public ApproveActivityIN createApproveActivityIN() {
| return new ApproveActivityIN();
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095130#4095130
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095130
17 years