Sam Tsang

Greenhorn
+ Follow
since Mar 26, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sam Tsang

I've come across some problems using Hibernate 3.4 on JBoss 5.1.
Hibernate 3.4 is a JPA 1.0 implementation so it should be fine to be used in JBoss 5.1. The thing is JBoss has its own version of Hibernate, which is located at /common/lib whereas I don't want to use the version provided by JBoss. What I did is that I removed the hibernate-annotations.jar, hibernate-commons-annotations.jar, hibernate-core.jar, hibernate-entitymanager.jar, hibernate-jmx.jar and hibernate-validator.jar from that folder and put my Hibernate 3.4 jars into server/default/lib directory. I also compiled hibernate-validator.jar 3.1.0 into my war file because it seems otherwise JBoss cannot recognize where the validator is. After I have done all the above, I packaged my war file and deployed it to the deploy folder.

The server started with no issue. But when I tried to access my web application it throws an error:

2010-10-27 10:55:13,416 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]] (http-172.16.10.211-80-1) Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/app/uncaughtException]
javax.servlet.ServletException: Servlet.init() for servlet roodummy threw exception
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:777)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:607)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:446)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:416)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:270)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to find a default provider
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
... 16 more
Caused by: javax.validation.ValidationException: Unable to find a default provider
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:161)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
... 32 more

It looks like it still cannot find the validator. But it is already in the war file. What have I done wrong here?
13 years ago
I think you'd better get a book before you start. It all depends on what J2ME technology you will need to use, if you use MIDP/CLDC you'll need to use httpconnection to communicate with the server side, especially if you are using Tomcat server. But if you are using CDC you'll probably have more choices because CDC is closer to J2SE.

15 years ago
hey you can use any library you like. I don't use Dojo, instead I use AjaxPartsTaglib. I always disable the "ajax" theme. I don't see any advantage using this.
15 years ago
I have the same issues many times when I first used struts 2. You need to check your struts.xml, make sure everything in this file is correct, for instance, action names, action classes, global results, interceptors, maybe you typed some action strings in your action class but forgot to refer them in struts.xml.
You can remove some parts in struts.xml to test which part goes wrong.
15 years ago
Just put the properties file in the package and use getText("property name"), then you can get the strings from the particular property name. But remember the properties file should be in the same package as your action class.
15 years ago