[JBossWS] - java.lang.LinkageError: loader constraints violated
by jfrankman
I am trying to deploy a project that includes a WS client that uses JBoss WS. I used wsconsume command to generate the client code. I can get the web service to run properly from a unit test, but when I deploy it on JBoss I get the following error:
anonymous wrote :
| javax.ejb.EJBTransactionRolledbackException: java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName class
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| 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.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
| at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
| at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
| at $Proxy212.encodeLocation(Unknown Source)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
| at org.javassist.tmp.java.lang.Object_$$_javassist_5.encodeLocation(Object_$$_javassist_5.java)
| at com.idfbins.nexus.batch.GISEncodeLocationHandler.onMessage(GISEncodeLocationHandler.java:72)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:249)
| at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
| at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
| at $Proxy183.onMessage(Unknown Source)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
| at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
| at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
| at org.jboss.mq.SpySession.run(SpySession.java:323)
| at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
| at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
| at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.RuntimeException: java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName class
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:174)
| at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| ... 74 more
| Caused by: java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName class
| at com.idfbins.esriclientx.addressfinder.AddressFinder.(AddressFinder.java:36)
| at com.idfbins.nexus.business.GISEncoderServiceImpl.getAddressCandidates(GISEncoderServiceImpl.java:421)
| at com.idfbins.nexus.business.GISEncoderServiceImpl.encodeLocation(GISEncoderServiceImpl.java:293)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| ... 100 more
|
>From doing a search it looks like this is a classloader issue with incompatible xml classes invovled. Is my assumption correct? If so, I basically have two questions:
1. What is the general problem here ?
2. what are some things I can do to fix this problem (where do I start)?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167668#4167668
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167668
16 years, 5 months
[EJB 3.0] - WSException: Cannot obtain java type mapping
by stefaan.hallet@gmail.com
Got a webservice deployed on JBoss 4.2.2.GA. At client side, I included server side jar file containing the webservice in the classpath. It seemed that the client is not able to construct jaxrpc message to send to server. Can generate classes from wsdl using wsconsume, do I have to use these classes at client side ? What is the recommended procedure ?
Got:
client.AuctionWSClient
Starting Auction WebService Client
Creating a service Using:
http://127.0.0.1:8080/auction-auction-ejb/AuctionWebServiceBean?wsdl
and {http://webservice.auction.be/}AuctionWebServiceBeanService
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://webservice.auction.be/}item
at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildInputParameter(JAXRPCMetaDataBuilder.java:266)
(Generated)WSDL-Extract:
<xs:schema targetNamespace="http://webservice.auction.be/" version="1.0">
<xs:complexType name="user">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="bids" nillable="true" type="tns:bid"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="items" nillable="true" type="tns:item"/>
</xs:sequence>
</xs:complexType>...............
<xs:complexType name="item">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="bids" nillable="true" type="tns:bid"/>
<xs:element minOccurs="0" name="description" type="xs:string"/>
<xs:element minOccurs="0" name="seller" type="tns:user"/>
</xs:sequence>
</xs:complexType>
</xs:schema>..................................
Interface AuctionWebService:
@WebService
@SOAPBinding(style = Style.RPC)
public interface AuctionWebService extends Remote {
@WebResult(name="user")User
createUser(@WebParam String email);
}
I have another webservice "echo" which works fine, but which don't use java beans as parameters or return type. The client path seems to be ok (I think). Added @WebResult and @WebParam, but this did not change anything. Deployment on JBoss gives no errors...
If anyone has an idea ?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167651#4167651
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167651
16 years, 5 months
[JBossWS] - Web Service URL pattern
by karypid
Hello,
I have a war file that publishes a POJO web service in JBoss (using the native stack in JBoss AS 4.2.2, which is probably JBossWS 2.0.1). I am trying to restrict access to the web service to authenticated users only. Adding a security-constraint in the deployment descriptor of the war with the * (asterisk) wild-character gets the job done. However, it also restricts access to the auto-generated WSDL published by JBoss.
This is because JBoss publishes the WSDL under the servlet prefix, adding a ?wsdl parameter. For instance:
<servlet>
| <servlet-name>MyTestWS</servlet-name>
| <servlet-class>...servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>MyTestWS</servlet-name>
| <url-pattern>/MyTestWS</url-pattern>
| </servlet-mapping>
| <security-constraint>
| <web-resource-collection>
| <web-resource-name>...</web-resource-name>
| <url-pattern>/MyTestWS/*</url-pattern>
| </web-resource-collection>
| ...
| </security-constraint>
The above causes the web service to be published under:
http://localhost:8080/MyTestWS
and the WSDL is published under
http://localhost:8080/MyTestWS?wsdl
As a result, clients that try to access the stub generated with wsimport have a problem accessing the WSDL and fail. I need to keep a copy of the WSDL on the client for things to work as follows:
URL wsdlURL = Launcher.class.getResource("MyTestWS.wsdl");
| // URL wsdlURL = new URL("http://localhost:8080/MyTestWS?wsdl"); // does not work
| QName serviceName = new QName("...",
| "...");
| MyTestWSService rss = new MyTestWSService(wsdlURL,
| serviceName);
| MyTestWS rs = rss.getMyTestWSPort();
|
| BindingProvider bp = (BindingProvider) rs;
| bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
| "xxx");
| bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
| "yyy");
|
| String t = rs.secureHello();
The client is able to log in and access the MyTestWS web service when using a local copy of the WSDL only. How can I avoid this? I would like to have the client access the WSDL from the server. I need a way to either:
1) publish the WSDL in another URL
2) restrict access to the web service URL but put an exception for URL?wsdl
3) set the login credentials earlier (as I do with BindingProvider) so that the WSDL can be accessed to construct the stub.
I don't know how to do any of the above....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167649#4167649
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167649
16 years, 5 months
[O'Reilly JBoss 3.0/4.0 Workbook] - Re: EJB 4th Edition + JBoss Workbook now published
by despontao
Hello everybody,
I tried to download and ant the ex04_1 example, but this is the result.
| C:\workbook2\ex04_1>ant
| Buildfile: build.xml
|
| prepare:
| [mkdir] Created dir: C:\workbook2\ex04_1\build
| [mkdir] Created dir: C:\workbook2\ex04_1\build\classes
|
| compile:
| [javac] Compiling 5 source files to C:\workbook2\ex04_1\build\classes
| [javac] C:\workbook2\ex04_1\src\main\com\titan\cabin\CabinBean.java:3: canno
| t access javax.ejb.EntityContext
| [javac] bad class file: c:\jboss-4.2.2.GA\client\jboss-j2ee.jar(javax/ejb/En
| tityContext.class)
| [javac] class file has wrong version 49.0, should be 47.0
| [javac] Please remove or make sure it appears in the correct subdirectory of
| the classpath.
| [javac] import javax.ejb.EntityContext;
| [javac] ^
| [javac] 1 error
|
| BUILD FAILED
| C:\workbook2\ex04_1\build.xml:45: Compile failed; see the compiler error output
| for details.
|
| Total time: 6 seconds
|
|
any suggestion? what is my mistake?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167647#4167647
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167647
16 years, 5 months
[Beginners Corner] - Re: No answer after run command
by despontao
yes, this was the situation, and I added the server folder in the jre.
after your comment, I changed the jre with the jdk, but still the same problem. So, I corrected again in the same way: I created a new server folder, and copied all files from the client folder.
Now I'm trying to compile one of the workbook example of EJB3 oreilly book, but something doesn't work properly.
This is the output of ant statement:
C:\workbook\ex04_1>ant clean.db
| Buildfile: build.xml
|
| clean.db:
| [delete] Deleting directory c:\jboss-4.2.2.GA\server\default\data\hypersonic
|
| BUILD SUCCESSFUL
| Total time: 1 second
| C:\workbook\ex04_1>ant
| Buildfile: build.xml
|
| prepare:
|
| compile:
| [javac] Compiling 4 source files to C:\workbook\ex04_1\build\classes
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:8: illegal c
| haracter: \64
| [javac] @Entity
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:9: illegal c
| haracter: \64
| [javac] @Table(name="CABIN")
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:23: illegal
| character: \64
| [javac] @Id
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:24: illegal
| character: \64
| [javac] @Column(name="ID")
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:34: illegal
| character: \64
| [javac] @Column(name="NAME")
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:44: illegal
| character: \64
| [javac] @Column(name="DECK_LEVEL")
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:54: illegal
| character: \64
| [javac] @Column(name="SHIP_ID")
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:64: illegal
| character: \64
| [javac] @Column(name="BED_COUNT")
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\domain\Cabin.java:72: <identif
| ier> expected
| [javac] }
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\travelagent\TravelAgentBean.ja
| va:9: illegal character: \64
| [javac] @Stateless
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\travelagent\TravelAgentBean.ja
| va:12: illegal character: \64
| [javac] @PersistenceContext(unitName="titan") private EntityManager mana
| ger;
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\travelagent\TravelAgentBean.ja
| va:12: <identifier> expected
| [javac] @PersistenceContext(unitName="titan") private EntityManager mana
| ger;
| [javac]
| ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\travelagent\TravelAgentRemote.
| java:7: illegal character: \64
| [javac] @Remote
| [javac] ^
| [javac] C:\workbook\ex04_1\src\main\com\titan\clients\Client.java:6: cannot
| access javax.naming.InitialContext
| [javac] bad class file: C:\jdk1.5.0_15\lib\rt.jar(javax/naming/InitialContex
| t.class)
| [javac] class file has wrong version 49.0, should be 47.0
| [javac] Please remove or make sure it appears in the correct subdirectory of
| the classpath.
| [javac] import javax.naming.InitialContext;
| [javac] ^
| [javac] 14 errors
|
| BUILD FAILED
| C:\workbook\ex04_1\build.xml:54: Compile failed; see the compiler error output f
| or details.
|
| Total time: 1 second
| C:\workbook\ex04_1>
Do you think there is still something wronk with my jdk?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167644#4167644
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167644
16 years, 5 months