[JBoss Seam] - Hibernate validator and more error messages
by martin.krajci
Hi conference,
I'm using hibernate validators in my Seam application:
xhtml:
<s:decorate id="numberOfNightsDecoration" template="validate.xhtml">
| <h:outputLabel value="#{msg.number_of_nights}" for="#{msg.number_of_nights}"/>
| <h:inputText value="#{reservation.numberOfNights}" id="#{msg.number_of_nights}" required="true">
| <a:support event="onblur" ajaxSingle="true" reRender="numberOfNightsDecoration">
| <s:conversationId/>
| </a:support>
| </h:inputText>
| </s:decorate>
java:
@Min(value=1, message="#{messages['validator.min']}")
| @Max(value=100, message="#{messages['validator.max']}")
| @Column(name = "number_of_nights", unique = false, nullable = false, insertable = true, updatable = true)
| public int getNumberOfNights() {
| return numberOfNights;
| }
and when I submit the UI form I with value 0 for numberOfNights I get more the same error messages in h:messages component.
<f:subview rendered="#{! empty facesContext.maximumSeverity}">
| <div class="errors">
| <div><h:messages/></div>
| </div>
| </f:subview>
something like this:
# Value is too small
# Value is too small
# Value is too small
.
Do you have any idea why the error message is dispalyed in UI more times?
Thanx for any help.
Martin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098504#4098504
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098504
18Â years, 6Â months
[JBoss Seam] - Re: Serious issue getting a basic example of seam 2, jbpm, e
by mickknutson
I do have an ear with my ejb3 jar and my war.
I moved the persistence.xml back into my ejb3 jar.
I get a *** error:
| 12:08:10,182 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.RESOURCE_VIRTUAL_PATH' found, using default value /faces/myFacesExtensionResource
| 12:08:10,182 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default value true
| 12:08:10,182 INFO [MyfacesConfig] Starting up Tomahawk on the RI-JSF-Implementation.
| 12:08:20,197 WARN [lifecycle] Could not instantiate Seam component: userService
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: userService
| at org.jboss.seam.Component.newInstance(Component.java:1975)
| at org.jboss.seam.Component.getInstance(Component.java:1878)
| at org.jboss.seam.Component.getInstance(Component.java:1845)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
| at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
| at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
| at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
| at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
| at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
| at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
| at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| 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:281)
| 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: javax.naming.NameNotFoundException: UserServiceAction not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1292)
| at org.jboss.seam.Component.instantiate(Component.java:1278)
| at org.jboss.seam.Component.newInstance(Component.java:1971)
| ... 60 more
|
But in my logs above, it seems that it is there:
| 12:07:22,900 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=ear-1.0-SNAPSHOT.ear,jar=YourSOS.ejb3,name=UserServiceAction,service=EJB3 with dependencies:
| 12:07:22,900 INFO [JmxKernelAbstraction] persistence.units:ear=ear-1.0-SNAPSHOT.ear,jar=YourSOS.ejb3.jar,unitName=yoursosEntityManagerFactory
| 12:07:23,119 INFO [EJBContainer] STARTED EJB: com.baselogic.yoursos.user.UserServiceAction ejbName: UserServiceAction
|
| ...
|
| 12:07:32,181 INFO [Component] Component: org.jboss.seam.web.userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.faces.UserPrincipal
| 12:07:32,181 INFO [Component] Component: userService, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: com.baselogic.yoursos.user.UserServiceAction, JNDI: UserService
| Action/local
| 12:07:32,197 INFO [Contexts] starting up: org.jboss.seam.ui.resource.styleResource
| 12:07:32,197 INFO [Contexts] starting up: org.jboss.seam.remoting.remoting
| 12:07:32,197 INFO [Contexts] starting up: org.jboss.seam.ui.graphicImage.graphicImageResource
| 12:07:32,197 INFO [Contexts] starting up: org.jboss.seam.ui.resource.webResource
| 12:07:32,197 INFO [Contexts] starting up: org.jboss.seam.bpm.jbpm
| 12:07:33,150 INFO [Initialization] done initializing Seam
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098502#4098502
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098502
18Â years, 6Â months
[JBoss Seam] - how to handle a form with input in modalPanel?
by asookazian
I was posting on richFaces users forum but no luck. How can I implement this use case in JSF/Seam? Does anybody else use a modalPanel with inputText populated on open?
Is there a Seam example of the following use case?:
1) multiple column dataTable
2) user clicks 'no' on a radioButton in a cell
3) rich:modalPanel pops up with inputText and submit button in an
a4j:form
4) inputText is populated with data return by getter method of inputText (if possible???)
5) setter method is called when user inputs data and submits
6) XHTML page should not refresh (a4j:form solved this, h:form re-renders XHTML)
7) For that particular cell in the dataTable, store the inputted data for note in a 2D array of entity beans in the appropriate NoteArray[row][col] location for retrieval later
8) repeat as many times as required by user...
The a4j:form is calling the getter method for the inputText when the XHTML is rendered. That getter method is NOT being called when the modalPanel opens. I need to populate the modalPanel when it opens. How can I do this? The functional requirement here is that the user needs to be able to edit a previously entered note in a particular cell in the dataTable.
Do I need to use another XHTML page to solve this use case? (the popup must be modal, so if I popped up another XHTML/browser, that probably won't work...)
Any help would be much appreciated, as this use case is becoming too much work for a simple concept/use case... thx.
<rich:modalPanel id="mp" minHeight="200" minWidth="450"
| height="200" width="500" zindex="2000">
| <f:facet name="header">
| <h:outputText value="#{noteAction.header}" />
| </f:facet>
| <f:facet name="controls">
| <h:graphicImage value="/img/icon_edit.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
| </f:facet>
|
| <a4j:form id="a4jForm">
| <h:inputText id="noteText" value="#{noteAction.noteText}"/>
| <h:inputHidden id="rowIndex" value="noteAction.rowIndex"/>
| <h:inputHidden id="colName" value="noteAction.colName"/>
| <h:inputHidden id="siteId" value="noteAction.siteId"/>
| <h:inputHidden id="employeeNumber" value="noteAction.employeeNumber"/>
| <a4j:commandButton value="submit" action="#{noteAction.submit}" onclick="showNoteGraphic();Richfaces.hideModalPanel('mp')"/>
| </a4j:form>
|
| </rich:modalPanel>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098492#4098492
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098492
18Â years, 6Â months
[JNDI/Naming/Network] - InvokerLocator socket problem with 4.2.1.GA ?
by ahaumer
When testing an EJB3 SLSB from a remote client I found that jboss started with option "-b 0.0.0.0" (on Linux) binds all sockets to all network interfaces, except for the socket at port 3873!
JBOSS seems to bind this port to the IP address listed for the hostname of the server, only. On my development notebook this was 127.0.0.1 at that time, which gave me the following interesting exception on the client:
org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://127.0.0.1:3873/]
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:530)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1550)
at org.jboss.remoting.Client.invoke(Client.java:530)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
at $Proxy0.divide(Unknown Source)
at at.co.xss.test.client.TestClient.runTest(TestClient.java:25)
at at.co.xss.test.client.TestClient.main(TestClient.java:32)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at org.jboss.remoting.transport.socket.SocketClientInvoker.createSocket(SocketClientInvoker.java:187)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:801)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:526)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
at org.jboss.remoting.Client.invoke(Client.java:1550)
at org.jboss.remoting.Client.invoke(Client.java:530)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
at $Proxy0.divide(Unknown Source)
at at.co.xss.test.client.TestClient.runTest(TestClient.java:25)
at at.co.xss.test.client.TestClient.main(TestClient.java:32)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
... 11 more
When I changed the entry in /etc/hosts on my notebook to map the IP address of the ethernet port to the machines hostname and restarted JBOSS, I could connect from the remote client side without problem.
On the server, netstat now shows the following bound ports:
| tcp 0 0 192.168.162.96:3873 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:8009 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:1098 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:1099 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:32816 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:32817 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:32819 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:8083 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:4444 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:8093 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:4445 0.0.0.0:* LISTEN 1766/java
| tcp 0 0 0.0.0.0:4446 0.0.0.0:* LISTEN 1766/java
|
192.168.162.96 is the IP address listed in /etc/hosts for the hostname of
the notebook and it happens to be the current IP address of the ethernet interface (which is not always the case!)
But why does JBOSS bind port 3873 to this IP address only and not to 0.0.0.0 like it does for all other ports?
I explicitely used option "-b 0.0.0.0" to have JBOSS listen on all network interfaces on this machine.
Is this a bug or do I miss something here?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098486#4098486
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098486
18Â years, 6Â months