[JBossWS] - Re: Unable to create a WSClient that uses jboss-wsse-client.
by PeterJ
I also see that the handler chain is missing for the client. Without that, the client doesn't know to apply the jboss-wsse-client.xml.
I was going to refer you to the documentation on how to do this, but noticed that there is nothing about it in the documentation. Perhaps I got it from the older documentation? No matter, add to your client a META-INF/standard-jaxws-client-config.xml file with these contents:
<?xml version="1.0" encoding="UTF-8"?>
|
| <!-- $Id: standard-jaxws-client-config.xml 2313 2007-02-09 10:02:09Z thomas.diesler(a)jboss.com $ -->
|
| <jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
| xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
|
|
| <client-config>
| <config-name>Standard WSSecurity Client</config-name>
| <post-handler-chains>
| <javaee:handler-chain>
| <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
| <javaee:handler>
| <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
| <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
| </javaee:handler>
| </javaee:handler-chain>
| </post-handler-chains>
| </client-config>
|
| </jaxws-config>
The name is unimportant, the client code for JBossWS will pick up the first client-config in this file.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034127#4034127
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034127
19 years
[Persistence, JBoss/CMP, Hibernate, Database] - How do you remove a detached object?
by suneetshah2000
Hello,
I am trying to delete a record and get the exception below which says that I am trying to delete a detached object. How can I delete a record?
java.lang.IllegalArgumentException: Removing a detached instance common.service.Service#203
| at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45)
| at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:86)
| at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:52)
| at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:766)
| at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:744)
| at org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:246)
| 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 org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
| at $Proxy19.remove(Unknown Source)
| at diamelle.common.service.ServiceDAOBean.remove(ServiceDAOBean.java:54)
| 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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:299)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
| at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
| at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
| at $Proxy20.remove(Unknown Source)
| at diamelle.common.service.ServiceMgr.removeService(ServiceMgr.java:86)
| at diamelle.common.service.ServiceMgr$$FastClassByCGLIB$$28b3d4a2.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:693)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
| at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
| at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:628)
| at diamelle.common.service.ServiceMgr$$EnhancerByCGLIB$$245334f0.removeService(<generated>)
| at test.diamelle.common.service.ServiceMgrTest.testRemoveService(ServiceMgrTest.java:65)
| 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 junit.framework.TestCase.runTest(TestCase.java:164)
| at junit.framework.TestCase.runBare(TestCase.java:130)
| at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
| at junit.framework.TestResult$1.protect(TestResult.java:110)
| at junit.framework.TestResult.runProtected(TestResult.java:128)
| at junit.framework.TestResult.run(TestResult.java:113)
| at junit.framework.TestCase.run(TestCase.java:120)
| at junit.framework.TestSuite.runTest(TestSuite.java:228)
| at junit.framework.TestSuite.run(TestSuite.java:223)
| at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Unit test Code:
@Test
| public void testRemoveService() {
| System.out.println("Service Value = " + service);
| mgr.removeService(service);
| Service srvTest = mgr.getService(service.getServiceId());
| assertNull(srvTest);
| }
|
RemoveService:
public void removeService(Service serv) {
| if (serv == null)
| throw new NullPointerException("Service object is null");
| if (serv.getServiceId() == null)
| throw new NullPointerException("Service id is null");
|
| serviceDao.remove(serv);
| }
DAO Code:
| @Transactional( propagation = Propagation.REQUIRED, readOnly = false )
| public void remove(Service persistentInstance) {
| log.debug("removing Service instance");
| try {
| entityManager.remove(persistentInstance);
|
| log.debug("remove successful");
| } catch (RuntimeException re) {
| log.error("remove failed", re);
| throw re;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034124#4034124
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034124
19 years