[JBossWS] - contextRoot with multiple webservices
by fmeystre
Hi,
I have some problem with the contextRoot with multiple WebService (in different apps) with same name on same server.
I'm running JBoss AS 4.2.1.GA with jbossws-native-2.0.1.GA.
I have 2 deployed web applications (same java source code)
First application is deployed at http://host/myApp1
Second application is deployed at http://host/myApp2
context root is set in the web.xml.
for myApp1:
| <module>
| <web>
| <web-uri>myApp1.war</web-uri>
| <context-root>/myApp1</context-root>
| </web>
| </module>
|
for myApp2:
| <module>
| <web>
| <web-uri>myApp2.war</web-uri>
| <context-root>/myApp2</context-root>
| </web>
| </module>
|
Everything is working fine with the web application (using Seam 1.2.1 GA).
The problem is with the WebService :
The 2 WebServices are deployed under default context root :
http://host/myApp1-myApp1/WSTest
http://host/myApp2-myApp2/WSTest
When I try to invoke the WebService WSTest from one client on
http://host/myApp2-myApp2/WSTest
it invokes the wrong service on the other app:
http://host/myApp1-myApp1/WSTest
Why is the wrong service invoked?
I tried to change the context root like this : @WebContext(authMethod = "BASIC", contextRoot="/myApp1" ) but then I can't open the Webservice on http://host/myApp1/WSTest, Error 404
By the way @WebContext and contextRoot="myApp1" is not a good solution for me, Because 2 apps share the same java source. I need a more dynamic way to change this. I see that we can change the context-root in jboss.xml, but regarding this post it is
not working : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078878#4078878
here is my WebService, it use the EJB annotation
| @Stateless
| @WebService
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @WebContext(authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
| @SecurityDomain("JBossWS")
| @RolesAllowed("friend")
|
| public class WSTestBean implements WSTest{
|
| ...
|
| @WebMethod
| public void test(byte[] order) {
| ...
| }
| }
|
For information I have user Seam-Gen to generate the project
Thanks in advance for any help
Fabian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100463#4100463
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100463
17Â years, 3Â months
[JBoss Seam] - Re: NoClassDefFoundError with SeamTest
by neilac333
I read in Michael Yuan's book that I need configuration files like components.xml in the classpath. That could be an idea, but much of the stuff in the book is outdated (through no fault of Michael's)--particularly in the area of configuration. Right now I have no config files in my classpath. Do I need to?
Incidentally, here is a Windows dir listing of the jars in my classpath:
| 10/05/2007 09:25 AM 62,983 activation.jar
| 10/05/2007 09:25 AM 443,432 antlr.jar
| 10/05/2007 09:25 AM 282,338 cglib.jar
| 10/05/2007 09:25 AM 303,207 dom4j.jar
| 10/05/2007 09:25 AM 32,941 ejb-api.jar
| 09/18/2007 12:53 PM 278,920 gwt-servlet.jar
| 09/18/2007 12:53 PM 2,719,460 hibernate-all.jar
| 10/05/2007 09:25 AM 265,130 hibernate-annotations.jar
| 10/05/2007 09:25 AM 66,426 hibernate-commons-annotations.jar
| 10/05/2007 09:25 AM 116,544 hibernate-entitymanager.jar
| 10/05/2007 09:25 AM 192,762 hibernate-search.jar
| 10/05/2007 09:25 AM 60,992 hibernate-validator.jar
| 10/05/2007 09:25 AM 1,138,709 itext.jar
| 10/05/2007 09:25 AM 459,663 javassist.jar
| 10/05/2007 09:25 AM 73,081 jaxb-api.jar
| 10/05/2007 09:25 AM 23,618 jaxws-api.jar
| 10/05/2007 09:25 AM 896,119 jboss-aop.jar
| 09/18/2007 12:53 PM 12,539 jboss-archive-browsing.jar
| 10/05/2007 09:25 AM 706,964 jboss-cache.jar
| 10/05/2007 09:25 AM 419,324 jboss-common-core.jar
| 10/05/2007 09:25 AM 356,776 jboss-container.jar
| 10/05/2007 09:25 AM 20,853 jboss-dependency.jar
| 10/05/2007 09:25 AM 155,835 jboss-deployers.jar
| 09/24/2007 03:02 PM 8,210,655 jboss-ejb3-all.jar
| 10/05/2007 09:25 AM 133,966 jboss-el.jar
| 09/18/2007 12:53 PM 13,655,643 jboss-embedded-all.jar
| 10/05/2007 09:25 AM 52,286 jboss-embedded-api.jar
| 10/05/2007 09:25 AM 328,656 jboss-kernel.jar
| 10/05/2007 09:25 AM 7,740 jboss-logging-spi.jar
| 10/05/2007 09:25 AM 11,603 jboss-seam-debug.jar
| 09/18/2007 12:53 PM 6,107 jboss-seam-gen.jar
| 10/05/2007 09:25 AM 65,238 jboss-seam-ioc.jar
| 10/05/2007 09:25 AM 25,915 jboss-seam-mail.jar
| 10/05/2007 09:25 AM 78,883 jboss-seam-pdf.jar
| 10/05/2007 09:25 AM 96,312 jboss-seam-remoting.jar
| 10/05/2007 09:25 AM 209,671 jboss-seam-ui.jar
| 10/05/2007 09:25 AM 827,444 jboss-seam.jar
| 10/05/2007 09:25 AM 266,749 jboss-system.jar
| 10/05/2007 09:25 AM 658,168 jbpm-jpdl.jar
| 10/05/2007 09:25 AM 306,089 jcommon.jar
| 10/05/2007 09:25 AM 1,184,816 jfreechart.jar
| 10/09/2007 04:24 PM 8,812 jta.jar
| 09/18/2007 12:53 PM 538,618 lucene-core-2.2.0.jar
| 09/18/2007 12:53 PM 13,737 mail-ra.jar
| 09/18/2007 12:53 PM 387,690 mail.jar
| 10/09/2007 04:24 PM 52,150 persistence-api.jar
| 09/18/2007 12:53 PM 5,590,165 thirdparty-all.jar
| 10/09/2007 04:24 PM 29,309 el-api.jar
| 10/09/2007 04:24 PM 97,471 el-ri.jar
| 10/09/2007 04:24 PM 323,012 jsf-api.jar
| 10/09/2007 04:24 PM 1,210,046 jsf-impl.jar
| 10/09/2007 04:24 PM 20,801 jstl.jar
| 09/26/2007 04:37 PM 97,523 servlet-api.jar
| 09/24/2007 03:02 PM 188,671 commons-beanutils.jar
| 09/24/2007 03:02 PM 571,259 commons-collections.jar
| 09/24/2007 03:02 PM 109,096 commons-digester.jar
| 09/24/2007 03:02 PM 71,442 commons-discovery.jar
| 09/24/2007 03:02 PM 112,341 commons-el.jar
| 09/24/2007 03:02 PM 53,082 commons-fileupload.jar
| 09/24/2007 03:02 PM 245,274 commons-lang.jar
| 09/24/2007 03:02 PM 44,598 commons-logging-api.jar
| 09/24/2007 03:02 PM 52,915 commons-logging.jar
|
|
Thanks for any insight.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100458#4100458
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100458
17Â years, 3Â months
[JBoss Seam] - More configuration issues getting starged with seam...
by mickknutson
I am trying to configure seam 2, drools, jbpm and MySQL and have been having serious issues.
I keep hacking away, so I will get one thing to work then something else starts going wrong. I did have my User entity working with seam and jbpm to save a new user into my db, but now I started creating a User->Contact(s) entity, I started having transactional issues.
I keep getting errors like:
| 14:38:05,842 ERROR [SeamPhaseListener] uncaught exception
| java.lang.IllegalStateException: Could not start transaction
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:571)
| at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:307)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:273)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:150)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.IllegalStateException: JTA EntityManager cannot access a transactions
| at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:316)
| at org.jboss.seam.persistence.EntityManagerProxy.getTransaction(EntityManagerProxy.java:110)
| at org.jboss.seam.transaction.EntityTransaction.getDelegate(EntityTransaction.java:61)
| at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:81)
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566)
| ... 43 more
| 14:38:05,905 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
|
My component.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:drools="http://jboss.com/products/seam/drools"
| xmlns:bpm="http://jboss.com/products/seam/bpm"
| xmlns:persistence="http://jboss.com/products/seam/persistence"
| xmlns:transaction="http://jboss.com/products/seam/transaction"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:mail="http://jboss.com/products/seam/mail"
| xmlns:framework="http://jboss.com/products/seam/framework"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="
| http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
| http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
| http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
| http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
| http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
| http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
| http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.0.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
|
| <!--<core:init debug="true" jndi-pattern="@jndiPattern@"/>-->
| <core:init debug="true" jndi-pattern="ear-1.0-SNAPSHOT/#{ejbName}/local"/>
|
| <!-- 120 second conversation timeout -->
| <core:manager conversation-timeout="120000"
| concurrent-request-timeout="500"
| conversation-id-parameter="cid"/>
|
| <transaction:ejb-transaction/>
|
| <transaction:entity-transaction entity-manager="#{entityManager}"/>
|
| <persistence:managed-persistence-context name="entityManager"
| auto-create="true"
| entity-manager-factory="#{yoursosEntityManagerFactory}"/>
|
| <persistence:entity-manager-factory name="yoursosEntityManagerFactory"
| persistence-unit-name="yoursosDatabase"/>
|
|
|
| <!--<persistence:entity-manager-factory name="yoursosEntityManagerFactory"/>-->
|
| <!--<transaction:hibernate-transaction session="#{yoursosEntityManagerFactory}"/>-->
|
|
|
| <drools:rule-base name="securityRules">
| <drools:rule-files>
| <value>security-rules.drl</value>
| </drools:rule-files>
| </drools:rule-base>
|
| <!--<drools:managed-working-memory name="workingMemory" rule-base="#{securityRules}"/>-->
|
| <security:identity authenticate-method="#{authenticator.authenticate}"
| security-rules="#{securityRules}"/>
|
| <component name="localeSelector" cookie-enabled="true" />
|
| <!--<theme:theme-selector>
| <theme:available-themes>
| <value>default</value>
| <value>accessible</value>
| <value>printable</value>
| </theme:available-themes>
| </theme:theme-selector>-->
|
|
| <event type="org.jboss.seam.notLoggedIn">
| <action execute="#{redirect.captureCurrentView}"/>
| </event>
| <event type="org.jboss.seam.postAuthenticate">
| <action execute="#{redirect.returnToCapturedView}"/>
| </event>
|
| <mail:mail-session host="localhost" port="2525" username="test" password="test" />
|
| <!-- For use with jBPM pageflow or process management -->
| <bpm:jbpm>
| <!--<bpm:process-definitions></bpm:process-definitions>-->
| <bpm:pageflow-definitions>
| <value>view/registration/registration.jpdl.xml</value>
| <!--<value>view/contact/addContact.jpdl.xml</value>-->
| </bpm:pageflow-definitions>
| </bpm:jbpm>
|
| </components>
|
My persistence.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <!-- Persistence deployment descriptor -->
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
| http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
|
| <!--<persistence-unit name="yoursosDatabase" transaction-type="RESOURCE_LOCAL">-->
| <persistence-unit name="yoursosDatabase" transaction-type="JTA">
|
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/yoursosDatasource</jta-data-source>
| <non-jta-data-source>java:/yoursosDatasource</non-jta-data-source>
| <properties>
|
| <property name="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}"/>
| <property name="hibernate.show_sql" value="${hibernate.show_sql}"/>
| <property name="hibernate.jdbc.batch_size" value="${hibernate.jdbc.batch_size}"/>
|
| <property name="hibernate.dialect" value="${hibernate.dialect}"/>
|
| <!-- Hibernate ejb3 settings. -->
| <property name="hibernate.transaction.flush_before_completion" value="true"/>
| <property name="hibernate.connection.release_mode" value="after_statement"/>
|
| <property name="hibernate.cache.use_second_level_cache" value="${hibernate.cache.use_second_level_cache}"/>
|
| <property name="hibernate.transaction.manager_lookup_class"
| value="${hibernate.transaction.manager_lookup_class}"/>
|
| <property name="hibernate.transaction.factory_class"
| value="${hibernate.transaction.factory_class}"/>
|
|
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
|
| <!-- alternative: Required binding for Seam-managed persistence context in Embeddable JBoss -->
| <!--<property name="jboss.entity.manager.factory.jndi.name"
| value="java:/yoursosEntityManagerFactory"/>-->
|
| </properties>
| </persistence-unit>
| </persistence>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4100453#4100453
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4100453
17Â years, 3Â months