tomcat error while running spring program - spring

i m running hello world program in spring which works fine with eclipse but when i run it in tomcat separately it shows me error
rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Cannot resolve reference to bean 'helloController' while setting bean property 'urlMap' with key [TypedStringValue: value [/hello.html], target type [null]]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [net.roseindia.web.HelloWorldController] for bean with name 'helloController' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.lang.ClassNotFoundException: net.roseindia.web.HelloWorldController

Looks like net.roseindia.web.HelloWorldController is not in your classpath.

Related

Error No bean named 'mvcConversionService' available

I am upgrading springboot 2.7 from 1.5 and using springdoc.
I can compile and generate war file but when running it in webserver, there is this error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webConversionServiceProvider' defined in class path resource [org/springdoc/core/SpringDocConfiguration$WebConversionServiceConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mvcConversionService' available
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mvcConversionService' available
I am running the springboot in tomcat version 8.5.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource

I'm unable to run springboot application because of below error.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
Please help me.
This looks like an error caused by an illegal mix of spring versions.
Try to run mvn dependency:tree and see whether there are different versions of spring mixed in the classpath.

HTTP ERROR 503 with Spring Framework

I am using appEngine with Spring Framework and maven. I run the application from maven and everything is fine in command line but in browser I found this error.
HTTP ERROR: 503
Problem accessing /. Reason:
SERVICE_UNAVAILABLE
I don't know where I have to fix. Below is the error code in terminal when I try to run with maven. I think Spring framework has big problem in my PC.
[INFO] WARNING: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'org.springframework.format.support.FormattingConversionServiceFactoryBean#0' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.format.support.FormattingConversionServiceFactoryBean#0': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: java.time.format.FormatStyle is a restricted class. Please see the Google App Engine developer's guide for more details.:
[INFO] java.lang.NoClassDefFoundError: java.time.format.FormatStyle is a restricted class. Please see the Google App Engine developer's guide for more details.

SPRING Lookup failed for 'jdbc/ww2b/DataSource' in SerialContext

[#|2014-04-01T15:19:03.824+0200|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=76;_ThreadName=Thread-2;|15:19:03.822 [admin-thread-pool-4848(5)] ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'categoryUiDao': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [jar:file:/C:/glassfish3/glassfish/domains/domain1/applications/web/WEB-INF/lib/core-2.6-SNAPSHOT.jar!/META-INF/spring/db-env.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [jar:file:/C:/glassfish3/glassfish/domains/domain1/applications/web/WEB-INF/lib/core-2.6-SNAPSHOT.jar!/META-INF/spring/db-env.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Lookup failed for 'java:comp/env/jdbc/ww2b/DataSource' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Lookup failed for 'jdbc/ww2b/DataSource' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, com.sun.enterprise.naming.logicalName=java:comp/env/jdbc/ww2b/DataSource} [Root exception is javax.naming.NameNotFoundException: ww2b]]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
what is wrong. When I build a project everything works but when I try to deploy to glassfish3 I get error.
Assuming your Spring application configuration is right it seems that the JNDI resource java:comp/env/jdbc/ww2b/DataSource is not correctly configured on the server.
You should configure JNDI resource on GlassFish as described in the Administrator Guide.

I am working on a spring and hibernate web application MySQLDialect not found

When i deploy it shows following error
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.quad.dao.RoleDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/mvc-dispatcher-servlet.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Dialect class not found: org.hibernate.dialect.MySQLDialect
but i have hibernate jar file in lib folder.I dont understand why it is giving error.
You do not have your hibernate jar file in your classpath. Add the jars to your classpath and do a clean build.

Resources