[JBossWS] - webservices development/deployment in jboss 4.0.5 and jboss
by ssuyamboo
Hi,
I tried the following webservice ,
package com.javasrc.webservices.age;
public class AgeServlet {
public String age( String name, Integer age ) {
return name + " is " + age + " years old!";
}
}
SEI is ,
package com.javasrc.webservices.age;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Age extends Remote {
public String age( String name, Integer age ) throws RemoteException;
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet-name>AgeServlet</servlet-name>
<servlet-class>com.javasrc.webservices.age.AgeServlet</servlet-class>
<servlet-mapping>
<servlet-name>AgeServlet</servlet-name>
<url-pattern>/Age</url-pattern>
</servlet-mapping>
</web-app>
used this config file
<?xml version="1.0" encoding="UTF-8"?>
to generate wsdl and mapping file using Webservices Developer Pack which runs on jre 1.5 and my jboss server runs on java 1.4
my directory structure looks like ,
age.war
/WEB-INF
/classes
mapping.xml
web.xml
webservices.xml
/wsdl
AgeService.wsdl
When I opened up mapping and webservices.xml in jboss IDE 2 Beta , it showed some schema errors.
cvc-id.3: A field of identity constraint 'port-component-name-key' matched element 'webservice-description', but this element does not have a simple type.
I resolved this by removing ,
'http://java.sun.com/xml/ns/j2ee from the following
<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>.
And then published using jboss IDE Beta. Though I see the webservice in the console http://localhost:8080/jbossws/services , I couldn't invoke the webservice using client program in which I was thrown with error 500.
How do I resolve this ? Any help would be greatly appreciated.
Is the jbossws is a suggested environment to develop webservices?
Thanks
Sundar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046824#4046824
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046824
17 years, 7 months
[JBossWS] - Error: Unable to createEndpointReference Provider
by Cheffilet
Hi there again,
i´ve processed the first steps at the user-guide(it belongs to the Echo Java Tutorial) tutorial and currently i standing for a problem where i´ve personally no matter what this error want from me.
When i had created all of the java-files by wsconsume and trying to building the client (excerpt)
| package echo;
|
| 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;
|
|
| /**
| * JBossWS Generated Source
| *
| * Generation Date: Fri May 18 14:07:30 CEST 2007
| *
| * This generated source code represents a derivative work of the input to
| * the generator that produced it. Consult the input for the copyright and
| * terms of use that apply to this source code.
| *
| * JAX-WS Version: 2.0
| *
| */
| @WebServiceClient(name = "EchoService", targetNamespace = "http://echo/", wsdlLocation = "http://localhost:8080/echo/Echo?wsdl")
| public class EchoService
| extends Service
| {
|
| private final static URL ECHOSERVICE_WSDL_LOCATION;
|
| static {
| URL url = null;
| try {
| url = new URL("http://localhost:8080/echo/Echo?wsdl");
| } catch (MalformedURLException e) {
| e.printStackTrace();
| }
| ECHOSERVICE_WSDL_LOCATION = url;
| }
|
| public EchoService(URL wsdlLocation, QName serviceName) {
| super(wsdlLocation, serviceName);
| }
|
| public EchoService() {
| super(ECHOSERVICE_WSDL_LOCATION, new QName("http://echo/", "EchoService"));
| }
|
| /**
| *
| * @return
| * returns Echo
| */
| @WebEndpoint(name = "EchoPort")
| public Echo getEchoPort() {
| return (Echo)super.getPort(new QName("http://echo/", "EchoPort"), Echo.class);
| }
|
| }
|
i getting this error during executing time:
anonymous wrote :
| Exception in thread "main" javax.xml.ws.WebServiceException: Unable to createEndpointReference Provider: Failed to load javax.xml.ws.spi.Provider: org.jboss.ws.core.jaxws.spi.ProviderImpl
| at javax.xml.ws.spi.Provider.provider(Provider.java:99)
| at javax.xml.ws.Service.(Service.java:83)
| at echo.EchoService.(EchoService.java:46)
| at EchoClient.main(EchoClient.java:13)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046805#4046805
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046805
17 years, 7 months
[JBossWS] - Error 401 and server redirection
by tremalnaik
Hello, I have a problem with my Jax-Rpc style WS: A client is accessing a remote server using the following code:
// setting up the authenticator (BasicAuthenticator extends java.net.Authenticator)
| BasicAuthenticator ba = new BasicAuthenticator(username, password);
| Authenticator.setDefault(ba);
| // setting a relaxed host verifier (to avoid too strict the server name checking)
| HttpsURLConnection.setDefaultHostnameVerifier(new NiceVerifier());
| // get service
| String urlstr = "https://cor319.cor-fs.com:8443/bitatraveller/TravellerSynchronizer";
| URL url = new URL(urlstr);
| String ns = "https://ws.web.bitastar.bitaplus.com/";
| QName qname = new QName(ns, "TravellerSynchronizer");
| QName port = new QName(ns, "TravellerSynchronizerIfacePort");
| QName operation = new QName(ns, "synchronize");
| ServiceFactoryImpl sfi = new ServiceFactoryImpl();
| // read mapping file
| File mapping = new File("mapping.xml");
| Service service = sfi.createService(url, qname, mapping.toURL());
| // call service
| Call call = service.createCall(port, operation);
| ClientCharacteristics cc = (ClientCharacteristics) call.invoke(new Object[] { characters });
I receive the error 401 and the client keep going on trying many times. Tomcat Axis Tcpmon gives the following output:
GET /bitatraveller/TravellerSynchronizer?wsdl HTTP/1.1
| User-Agent: Java/1.5.0_09
| Host: 127.0.0.1:9999
| Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
| Connection: keep-alive
| Content-type: application/x-www-form-urlencoded
|
| HTTP/1.1 401 Unauthorized
| Server: Apache-Coyote/1.1
| Pragma: No-cache
| Cache-Control: no-cache
| Expires: Thu, 01 Jan 1970 01:00:00 GMT
| WWW-Authenticate: Basic realm="127.0.0.1:9999"
| Content-Type: text/html;charset=utf-8
| Content-Length: 952
| Date: Fri, 18 May 2007 09:45:39 GMT
|
| <html><head><title>Apache Tomcat/5.5.9 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTTP authentication ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.9</h3></body></html>
Well, everything is working fine, except when the password issued by the client is wrong.
All I see in my application output, after 20 repetitions of the above request/response:
2007-05-18 10:06:43,878 [http-8443-Processor23] ERROR [ROM] [_system_] com.bitaplus.bitastar.common.exception.InvalidPasswordException: Invalid password or username.
| at com.bitaplus.bitastar.traveller.util.FileUserHelper.validateLogin(FileUserHelper.java:73)
| at com.bitaplus.bitastar.traveller.security.auth.tomcat.TomcatXmlDbLoginModule.validate(TomcatXmlDbLoginModule.java:27)
| at com.bitaplus.bitastar.common.security.auth.tomcat.TomcatLoginModule.login(TomcatLoginModule.java:122)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at javax.security.auth.login.LoginContext.invoke(Unknown Source)
| at javax.security.auth.login.LoginContext.access$000(Unknown Source)
| at javax.security.auth.login.LoginContext$4.run(Unknown Source)
| at java.security.AccessController.doPrivileged(Native Method)
| at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
| at javax.security.auth.login.LoginContext.login(Unknown Source)
| at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:365)
| at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:257)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:416)
| at com.bitaplus.bitastar.web.valve.TomcatFixValve.invoke(TomcatFixValve.java:181)
| at com.bitaplus.bitastar.web.valve.LicenseRequirementsValve.invoke(LicenseRequirementsValve.java:408)
| at com.bitaplus.bitastar.web.valve.LoginErrorMessageValve.invoke(LoginErrorMessageValve.java:35)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Unknown Source)
|
I wonder how can I catch the HTTP errors sent by the remote server and avoid the client repeat many times the request?
I've looked for the answer in the documentation, but I was not able to find it. Sorry
Your help would be appreciated
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046762#4046762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046762
17 years, 7 months
[JBossWS] - IllegalStateException due calling wsconsume
by Cheffilet
Hi there,
i´ve one problem there, as you can see by the topic.
When i try to generate the client-stub java files by typing in the console wsconsume echo.wsdl i receiving following stack trace:
anonymous wrote :
| C:\JBossWebService\install\bin>wsconsume echo.wsdl -t
| Exception in thread "main" java.lang.IllegalStateException: Could not load provi
| der:org.jboss.ws.tools.jaxws.impl.WSContractConsumerFactoryImpl
| at org.jboss.ws.tools.jaxws.api.Locator.locate(Locator.java:55)
| at org.jboss.ws.tools.jaxws.api.WSContractConsumer.newInstance(WSContrac
| tConsumer.java:68)
| at org.jboss.ws.tools.jaxws.api.WSContractConsumer.newInstance(WSContrac
| tConsumer.java:56)
| at org.jboss.ws.tools.jaxws.command.wsconsume.importServices(wsconsume.j
| ava:170)
| at org.jboss.ws.tools.jaxws.command.wsconsume.main(wsconsume.java:76)
|
I mention, that i´ve invoking the particular wsconsume file at the JbossWebFolder/install/bin as you can downloading from the jboss homepage as well.
The rather install procedure to migrate the JBossWebService into the Application Server(4) works for me very well.
Any ideas?
Have i to insert specifiy librarys into the JAVA_HOME/lib/ext Folder or something like that?
Best regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046761#4046761
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046761
17 years, 7 months
[JBossWS] - Need Help
by bilal_0003
hi
im using jboss 4.0.5 in my app with Hibernate 3.1 and actually the problem im facing is ,
i have created a DS file for my project addressbook
<local-tx-datasource>
<jndi-name>PostgresqlAddressBookDS</jndi-name>
<connection-url>jdbc:postgresql://192.168.1.11:5432/addressbook</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
backend
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<!-- sql to call when connection is created. Can be anything, select 1 is valid for PostgreSQL
<new-connection-sql>select 1</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool. Can be anything, select 1 is valid for PostgreSQL
<check-valid-connection-sql>select 1</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
<type-mapping>PostgreSQL 8.2</type-mapping>
-->
</local-tx-datasource>
the thing is actually i want jboss to crate sessions and bind them with JNDI
so then i use them in my app for this i craeted a file hibernate-service.xml
java:PostgresqlAddressBookDS
org.hibernate.dialect.PostgreSQLDialect
java:addressbookSessionFactory
org.hibernate.cache.HashtableCacheProvider
update-drop
false
but the problem is when i start jboss it gives arroe no DS find
but i already give it
both of these files are in deploy folder and the interesting thing after jboss throw exception that it did't find ny data source ,if i change my hibrenate-service file just add a space and save it it give no error and create session
cus some tell me im doing right and wat steps i should do to configure jboss with hibernate for session handling and where to specify my *.cfg.xml file
plz
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046621#4046621
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046621
17 years, 7 months