[Tomcat, HTTPD, Servlets & JSP] - How To make Jboss talk to tomcat in other server
by mdonato
Hi all,
Sorry for the question, but i don't know what to do?
My environment is this:
Jboss-4.0.2 with my enterprise application running sucessfuly, but, i will need to create another application and put it in other server with tomcat only. For only one reason, my problem is BusinessObject (Crystal Server XI).
This shit of BusinessObject cames with 2 basic installations options, IIS and Tomcat to administrate it.
I don't have any experience with .net so i'll need to use the tomcat installation, and for my application works fine, i should install both together, jboss + myapplication and BusinessObject. So for test only prupose it works fine, but it's not a good pratice in customers sites.
Many customers have one machine for one funcionality, ex.: data base machine, file server machine, application machine, repository machine and so on...
Some one know how could i integrate jboss with a tomcat in other machine? I've tried to take a look at ajp13 connector, but i didn't found some sample or some direction to follow!
I have some experience with ajp13 integrating IIS with jboss, but i have no idea to integrate jboss with other tomcat!!!
HELP!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977372#3977372
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977372
19 years, 7 months
[JBoss Seam] - Could not register Synchronization
by sjmenden
I have the java.lang.RuntimeException: org.hibernate.TransactionException: Could not register synchronization from time to time and I've fixed it by redeploying the app, but I am tired of doing that and I want to find a real solution.
It is happening currently when I click view jobs to list out my jobs, then I wait a whlie, 15 minutes? and I click the delete button to delete a job and I get the exception:
| 16:36:39,031 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| javax.faces.FacesException: Error calling action method of component with id _id14:_id16:0:_id68
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
| at javax.faces.component.UICommand.broadcast(UICommand.java:106)
| at javax.faces.component.UIData.broadcast(UIData.java:513)
| at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
| at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: javax.faces.el.EvaluationException: /viewJobs.xhtml @130,45 action="#{viewJobs.delete}": java.lang.RuntimeException: org.hibernate.TransactionException: Could not register synchronization
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
| ... 28 more
| Caused by: java.lang.RuntimeException: org.hibernate.TransactionException: Could not register synchronization
| at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:273)
| at org.jboss.ejb3.AbstractPool.remove(AbstractPool.java:171)
| at org.jboss.ejb3.cache.simple.SimpleStatefulCache.remove(SimpleStatefulCache.java:299)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:89)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| 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.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
| at $Proxy141.delete(Unknown Source)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.jboss.seam.interceptors.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:73)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.ejb.SeamInterceptor.invokeInContexts(SeamInterceptor.java:196)
| at org.jboss.seam.ejb.SeamInterceptor.invoke(SeamInterceptor.java:169)
| at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:156)
| at org.jboss.seam.interceptors.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:44)
| at org.jboss.seam.interceptors.ClientSideInterceptor.intercept(ClientSideInterceptor.java:38)\
| 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:589)
| at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
| at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
| ... 29 more
| Caused by: org.hibernate.TransactionException: Could not register synchronization
| at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:159)
| at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:59)
| at org.jboss.ejb3.stateful.StatefulBeanContext.closeExtendedPCs(StatefulBeanContext.java:284)
| at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:268)
| ... 60 more
| Caused by: javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=localhost/126, BranchQual=, localId=126]
| at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:635)
| at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:156)
| ... 63 more
|
|
viewJobs.xhtml
| ...
| <!-- Delete Job -->
| <h:column>
| <h:commandButton rendered="#{jobs.rowCount > 0}"
| type="submit"
| value="Delete"
| action="#{viewJobs.delete}" />
| </h:column>
| ...
|
ViewJobsBean.java
| @Name("viewJobs")
| @Stateful
| @Scope(ScopeType.SESSION)
| public class ViewJobsBean implements ViewJobs {
| ....
| public String view() {
| Map parameters = new HashMap();
| StringBuffer queryString = new StringBuffer();
| queryString.append("from Job");
| Query query = em.createQuery(queryString.toString());
| jobs = (List<Job>) query.getResultList();
|
| //**********************************************************//
| // Refresh all of the jobs
| //**********************************************************//
| for(int x = 0; x < jobs.size(); x++){
| em.refresh(jobs.get(x));
| }
|
| return "viewJobs";
| }
| ....
|
I did my google searching and didn't find really any definitive answers, so help would be greatly appreciated.
persistence.xml:
| <persistence>
| <persistence-unit name="entityManager">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/jobsDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/jobsEntityManagerFactory"/>
| </properties>
| </persistence-unit>
| </persistence>
|
components.xml
| <components>
|
| <component name="org.jboss.seam.core.init">
| <property name="myFacesLifecycleBug">@myFacesLifecycleBug@</property>
| <property name="jndiPattern">@jndiPattern@</property>
| </component>
|
| <!-- 120 second conversation timeout -->
| <component name="org.jboss.seam.core.manager">
| <property name="conversationTimeout">120000</property>
| </component>
|
| <component name="entityManager" class="org.jboss.seam.core.ManagedPersistenceContext">
| <property name="persistenceUnitJndiName">java:/jobsEntityManagerFactory</property>
| </component>
|
| <component class="org.jboss.seam.core.Ejb"
| installed="@embeddedEjb@"/>
|
| </components>
|
jboss-beans.xml
| <?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">
|
| <!-- nothing here -->
|
| </deployment>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977367#3977367
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977367
19 years, 7 months
[Security & JAAS/JBoss] - Bug in SecurityAssociation(?) - EJB3 MDB Calls a SLSB which
by sappenin
I am running JBAS 4.0.4GA_Patch1. I have an annotated EJB3 MDB, with the following annotations:
@SecurityDomain("myRealm")
| @RunAs("system")
| @RolesAllowed( {
| "admin", "system"
| })
|
Inside of my MDB, I am calling a function on a SLSB (called "UserBean"). Inside of my SLSB UserBean, I execute the following call (notice the injected SessionContext):
| @Resource SessionContext context;
|
| public someFunc(..)
| {
| Principal p = this.context.getCallerPrincipal();
| }
|
Now, this SLSB call works just fine if I access the SLSB from, say, a web-services call (I get the proper principal returned). However, when I call it from an MDB, I get the following exception: "java.lang.IllegalStateException: No valid security context for the caller identity".
After doing a bit of digging, I noticed that inside of the SecurityAssociation class, the peekRunAsIdentity() function is being called with a depth of 1. Inside of peekRunAsIdentity, the peek() function is trying to determine a valid "runas" role. If I debug this, I can see the correct "system" role in the stack (ArrayList) object, complete with an "anonymous" principal name. However, the depth always gets set to -1 inside of the peek function, and so the "RunAs" role is ignored. The peek() function (incorrectly) assumes that the principal is null, and throws an IllegalStateException.
Something seems amiss here...like I said, my code works fine, so long as its not invoked from an MDB. Can anybody comment on this?
Thanks!
David
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977365#3977365
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977365
19 years, 7 months
[JBossWS] - Message style endpoint IN/OUT parameters
by caldron68
Hi,
I'm using JBossWS 1.0.3 to develop message style web services and have a question concerning the IN/OUT parameters of the message endpoint.
I'm trying to follow the example from the user guide (Chapter 3) and have developed several endpoints, each of which takes a SOAPElement as an
input argument and also returns a SOAPElement to the caller. In the WSDL, which I mostly wrote by hand, the message names for the input
and output parameters are all mapped to type "xsd:anyType". I would have thought that this would allow me to call the methods with any raw
XML message (wrapped in a SOAPElement of course), but this does not appear to be the case. The problem is that bacause the wsdl mapping
actually contains a message "name", JBossWS seems to expect that the message I return to be defined as an element with the same name.
In other words, I can't return two different messages from the same
endpoint, which is something that I could do using the older WS4EE Axis based material.
Here are the relevant parts of the wsdl and the jaxrpc-mapping files:
| <types>
| <xsd:schema targetNamespace='http://scte.org/dvs629/msg' xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns='http://scte.org/dvs629/msg' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <xsd:element name="AvailRequest" type="xsd:anyType"/>
| <xsd:element name="ServiceError" type="xsd:anyType"/>
| </xsd:schema>
| </types>
|
| <message name='ADSMessageServer_processAvailRequest'>
| <part element='tns:AvailRequest' name='request' />
| </message>
|
| <message name='ADSMessageServer_processAvailRequestResponse'>
| <part element='tns:AvailResponse' name='response' />
| </message>
|
| <portType name='ADSMessageServer'>
| <operation name='processAvailRequest'>
| <input message='tns:ADSMessageServer_processAvailRequest'/>
| <output message='tns:ADSMessageServer_processAvailRequestResponse'/>
| </operation>
| </portType>
|
| <binding name='ADSMessageServerBinding' type='tns:ADSMessageServer'>
| <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='processAvailRequest'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body use='literal' namespace="http://scte.org/dvs629/msg" />
| </input>
| <output>
| <soap:body use='literal' namespace="http://scte.org/dvs629/msg" />
| </output>
| </operation>
| </binding>
|
|
And from the jaxrpc-mapping file:
|
| <service-endpoint-method-mapping>
| <java-method-name>processAvailRequest</java-method-name>
| <wsdl-operation>processAvailRequest</wsdl-operation>
| <method-param-parts-mapping>
| <param-position>0</param-position>
| <param-type>javax.xml.soap.SOAPElement</param-type>
| <wsdl-message-mapping>
| <wsdl-message xmlns:wsdlMsgNS='http://scte.org/dvs629/msg'>wsdlMsgNS:ADSMessageServer_processAvailRequest</wsdl-message>
| <wsdl-message-part-name>request</wsdl-message-part-name>
| <parameter-mode>IN</parameter-mode>
| </wsdl-message-mapping>
| </method-param-parts-mapping>
| <wsdl-return-value-mapping>
| <method-return-value>javax.xml.soap.SOAPElement</method-return-value>
| <wsdl-message xmlns:wsdlMsgNS='http://scte.org/dvs629/msg'>wsdlMsgNS:ADSMessageServer_processAvailRequestResponse</wsdl-message>
| <wsdl-message-part-name>response</wsdl-message-part-name>
| </wsdl-return-value-mapping>
| </service-endpoint-method-mapping>
|
|
What I want to be able to do is to return a ServiceError element in place of an AvailRequest element under certain conditions, which may not be
error conditions. What happens when I try this is that JBossWS throws an exception and complains that the "Content root name does not match element name",
i.e. the stack expected to see an element of type AvailRequest but was presented with a ServiceError instead.
So, how to proceed? I really want to be able to use a single web-service endpoint and have that endpoint accept and return any raw XML document
that I choose to send in. Any help would be greatly appreciated.
Cheers.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977364#3977364
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977364
19 years, 7 months
[Security & JAAS/JBoss] - EJB3 and remote client EJB access
by dhartford
Hi all,
Trying to use EJB3-9 patch to 4.0.4.GA. Trying to use LdapLoginModule and AppCallbackHandler.
server-side error:
| 15:47:55,783 ERROR [ServerThread] failed to process invocation.
| java.io.NotSerializableException: com.sun.jndi.ldap.LdapCtx
| ...
| at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.sendObject(JavaSerializationManager.java:
| 81)
| at org.jboss.remoting.marshal.serializable.SerializableMarshaller.write(SerializableMarshaller.java:84)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:381)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
|
I've had very poor success understanding any documentation related to secure remote-EJB access, so forgive my ignorance.
client.java
| AppCallbackHandler("myuser","mypassword".toCharArray());
| try {
| LoginContext lc = new LoginContext("other",myHandler);
| lc.login();
| }catch (LoginException le)
| {
| System.out.println("Login failed");
| le.printStackTrace();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977358#3977358
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977358
19 years, 7 months