[JBossWS] - Failed to create a new SAX parser
by Ufic
Hi.
I created a simple webservice with a string param and a string return value.
I'm able to deploy it and to use it through a standalone application (a simple main function).
But, if I use THE SAME code in a servlet, I receive this error:
[ServiceFactoryImpl] Use jaxrpc-mapping from: jar:file:/opt/jboss-4.2.0.CR1/server/default/tmp/deploy/tmp28550DipScienzeInformazioneApp.ear-contents/DipartimentoEJB.jar!/META-INF/jaxrpc-mapping.xml
| 10:41:15,481 INFO [STDOUT] 10:41:15,478 ERROR [[Search]] Servlet.service() for servlet Search threw exception
| org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
| at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
| at org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory.parse(JavaWsdlMappingFactory.java:79)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:77)
| at org.jboss.ws.core.jaxrpc.client.ServiceImpl.<init>(ServiceImpl.java:111)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
| at it.agaticarnazzo.ateneo.lib.WsLib.retrieveWebService(WsLib.java:118)
| at it.agaticarnazzo.ateneo.lib.WsLib.findDocumenti(WsLib.java:99)
| at it.agaticarnazzo.ateneo.lib.WsLib.findDocumenti(WsLib.java:81)
| at it.agaticarnazzo.ateneo.lib.WsLib.findDocumenti(WsLib.java:56)
| at it.agaticarnazzo.ateneo.web.SearchServlet.doPost(SearchServlet.java:34)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| 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:228)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:96)
| at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:55)
| at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
| ... 30 more
| Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration
| at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
| at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
| ... 32 more
This is my code:
QName qname = new QName("http://dipartimento.ws.agaticarnazzo.it/",
| "CatalogoService");
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(endpoint, qname); // This line throws the exception
|
| CatalogoService ret = (CatalogoService)
| service.getPort(CatalogoService.class);
| return ret;
|
I'm using JBoss 4.2.0CR1, JDK 1.5 and xerces lib from jboss lib/endorsed folder.
Can someone help me?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070849#4070849
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070849
17 years, 4 months
[JBossWS] - Deploying WebServices JBoss 4.0.5 + JDK 1.5
by goodvin
I have been trying to make a simple web service work for a while with different errors. I follow examples I found on the web. Can someone tell me what am I doing wrong?
I use JBoss 4.0.5 with JDK 1.5 as it's the latest officially supported version by JBoss.
My test client returns:
[Fatal Error] :-1:-1: Premature end of file.
Receiving: null
And the error I get in the JBoss console executing my test web service is:
ERROR -> [[HelloBean]] Servlet.service() for servlet HelloBean threw exception
java.lang.AbstractMethodError: org.jboss.ws.soap.SOAPMessageImpl.setProperty(Ljava/lang/String;Ljava/lang/Object;)V
at org.jboss.ws.soap.SOAPMessageImpl.(SOAPMessageImpl.java:65)
at org.jboss.ws.soap.MessageFactoryImpl.createMessageInternal(MessageFactoryImpl.java:209)
at org.jboss.ws.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:142)
at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:190)
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)
at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
................................................................
The files below is what I use for testing.
Hello.java:
package test;
import java.rmi.Remote;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style=Style.RPC)
public interface Hello extends Remote {
String sayHello(String name);
}
HelloBean.java:
package test;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.jws.WebService;
@Stateless
@WebService(endpointInterface = "test.Hello")
@Remote(Hello.class)
public class HelloBean implements Hello {
public String sayHello(String name) {
return "Hello " + name;
}
}
And my test client HelloClient:
package test;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
public class HelloClient {
public static void main(String[] args) throws Exception {
System.out.println("Starting Test Client");
URL url = new URL("http://rad-mobile1:8080/test/HelloBean?wsdl");
QName qname = new QName("http://test/jaws", "HelloService");
System.out.println("Creating a service Using: \n\t" + url + " \n\tand " + qname);
ServiceFactory factory = ServiceFactory.newInstance();
Service remote = factory.createService(url, qname);
System.out.println("Obtaining reference to a proxy object");
Hello proxy = (Hello) remote.getPort(Hello.class);
System.out.println("Accessed local proxy: " + proxy);
String name = "John";
System.out.println("Sending: name=" + name);
System.out.println("Receiving: " + proxy.sayHello("John"));
}
}
Any help is greatly appreciated!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070817#4070817
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070817
17 years, 4 months
[JBossWS] - Re: BASIC Authentication with jbossws-2.0.0.GA
by fheldt
Here are the relevant lines from the log (i enabled trace for org.jboss.security.auth.spi):
| 2007-08-03 15:08:18,623 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize, instance=@19070485
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Security domain: dhcRealm
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=java:/DHCDS
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT user_pass FROM Users WHERE UserID=? AND Expires>=CURRENT_DATE
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT Role,'' AS RoleGroup FROM Roles R,Users U,Users_Roles_Link UR WHERE U.UserID=? AND U.Id=UR.UserID AND R.Id=UR.RoleId
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendResume=true
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Authenticating as unauthenticatedIdentity=null
| 2007-08-03 15:08:18,624 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendAnyTransaction
| 2007-08-03 15:08:18,625 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Excuting query: SELECT user_pass FROM Users WHERE UserID=? AND Expires>=CURRENT_DATE, with username: null
| 2007-08-03 15:08:18,626 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Query returned no matches from db
| 2007-08-03 15:08:18,626 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] resumeAnyTransaction
| 2007-08-03 15:08:18,626 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] abort
| 2007-08-03 15:08:18,626 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| javax.ejb.EJBAccessException: Authentication failure
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSecurityException(Ejb3AuthenticationInterceptor.java:68)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:70)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:98)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:206)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:396)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:260)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:177)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:110)
| at org.jboss.wsf.spi.invocation.EndpointServlet.service(EndpointServlet.java:72)
| 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:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 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:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| 2007-08-03 15:08:18,628 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| javax.ejb.EJBAccessException: Authentication failure
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSecurityException(Ejb3AuthenticationInterceptor.java:68)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:70)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.invoke(InvocationHandlerEJB3.java:98)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:206)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:396)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:260)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:177)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:110)
| at org.jboss.wsf.spi.invocation.EndpointServlet.service(EndpointServlet.java:72)
| 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:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 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:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
Here's the code:
| package com.hcuc.ejb;
|
| import javax.ejb.Remote;
|
| @Remote
| public interface EchoIf
| {
| public String echo(String name);
| }
|
| package com.hcuc.ejb;
|
| import javax.annotation.security.RolesAllowed;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.annotation.security.SecurityDomain;
| import org.jboss.logging.Logger;
| import org.jboss.ws.annotation.WebContext;
|
|
| @Stateless
| @WebService
| //@WebService(name="HCUCService",serviceName="HCUCWebService")
| @SOAPBinding(
| style=SOAPBinding.Style.RPC,
| use=SOAPBinding.Use.LITERAL
| )
| @SecurityDomain("dhcRealm")
| @RolesAllowed({"Admin"})
| @WebContext(authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false)
| public class EchoEJB implements EchoIf
| {
| private static Logger logger = Logger.getLogger(EchoEJB.class);
|
| @WebMethod
| public String echo(@WebParam(name="name") String name) {
| if (logger.isTraceEnabled())
| logger.trace(String.format("Enter echo('%s')", name));
| return "Hello " + name;
| }
| }
|
Here's the C# client:
| using System;
| using System.Collections.Generic;
| using System.Text;
| using System.Net;
| using TestWSApp.WebReference;
|
| namespace TestWSApp
| {
| class Program
| {
| static void Main(string[] args)
| {
| EchoEJBService ws = new EchoEJBService();
| ws.Credentials = new NetworkCredential("admin", "secret");
| ws.PreAuthenticate = true;
| try
| {
| Console.WriteLine(ws.echo("Frank"));
| }
| catch (Exception ex)
| {
| Console.WriteLine(ex.ToString());
| }
| Console.Write("\n\nPress any key: ");
| Console.ReadKey();
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070586#4070586
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070586
17 years, 4 months