[JBoss Seam] - Re: i18n entity validation message?
by pplaninsky
Hi,
I have tried to use notation like:
@Length(min=3, max=70, message="{testcustommessage}")
where testcustommessage is part of messages.properties.
My set up is:
* jboss 4.0.4GA (JEMS)
* SEAM 1.0.1GA
* SEAM booking application with messages properties added:
validator.assertFalse=assertion failed
validator.assertTrue=assertion failed
validator.future=must be a future date
validator.length=Length should be {min} and {max}
validator.max=must be less than or equal to {value}
validator.min=must be greater than or equal to {value}
validator.notNull=Not Null
validator.past=must be a past date
validator.pattern=must match "{regex}"
validator.range=must be between {min} and {max}
validator.size=size must be between {min} and {max}
validator.email=not a well-formed email address
testcustommessage=Test custom messages
I have these validators in the properties file, otherwise it won't work at all.
(I have understood that this is some problem in SEAM)
1. I am able to show the testcustommmessage in an xhtml page without a problem.
2. I can also use testcustommessage with FacesMessages.
3. When I try to use it in the @Length validator I always get an exception on JBOSS startup:
Caused by: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key testcustommessage
at java.util.ResourceBundle.getObject(ResourceBundle.java:325)
at java.util.ResourceBundle.getString(ResourceBundle.java:285)
at org.hibernate.validator.ClassValidator.replace(ClassValidator.java:518)
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:260)
I have tried to use:
@Length(min=3, max=70, message="{messages.testcustommessage}")
but it doesn't work too.
I have also tried with ValidatorMessages.properties in EJB root, META-INF, etc. None with success. Still getting the same exception.
Where I have to put the message.properties or ValidatorMessages.properties?
I am sure I am missing something, but I have started with Jboss a couple of weeks ago and I am not able to find the problem.
Please, can somebody help?
Thanks,
Philip
P.S.
I would be great if there are some documents and examples about htis problem and workarounds. It would be of great help to starters.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970559#3970559
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970559
19 years, 8 months
[JBoss Seam] - Simple but complete Maven or ant example project needed
by hazlorealidad
I want to recount my experiences with Seam, in the hope that the developers/documenters can make it less complex to write a seam application.
Im going to concentrate on the negative points as they are the ones that I think need fixing.
After reading the documentation I saw that Seam solves a lot of the problems that I have come across in web development.
I installed jboss and downloaded the seam cvs and deployed the example programs.
Great! I understood the simple examples and they worked, fantastic.
Then I had a look at DVD store and HotelBooking but they are kind of Phd material, I installed them and they worked but as for understanding them hmmm.
Then I tried to create my own project, the nightmare began ... to figure out what files you need in what places is complex, (Im not a J2EE developer but have used struts, spring, hibernate (ejb3), jbpm and drools separately)
I wanted to use tomahawk with the dataTable and inputDate component, too complicated!,
even now I couldnt tell you how I managed to get it configured.
Then I tried getting the file upload configured, more classloading issues.
I think there is a need for some intermediate examples.
Better still a kind of template application that has all of the configuration files in place
-sticks to the best practices of classloading (hierarchical????)
-uses JAAS for the Login with tomcat security
-uses Security interceptors to make sure that the user is authorised
-uses tomahawk
-uses ADF Faces (dont know if tomahawk and adf faces can be used in the same project)
-fileupload (tomahawk)
-facelets
-tag files
-datascrollers
-jbpm
-drools
-portlets
-jasper reports
-mail
Seam integrates a lot of cool things but the configuration is a nightmare, I know everything
is complex at first but it could be a lot smoother to learn with a base application.
I think it would be good to have all the functionality in one application, but split the application
into easy to understand sections, or another idea is for all the examples stemming from a common layout and comment out the bits that arent needed for a particular example.
I would like to write a maven archetype for Seam but at the moment am still struggling
to get to grips with a fairly simple application.
I know that a lot of the problems that I have had are due to classloading that is a general jboss problem and nothing to do with the seam developers.
Another thing that would be good is a fairly high level block diagram of seam,
what it does in what order, how Injection and Outjection work, in what order the methods get called.
(I just got hit by the seam Logger not getting injected before a PostConstruct method was
called)
When I finally get to understand it I think Ill write a book called "Seams Easy"
I can see that its a great product, but wow what a steep learning curve.
If any seam expert is interested I can send them my maven (hacked about) project to improve on it and then when it is ready for general use put it on the web.
Thanks in advance.
Andy Bailey
www.hazlorealidad.com
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970558#3970558
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970558
19 years, 8 months
[JBoss Seam] - Pageflow - ClassCastException: org.jbpm.graph.node.StartStat
by hazlorealidad
I am using pageflows and jbpm in the same seam ear when I navigate from the first page of the page flow I get the error
16:11:04,991 ERROR [PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW(1) afterPhase
java.lang.ClassCastException: org.jbpm.graph.node.StartState
at org.jboss.seam.core.Pageflow.getPage(Pageflow.java:135)
at org.jboss.seam.core.Pageflow.validatePageflow(Pageflow.java:78)
at org.jboss.seam.jsf.AbstractSeamPhaseListener.restoreAnyConversationContext(AbstractSeamPhaseListener.java:45)
I Set JAVA_OPTS to display class loading
export JAVA_OPTS="-XX:MaxPermSize=128m -verbose:class"
The whole jboss log is 11000 lines long so Ill just show some parts
$ grep StartState /tmp/boss.log
[Loaded org.jbpm.graph.node.StartState from file:/usr/local/jboss-4.0.4.GA/server/default/tmp/deploy/tmp52708jbpm-3.1.1.jar]
16:00:34,526 INFO [Configuration] Reading mappings from resource: org/jbpm/graph/node/StartState.hbm.xml
16:00:34,532 INFO [HbmBinder] Mapping subclass: org.jbpm.graph.node.StartState -> JBPM_NODE
[Loaded org.jbpm.graph.node.StartState$$EnhancerByCGLIB$$66784c74 from file:/usr/local/jboss-4.0.4.GA/server/default/lib/cglib.jar]
java.lang.ClassCastException: org.jbpm.graph.node.StartState
$ grep Pageflow /tmp/boss.log
[Loaded org.jboss.seam.core.Pageflow from file:/usr/local/jboss-4.0.4.GA/server/default/tmp/deploy/tmp52765sgi-ear-1.0.ear-contents/jboss-seam-1.0.1.jar]
16:00:33,875 INFO [Component] Component: org.jboss.seam.core.pageflow, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Pageflow
[Loaded org.jboss.seam.core.Pageflow$$EnhancerByCGLIB$$6b8381f6 from file:/usr/local/jboss-4.0.4.GA/server/default/lib/cglib.jar]
[Loaded org.jbpm.pageflow.PageflowHelper from file:/usr/local/jboss-4.0.4.GA/server/default/tmp/deploy/tmp52708jbpm-3.1.1.jar]
[Loaded org.jbpm.pageflow.PageflowParser from file:/usr/local/jboss-4.0.4.GA/server/default/tmp/deploy/tmp52708jbpm-3.1.1.jar]
I have tried with the Flat classloader (jboss default) and the Hierarchical classloader
as shown in the wiki under classloading problems, I moved jppm to the deploy/jbossweb-tomcat55.sar/jsf-libs/ to see if that made a difference, but no luck.
The only strange thing is that the StartState is a cglib proxy, but that shouldnt generate a class cast exception.
Seam is great (when it works) but I have now spent 2 days trying to solve classloading issues
with tomahawk and fileuploads, its just too difficult to configure.
Please can someone come to my rescue.
If I havent provided enough information please let me know
the ear as deployed
META-INF/
META-INF/MANIFEST.MF
META-INF/application.xml
META-INF/jboss-app.xml
jboss-seam-1.0.1.jar
jbpm-3.1.1.jar
sgi-web-1.0.war
[
WEB-INF/
WEB-INF/incl/
WEB-INF/decorators/
WEB-INF/classes/
WEB-INF/lib/
img/
WEB-INF/incl/admin_nav.xhtml
WEB-INF/incl/login.xhtml
WEB-INF/incl/cart.xhtml
WEB-INF/incl/processmenu.xhtml
WEB-INF/incl/searchbox.xhtml
WEB-INF/incl/stats.xhtml
WEB-INF/incl/store_nav.xhtml
WEB-INF/components.xml
WEB-INF/faces-config.xml
WEB-INF/pages.xml
WEB-INF/template.xhtml
WEB-INF/web.xml
WEB-INF/decorators.xml
WEB-INF/jboss-web.xml
WEB-INF/decorators/main.jsp
WEB-INF/tomahawk.taglib.xml
WEB-INF/classes/messages.properties
WEB-INF/lib/el-ri-1.0.1.jar
WEB-INF/lib/commons-fileupload-1.1.jar
WEB-INF/lib/commons-email-1.0.jar
WEB-INF/lib/jboss-seam-ui-1.0.1.jar
WEB-INF/lib/el-api-1.0.1.jar
WEB-INF/lib/sitemesh-2.2.1.jar
WEB-INF/lib/commons-lang-2.1.jar
WEB-INF/lib/standard-1.0.1.jar
WEB-INF/lib/mail-1.3.3.jar
WEB-INF/lib/jsf-facelets-1.0.1.jar
WEB-INF/lib/commons-io-1.2.jar
WEB-INF/lib/dumbster-1.6.jar
WEB-INF/lib/activation-1.0.2.jar
WEB-INF/lib/jboss-seam-debug-1.0.1.jar
img/ordermanagement1.html
img/shade.subtitle.gif
img/checkout.jpg
img/nav.tab.left.gif
img/newuser.html
img/menu.bg.gif
img/bg.gif
img/arrow-l.png
img/ordermanagement2.html
img/ordermanagement3.html
img/menu.top.bg.gif
img/arrow-r.png
img/newuser.jpg
img/ordermanagement1.jpg
img/checkout.html
img/ordermanagement2.jpg
img/nav.tab.right.gif
img/ordermanagement3.jpg
confirm.xhtml
home.xhtml
admin.xhtml
showorders.xhtml
accept.xhtml
checkout.xhtml
browse.xhtml
ship.xhtml
complete.xhtml
new_contact.xhtml
new_account.xhtml
index.jsp
dvd.xhtml
screen.css
new_complete.xhtml
style.xsl
new_card.xhtml
messages.xhtml
todo.xhtml
login.xhtml
document.xhtml
documents.xhtml
documentOrRegister.xhtml
register.xhtml
documentDone.xhtml
menu.xhtml
style.css
processes.xhtml
personView.xhtml
upload.xhtml
personEditList.xhtml
personList.xhtml
personEdit.xhtml
META-INF/maven/
META-INF/maven/com.hazlorealidad/
META-INF/maven/com.hazlorealidad/sgi-web/
META-INF/maven/com.hazlorealidad/sgi-web/pom.xml
META-INF/maven/com.hazlorealidad/sgi-web/pom.properties
]
commons-fileupload-1.1.jar
commons-email-1.0.jar
commons-lang-2.1.jar
mail-1.3.3.jar
commons-io-1.2.jar
sgi-ejb-1.0.jar
[
com/
com/hazlorealidad/
com/hazlorealidad/sgi/
com/hazlorealidad/sgi/control/
com/hazlorealidad/sgi/model/
META-INF/persistence.xml
META-INF/sgi-ds.xml
import.sql
seam.properties
com/hazlorealidad/sgi/control/PersonManagerBean.class
com/hazlorealidad/sgi/control/PersonManager.class
com/hazlorealidad/sgi/control/MessageManagerBean.class
com/hazlorealidad/sgi/control/MessageManager.class
com/hazlorealidad/sgi/control/RepeatedTask.class
com/hazlorealidad/sgi/control/DocumentRegisterEntryBean.class
com/hazlorealidad/sgi/control/DocumentRegisterEntry.class
com/hazlorealidad/sgi/control/Documents.class
com/hazlorealidad/sgi/control/DocumentsBean.class
com/hazlorealidad/sgi/control/ProcessManager.class
com/hazlorealidad/sgi/control/Upload.class
com/hazlorealidad/sgi/control/UploadBackingBean.class
com/hazlorealidad/sgi/control/LoginAction.class
com/hazlorealidad/sgi/control/Login.class
com/hazlorealidad/sgi/control/ProcessManagerBean.class
com/hazlorealidad/sgi/control/UploadAction.class
com/hazlorealidad/sgi/model/Person.class
com/hazlorealidad/sgi/model/Message.class
com/hazlorealidad/sgi/model/Document.class
com/hazlorealidad/sgi/model/Actor.class
com/hazlorealidad/sgi/model/TodoList.class
com/hazlorealidad/sgi/model/Customer.class
com/hazlorealidad/sgi/model/User.class
com/hazlorealidad/sgi/model/Admin.class
com/hazlorealidad/sgi/model/Login.class
META-INF/ejb-jar.xml
META-INF/maven/
META-INF/maven/com.hazlorealidad/
META-INF/maven/com.hazlorealidad/sgi-ejb/
META-INF/maven/com.hazlorealidad/sgi-ejb/pom.xml
META-INF/maven/com.hazlorealidad/sgi-ejb/pom.properties
]
dumbster-1.6.jar
activation-1.0.2.jar
checkout.jpdl.xml
newuser.jpdl.xml
jbpm.cfg.xml
ordermanagement1.jpdl.xml
ordermanagement2.jpdl.xml
ordermanagement3.jpdl.xml
hibernate.cfg.xml
todo.jpdl.xml
person.jpdl.xml
documentRegisterEntry.jpdl.xml
META-INF/maven/
META-INF/maven/com.hazlorealidad/
META-INF/maven/com.hazlorealidad/sgi-ear/
META-INF/maven/com.hazlorealidad/sgi-ear/pom.xml
META-INF/maven/com.hazlorealidad/sgi-ear/pom.properties
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970557#3970557
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970557
19 years, 8 months