[JBoss Seam] - Validator in Bean
by demetrio812
Hi,
I'm using Seam 2.0 B1, I wrote a validator function in a seam managed bean (stateful), this is the code:
| public void validaEmailNewsletter(FacesContext context, UIComponent toValidate, Object value) {
| if (isEmailInserita((String)value)) { // se c'è giÃ
| FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Attenzione: l'indirizzo email è già stato registrato", "Attenzione: l'indirizzo email è già stato registrato");
| throw new ValidatorException(message);
| }
| }
|
validation works good but the only problem is that the message is very verbose and not only with my personalized message and it's like it happens a EJBTransactionRolledbackException, it looks like:
/home.xhtml @96,280 validator="#{newsletterHelper.validaEmailNewsletter}": javax.ejb.EJBTransactionRolledbackException: Attenzione: l'indirizzo email è già stato registrato
What's the problem?
Thanks
Demetrio Filocamo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066932#4066932
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066932
18Â years, 9Â months
[JBoss Messaging] - JBoss Messaging / Spring JMS compatibility?
by aaubry
Hi,
Does anyone can give me a feedback about using both JBoss Messaging 1.3.0 and Spring 2.0.6.
Here is the issue I am facing.
I am using a JBoss messaging stack with a MDB configured to act as a message controller to route to a valid requested service.
This is the server part (JBoss 4.2, JDK 1.5 and JBoss Messaging 1.3.0)
On the client part, I am using Tomcat 6, JDK 1.5 and Spring 2.0.6 (JMS part for that use case).
On a client request, I am retrieving a JMS sender that is configured within the Spring context. Everything is ok but, after having sent more than 400 messages from the client side, I got several WARN logs and it is not possible anymore to send new JMS messages.
The following trace is logged in the client part (Spring JMS):
2007-07-23 17:41:19,731 [Timer-421] WARN org.jboss.remoting.transport.bisocket.BisocketServerInvoker - [] - org.jboss.remoting.transport.bisocket.BisocketServerInvoker$ControlMonitorTimerTask@1bebf37: detected failure on control connection Thread[control: Socket[addr=/10.12.16.19,port=3898,localport=3719],5,main]: requesting new control connection
and the following trace is logged in the server part (JBoss + JBoss Messaging):
ERROR [org.jboss.remoting.transport.bisocket.BisocketServerInvoker] Failed to accept socket connection
java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.jboss.remoting.transport.bisocket.BisocketServerInvoker$SecondaryServerSocketThread.run(BisocketServerInvoker.java:799)
I do think that this more a Spring issue due to the fact that Spring is not reusing connection to optimize the number of concurrent TCP/IP connection but, if someone did have the same issue and found a workaround, I would be very please to read it.
Fyi, I wrote a simple JMS client, with no Spring JMS usage and everything and I do not have this issue.
Many thanks
Alexandre
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066931#4066931
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066931
18Â years, 9Â months
[EJB 3.0] - how to safe update
by serj_
hello
I want to know what settings should have for safe updates using stateless beans (if it is possible), when have concurrency. I try to test using this code:
//this code is from Runnable objects (I have many objects of this type):
| for(int i=0;i<UPDATE_NO;i++){
| int amount = ran.nextInt(1000);
| amountSum +=amount;
| testSessionC.adjust2Balance(balance.getId(),amount);
| }
|
//stateless bean:
| @Stateless
| @Remote(TestSessionC.class)
| @Local(TestSessionC.class)
| public class TestSessionCBean implements TestSessionC{
|
| @PersistenceContext(unitName = "...")
| EntityManager em;
|
| public void adjust2Balance(long id, int amount) {
| Balance b = em.find(Balance.class, id);
| em.lock(b, LockModeType.WRITE);
| float old = b.getAmount();
| b.setAmount(old+amount);
| em.merge(b);
| }
|
| }
|
my Balance entity use version control:
| @Version
| @Column(name = "OPTLOCK")
| public int getVersion() {
| return version;
| }
|
|
thanks for any ideea
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066930#4066930
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066930
18Â years, 9Â months
[JBoss Portal] - Re: how can i get current PortalNode
by k3nnymusic
back to topic:
I saw sample portlets and I don't know how can I use
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
and
org.jboss.portlet.JBossRenderRequest
org.jboss.portlet.JBossRenderResponse
like a doView function arguments at the same time.
I need both information about current portal nodes, and about portlet (eg window state)
I saw CatalogPortlet.java and it use only JBossRenderRequest, JBossRenderResponse and have permissions to methods like
req.setAttribute("parentNode", parent); when req is a org.jboss.portlet.JBossRenderRequest object.
I tried to use the same code in my .java with the same imports (I added .jar's) and I have got errors such as:
setAttribute is undefined for type org.jboss.portlet.JBossRenderRequest.
Sorry for my noob questions but I am new in portlets, and I try to understand it well.
Could you help me?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066923#4066923
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066923
18Â years, 9Â months