views:

105

answers:

1

I have a project with a EJB implementing a JWS Webservice, like this:

@Stateless
@Remote(WebServiceTest.class)
@WebService(
 serviceName="TestService",
 name="TestName"
)
public class WebServiceTestImpl implements WebServiceTest {
 @Override
 @WebMethod(operationName="hello")
 public String hello() {
  return "Hello World!";
 }
}

I deploy and test this perfectly on WebLogic 10.3 using a simple EAR project. Now I need to use Hibernate on my project, so from previous experiences I know that I have to use Antrl from Hibernate and not from the container, so I create a weblogic-application.xml in the EAR project:

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application ...>
 <wls:prefer-application-packages>
  <wls:package-name>antlr.*</wls:package-name>
 </wls:prefer-application-packages>
</wls:weblogic-application>

Now when I deploy the EAR I get this error:

Unable to deploy EJB: WebServiceTestImpl from test-1.0.0-SNAPSHOT.jar:

***** ASSERTION FAILED *****


 at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:467)
 at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
 at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:507)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
 at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:149)
 Truncated. see log file for complete stacktrace

Caused By: java.lang.ClassNotFoundException: test.WebServiceTestImpl_zd33dy_WSOImpl
 at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:280)
 at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:253)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:177)
 Truncated. see log file for complete stacktrace

How can I solve this? If I don't put Antlr in wls:prefer-application-packages Hibernate will not work, and if I put it I cannot deploy the webservice...