[jboss-user] [JBossWS] - javax.naming.Name is an interface, and JAXB can't handle int

kosulin do-not-reply at jboss.com
Mon Aug 4 10:48:34 EDT 2008


Hi,
I have a single POJO with 2 methods, first method accesses filesystem, and second - invokes SLSB. When I deploy it to JBoss 5.0.0CR1 (jre 1.6.0_07, Windows Vista SP1), I am getting the following error message:

10:16:02,418 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/java/jboss-5.0.0.CR1/server/cpportal2/deploy/cpportal2-ear.ear state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/java/jboss-5.0.0.CR1/server/cpportal2/deploy/cpportal2-ear.ear/statements-web.war
	at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:180)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Cannot build JAXB context
	at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:955)
	at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:156)
	at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:52)
	at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:63)
	at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.start(UnifiedMetaDataDeploymentAspect.java:67)
	at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.start(DeploymentAspectManagerImpl.java:146)
	at org.jboss.wsf.container.jboss50.BareWSFRuntime.start(BareWSFRuntime.java:66)
	at org.jboss.wsf.container.jboss50.deployer.JAXWSDeployerHookPostJSE.deploy(JAXWSDeployerHookPostJSE.java:54)
	at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:62)
	at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
	... 23 more
Caused by: org.jboss.ws.WSException: Failed to create JAXBContext
	at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:116)
	at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:951)
	... 33 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
javax.naming.Name is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at javax.naming.Name
		at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
		at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
javax.naming.Name does not have a no-arg default constructor.
	this problem is related to the following location:
		at javax.naming.Name
		at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
		at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
java.lang.StackTraceElement does not have a no-arg default constructor.
	this problem is related to the following location:
		at java.lang.StackTraceElement
		at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
		at java.lang.Throwable
		at private java.lang.Throwable com.wsc.cp.web.statements.jaxws.NamingExceptionBean.rootCause
		at com.wsc.cp.web.statements.jaxws.NamingExceptionBean

	at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:286)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
	at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
	at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:110)
	... 34 more
10:16:03,189 WARN  [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

*** CONTEXTS IN ERROR: Name -> Error

vfszip:/C:/java/jboss-5.0.0.CR1/server/cpportal2/deploy/cpportal2-ear.ear -> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
javax.naming.Name is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at javax.naming.Name
		at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
		at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
javax.naming.Name does not have a no-arg default constructor.
	this problem is related to the following location:
		at javax.naming.Name
		at private javax.naming.Name com.wsc.cp.web.statements.jaxws.NamingExceptionBean.remainingName
		at com.wsc.cp.web.statements.jaxws.NamingExceptionBean
java.lang.StackTraceElement does not have a no-arg default constructor.
	this problem is related to the following location:
		at java.lang.StackTraceElement
		at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
		at java.lang.Throwable
		at private java.lang.Throwable com.wsc.cp.web.statements.jaxws.NamingExceptionBean.rootCause
		at com.wsc.cp.web.statements.jaxws.NamingExceptionBean



	at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:676)
	at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
	at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

===============================================

Here is my code which causes the problem:

@WebMethod(operationName = "GetStatements")
	public StatementListDO getReportingDates(@WebParam(name = "Username") final String user,
	                                         @WebParam(name = "ClientId") final String clientId,
	                                         @WebParam(name = "TaxYear") final String taxYear,
	                                         @WebParam(name = "AccountNo") final String custAccountNo)
	  throws IncorrectParameterException, DBConnectionException, NamingException
	{
		StatementHandler.logger.info("Received request from user '" + user +
		                             "' for a list of statements available for Client Id " + clientId + ", Tax Year " +
		                             taxYear + ", AccountNo " + custAccountNo);

		StatementListDO sldo = new StatementListDO();
		try
		{
			InitialContext ic = new InitialContext();
			// Statements stmts = (Statements)ic.lookup(Statements.class.getName());
			// sldo = stmts.getReportingDates(clientId, taxYear, custAccountNo);
		}
		catch(NamingException e)
		{
			StatementHandler.logger.error(e);
			throw new DBConnectionException("Processing error");
		}
		return sldo;
	}

If I comment InitalContext out (as I did for the SLSB invocation code), it deploys fine. But how can I resolve my SLSB then?

I'd prefer not to expose SLSB directly through WS annotations, becuase this means having 2 endpoints and 2 WSDL definitions.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168479#4168479

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168479



More information about the jboss-user mailing list