[JBoss Seam] - Override page action with commandButton action?
by jmarston
I want an action method to be run when my page is accessed by a redirect or GET, but if an action is performed by the user on the page through a commandLink or commandButton, I want that action method to run. I thought I could do that by creating a page action like this:
<page view-id="/peopleSearch.xhtml" action="#{peopleSearch.findAllPeople}">
| <navigation>
| <rule if-outcome="viewPerson">
| <redirect view-id="/person.faces"/>
| </rule>
| </navigation>
| </page>
And a command link on the page like this:
...
| <a4j:commandButton value="Search" action="#{peopleSearch.findPeople}" reRender="results"/>
| ...
But instead of getting the expected result - peopleSearch.findAllPeople being run on initial load, and peopleSearch.findPeople being run when the button is clicked - the method defined in the page action is run every time the page is accessed along with the action from the command button.
Is there something wrong here, or is this how it is supposed to work? If this is working as designed, how do I achieve my desired functionality?
Thanks,
Jonathan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120642#4120642
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120642
18 years, 5 months
[JBossWS] - Exception with WSClient
by Vincent321
Hello,
I get the following exception when calling a WS with my client:
FAILED: testCall
javax.xml.ws.WebServiceException: java.lang.IllegalStateException: Could not setup remoting client
at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:304)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:242)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
at $Proxy27.fetchToken(Unknown Source)
at WsClientTest.testCall(WsClientTest.java:26)
Caused by: java.lang.IllegalStateException: Could not setup remoting client
at org.jboss.ws.core.client.RemotingConnectionImpl.createRemotingClient(RemotingConnectionImpl.java:240)
at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:153)
at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:322)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:230)
... 26 more
at org.jboss.remoting.InvokerRegistry.loadClientInvoker(InvokerRegistry.java:419)
at org.jboss.remoting.InvokerRegistry.createClientInvoker(InvokerRegistry.java:320)
at org.jboss.remoting.Client.connect(Client.java:441)
at org.jboss.ws.core.client.RemotingConnectionImpl.createRemotingClient(RemotingConnectionImpl.java:227)
... 30 more
Caused by: java.lang.NullPointerException
at org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker.createSocketFactory(HTTPSClientInvoker.java:144)
at org.jboss.remoting.RemoteClientInvoker.(RemoteClientInvoker.java:46)
at org.jboss.remoting.transport.http.HTTPClientInvoker.(HTTPClientInvoker.java:105)
at org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker.(HTTPSClientInvoker.java:63)
at org.jboss.remoting.transport.https.TransportClientFactory.createClientInvoker(TransportClientFactory.java:39)
... 38 more
... Removed 27 stack frames
Do you know where it can come from ?
Thanks a lot in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120640#4120640
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120640
18 years, 5 months
[JBossWS] - Enabling MTOM-Support at JBossWS client fails
by seventy8
Hello!
I am trying to use mtom for sending a binary file from a web service client to a web service endpoint, using JBoss AS 4.2.2.GA with build in JBossWS 2.0.1.SP2.
I enabled mtom on the endpoint and on the client like it is told in the user guide:
First I added the @BindingType Annotation
| @Stateless
| @TransactionManagement(value=TransactionManagementType.CONTAINER)
| @WebService(name="AdminLibrary",
| serviceName="AdminLibraryService",
| wsdlLocation="META-INF/wsdl/AdminLibraryService.wsdl")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
| @BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
| @WebContext(contextRoot = "ALibrary")
| public class AdminLibraryWS {
|
| ...
|
|
Then I used WSProvide to generate the wsdl and did the appropriate changes
|
| <xs:schema targetNamespace='http://ws.session.ejb.alibrary.seventy8.com/' version='1.0' xmlns:tns='http://ws.session.ejb.alibrary.seventy8.com/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
| <xs:import schemaLocation='http://www.w3.org/2005/05/xmlmime' namespace='http://www.w3.org/2005/05/xmlmime'/>
| <xs:element name='ALibraryException' type='tns:ALibraryException'/>
| <xs:element name='importBook' nillable='true' type='tns:importBookRequest'/>
| <xs:element name='importBookResponse' nillable='true' type='tns:importBookResponse'/>
| <xs:complexType name='importBookRequest'>
| <xs:sequence>
| <xs:element minOccurs='0' name='dataHandler' type='xmime:base64Binary' xmlns:xmime='http://www.w3.org/2005/05/xmlmime'/>
| <xs:element minOccurs='0' name='userId' type='xs:string'/>
| </xs:sequence>
|
|
After deploying everything looks fine on the server. So I ran WSConsume
At the clients side I enabled MTOM as follows:
|
| SOAPBindingbinding = (SOAPBinding)((BindingProvider)port).getBinding();
| binding.setMTOMEnabled(true);
|
|
When I test this service and check the SOAP Message, the binary content is transmitted inline.
|
| POST /ALibrary-ALibrary./AdminLibraryWS HTTP/1.1
| SOAPAction: ""
| Content-Type: text/xml; charset=UTF-8
| JBoss-Remoting-Version: 22
| User-Agent: JBossRemoting - 2.2.2.SP1 (Bluto)
| Host: 127.0.0.1:4040
| Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
| Connection: keep-alive
| Content-Length: 284493
|
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns1:importBook xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:ns1="http://ws.session.ejb.alibrary.seventy8.com/"><dataHandler>PQA9AD0AIABWAGUAcgBiAG8AcwBlACAAbABvAGcAZwBpAG4AZwAgAHMAdABhAHIAdABlAGQAOgAgA
|
| ...
|
| DAAMwAuADAANAAuADIAMAAwADcAIAAgADIAMQA6ADMANQA6ADAANwAgACAAQgB1AGkAbABkACAAdAB5AHAAZQA6ACAAUwBIAEkAUAAgAFUATgBJAgA=</dataHandler><userId>user1</userId></ns1:importBook></env:Body></env:Envelope>
|
|
Is there anything further I have to do to enable MTOM at the client?
WSConsume generates a class named Base64Binary which includes a byte-array and a field called contentType.
IMO the type should be DataHandler instead, or am I wrong?
best regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120639#4120639
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120639
18 years, 5 months
[EJB 3.0] - Re: JTA EntityManager cannot access a transactions
by cdiggins
Also having the same problem...
| java.lang.IllegalStateException: Could not start transaction
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:583)
| at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:314)
| 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.LoggingFilter.doFilter(LoggingFilter.java:58)
| 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:45)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| 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.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| 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:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Unknown Source)
| 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:62)
| at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:82)
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:578)
| ... 38 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120630#4120630
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120630
18 years, 5 months
[Persistence, JBoss/CMP, Hibernate, Database] - cannot get XA connection using PostgreSQL on JBoss4.0.5
by ssen
I have deployed a PostgreSQL datasource on JBoss 4.0.5 appserver with the following deployment descriptor ..
==
....
<xa-datasource>
<jndi-name>/test/postgres(XA)</jndi-name>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
....
====
When I run my application that is trying to create a connection, I am getting the following error. Is there anything special I need to do for using XA connections with jboss? I have tried using postgresql-8.2-507.jdbc3 and postgresql-8.2-506.jdbc3 but both give the same error.
==
2008-01-15 18:47:54,584 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Could not find accessor on XADataSource: ; - nested throwable: (java.lang.NoSuchMethodException: org.postgresql.xa.PGXADataSource.setURL(java.lang.String)))
at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:164)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:250)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:529)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
=====
Any pointers will be highly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120628#4120628
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120628
18 years, 5 months