[JBossWS] - Custom header not getting include in SOAP request?
by pwwisnes
I have a bit of code that makes a simple SOAP request using SAAJ to a server that requires basic authentication. I've tested this code with both the Axis SAAJ implementation and Sun's reference SAAJ implementation and it works fine. However, when I run the code from inside a web app deployed in JBoss 4.0.3SP1, it uses the JBoss SAAJ implementation and fails with a 401 (Auth denied) error.
Watching the SOAP request with Axis' tcpmon shows that the custom mime header for the basic authorization I'm putting in the request is not actually making it into the request sent to the server. The mime header does appear when using the Axis and Sun SAAJ implementations.
The code is simply:
SOAPMessage message;
SOAPConnection connection;
...init code...
message.getMimeHeaders().addHeader( "Authorization", "Basic " + encodedPassword );
connection.call( message, endpoint );
This technique for setting basic auth is something I saw in another JBoss forum post so I have no idea it doesn't work when using the JBoss SAAJ implementation.
Has anyone seen anything similar or have a work around for getting custom headers into SOAP requests generated by the JBoss SAAJ implementation?
- Paul
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992032#3992032
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992032
19 years, 4 months
[JBoss Seam] - "detached entity passed to persist" problem
by Andreh
Hi all,
I'm new to seam, and I'm creating a project here
I'm getting this Exception:
| Exception during INVOKE_APPLICATION(5): javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: br.com.dehproject.UsuarioEntity
I know that I could use em.merge() to skip this, but I want to create a new object, not to update the actual one. My UsuarioEntity has a SESSION Scope, so that's why I get this... but I need the SESSION scope to the next page in my JSF to manage the contents of the object...
I have a page that register the users, and then redirect to another page where I manage the contents of the user using a Entity with a EVENT scope... But if I get back to the register page, I cannot persist another one and throw the Exception that I pasted above... =/ I want to create a new object to persist that has nothing to do with the other one...
How can I turn back and persist another object? but I also need to continue with a SESSION Scope, or I wish to have some idea from you...
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992029#3992029
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992029
19 years, 4 months
[JBossCache] - Re: how to use with EJB3Standalone container inside eclipse
by kagey
Also, i forgot to mention that a bare-bones deployment works, something like:
| <bean name="jboss.cache:service=TestTreeCache" class="org.jboss.cache.TreeCache">
| <create method="createService"/>
| <start method="startService"/>
| <stop method="stopService"/>
| <destroy method="destroyService"/>
|
| <property name="nodeLockingScheme">PESSIMISTIC</property>
| <property name="isolationLevel">REPEATABLE_READ</property>
| <property name="cacheMode">LOCAL</property>
| <property name="initialStateRetrievalTimeout">5000</property>
| <property name="syncReplTimeout">10000</property>
| <property name="lockAcquisitionTimeout">15000</property>
|
| </bean>
|
will launch:
| DEBUG 07-12 11:21:41,000 (BeanXMLDeployer.java:deploy:91) -Parsing file:/C:/.../test-treecache-test.xml took 16 milliseconds
| WARN 07-12 11:21:41,109 (Log4JLogger.java:warn:104) -No transaction manager lookup class has been defined. Transactions cannot be used
| DEBUG 07-12 11:21:41,109 (Log4JLogger.java:debug:84) -Not using an EvictionPolicy
| INFO 07-12 11:21:41,140 (Log4JLogger.java:info:94) -interceptor chain is:
| class org.jboss.cache.interceptors.CallInterceptor
| class org.jboss.cache.interceptors.PessimisticLockInterceptor
| class org.jboss.cache.interceptors.UnlockInterceptor
| class org.jboss.cache.interceptors.TxInterceptor
| class org.jboss.cache.interceptors.CacheMgmtInterceptor
| DEBUG 07-12 11:21:41,156 (Log4JLogger.java:debug:84) -cache mode is local, will not create the channel
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992028#3992028
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992028
19 years, 4 months
[JBossCache] - Re: how to use with EJB3Standalone container inside eclipse
by kagey
ok, here is my deployment descriptor:
| <?xml version="1.0" encoding="UTF-8" ?>
| <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
| xmlns="urn:jboss:bean-deployer:2.0">
|
| <bean name="jboss.cache:service=TestTreeCache"
| class="org.jboss.cache.TreeCache">
| <!--depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends-->
|
| <create method="createService" />
| <start method="startService" />
| <stop method="stopService" />
| <destroy method="destroyService" />
| <property name="transactionManagerLookupClass">
| org.jboss.cache.DummyTransactionManagerLookup
| </property>
| <property name="nodeLockingScheme">PESSIMISTIC</property>
| <property name="isolationLevel">REPEATABLE_READ</property>
| <property name="cacheMode">LOCAL</property>
| <property name="initialStateRetrievalTimeout">5000</property>
| <property name="syncReplTimeout">10000</property>
| <property name="lockAcquisitionTimeout">15000</property>
|
| <property name="evictionPolicyClass">
| org.jboss.cache.eviction.LRUPolicy
| </property>
|
| <property name="evictionPolicyConfig">
| <!--config>
| <attribute name="wakeUpIntervalSeconds">2</attribute>
| <region name="/_default_">
| <attribute name="maxNodes">0</attribute>
| <attribute name="timeToLiveSeconds">0</attribute>
| <attribute name="maxAgeSeconds">0</attribute>
| </region>
| </config-->
|
| </property>
|
| </bean>
| </deployment>
|
As you can see, the depends and eviction policy < config> are commented out as they cause other problems. here is the error i get using the above:
| RROR 07-12 10:46:29,171 (AbstractController.java:incrementState:350) -Error installing to Configured: name=jboss.cache:service=TestTreeCache state=Instantiated
| java.lang.IllegalArgumentException: Null value metadata
| at org.jboss.kernel.plugins.config.Configurator.getPropertySetterJoinPoint(Configurator.java:496)
| at org.jboss.kernel.plugins.config.Configurator.getPropertySetterJoinPoint(Configurator.java:443)
| at org.jboss.kernel.plugins.config.Configurator.getPropertySetterJoinPoints(Configurator.java:407)
| at org.jboss.kernel.plugins.config.AbstractKernelConfigurator.getPropertySetterJoinPoints(AbstractKernelConfigurator.java:120)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$ConfigureAction.installAction(KernelControllerContextActions.java:443)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:175)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:291)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:261)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:117)
| at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:95)
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:88)
| at com.mpi.tvaar.BaseTestCase.startupEmbeddedContainer(BaseTestCase.java:78)
| at com.###.BaseTestCase.setUp(BaseTestCase.java:62)
| at com.###.AggregateFetcherTest.setUp(AggregateFetcherTest.java:30)
| at junit.framework.TestCase.runBare(TestCase.java:125)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
| 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)
| DEBUG 07-12 10:46:29,265 (BeanXMLDeployer.java:deploy:98) -Deploying file:/C:/.../test-treecache-test.xml took 265 milliseconds
|
and from the junit window:
| java.lang.RuntimeException: java.lang.IllegalStateException: Incompletely deployed:
|
| *** DEPLOYMENTS IN ERROR: Name -> Error
| jboss.cache:service=TestTreeCache -> java.lang.IllegalArgumentException: Null value metadata
|
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:95)
| at com.###.BaseTestCase.startupEmbeddedContainer(BaseTestCase.java:78)
| at com.###.BaseTestCase.setUp(BaseTestCase.java:62)
| at com.###.cache.AggregateFetcherTest.setUp(AggregateFetcherTest.java:30)
| at junit.framework.TestCase.runBare(TestCase.java:125)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
| 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)
| Caused by: java.lang.IllegalStateException: Incompletely deployed:
|
| *** DEPLOYMENTS IN ERROR: Name -> Error
| jboss.cache:service=TestTreeCache -> java.lang.IllegalArgumentException: Null value metadata
|
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:241)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:161)
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:90)
| ... 14 more
|
|
So first of all, this null metadata thing is confusing me, I don't know what it means.
Second of all, if i leave in the < config> element for the eviction policy, it gives me:
|
| java.lang.RuntimeException: org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/.../test-treecache-test.xml@30,12
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:95)
| at com.###.BaseTestCase.startupEmbeddedContainer(BaseTestCase.java:78)
| at com.###.BaseTestCase.setUp(BaseTestCase.java:62)
| at com.###.AggregateFetcherTest.setUp(AggregateFetcherTest.java:30)
| at junit.framework.TestCase.runBare(TestCase.java:125)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
| 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)
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/.../test-treecache-test.xml@30,12
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:128)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:132)
| at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:85)
| at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.deployXmlResource(EJB3StandaloneBootstrap.java:88)
| ... 14 more
| Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {urn:jboss:bean-deployer:2.0}config not found as a child of {urn:jboss:bean-deployer:2.0}property
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:195)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:299)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:124)
| ... 17 more
|
It doesnt seem to be picking up the element. i tried putting CDATA around the < config> ... < /config> part, but that just made the config = null, as if it wasnt present.
Anyways, that is where I'm at now.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992027#3992027
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992027
19 years, 4 months