web app startup warning:No MyBatis mapper was found in ... ,Please check your configuration - spring

My configuration is:
spring-4.2.3
mybatis-3.3.0
mybatis-spring-1.2.3
mapper looks like:
package com.vsi.idp.map.server.mapper;
//imports...
public interface SeniorMapper extends BaseMapper<Long, Senior>
{
#Results({...})
#Select(...)
public List<Senior> query(...);
}
ServiceImpl looks like:
package com.vsi.idp.map.server;
//imports...
#Service("querySenior")
public class SeniorQueryServiceImpl extends RemoteServiceServlet implements SeniorQueryService
{
#Autowired
SeniorMapper mapper;
#Override
public List<Senior> query(Address address, String careType){...}
}
applicationContext.xml looks like:
<beans ... default-lazy-init="true">
<!-- MyBatis Mapper Interfaces -->
<mybatis:scan base-package="com.vsi.idp.map.server.mapper" />
//other configurations
</beans>
Spock unit test looks like below,and runs as expected
#ContextConfiguration(locations = "file:war/WEB-INF/applicationContext.xml")
public class SeniorQueryServiceImplTest extends Specification{
#Autowired
SeniorQueryServiceImpl service
def "query by full address"(){
//blabla
}
}
But when start web application,I got this warning:
WARNING: No MyBatis mapper was found in '[com.vsi.idp.map.server.mapper]' package. Please check your configuration.
So,how to solve this problem?
UPDATEit is a gwt web application,full error stack is:
INFO: Root WebApplicationContext: initialization started Nov 23, 2015 7:12:29 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Mon Nov 23 19:12:29 CST 2015]; root of context hierarchy Nov 23, 2015 7:12:29 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] Nov 23, 2015 7:12:29 PM org.mybatis.spring.mapper.ClassPathMapperScanner doScan
WARNING: No MyBatis mapper was found in '[com.vsi.idp.map.server.mapper]' package. Please check your configuration.Nov 23, 2015 7:12:30 PM org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor <init>
INFO: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
Module setup completed in 1698 ms
Nov 23, 2015 7:12:30 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 1557 ms

#MapperScan(basePackages = "com.vsi.idp.map.server.mapper")
you can try add it!

Have you defined MapperScannerConfigurer in applicationContext.xml? If so, please delete it.
I have the following config in my applicationContext.xml, and when I deleted it, the warning has gone.
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.james.reg.mapper" />
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>

Related

#Autowired annotation in spring-Getting BeanCreationException and java.lang.NoSuchMethodError

I have written a small code to check #Autowired annotation in Spring, here is my piece of code.
package beans;
//import org.springframework.beans.factory.annotation.AutoWired;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.beans.factory.annotation.*;
public class Car {
#Autowired
#Qualifier(value="e1")
private Engine engine;
//no need to have setters or constructors here
public void printData()
{
System.out.println("Engine model year: " +engine.getModelyear());
}
}
package beans;
public class Engine {
private String modelyear;
//generate setter and getter
public void setModelyear(String modelyear) {
this.modelyear = modelyear;
}
public String getModelyear() {
return modelyear;
}
}
package test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import beans.Car;
//import beans.Test;
public class Client {
/**
* #param args
*/
public static void main(String[] args) {
ApplicationContext ap = new ClassPathXmlApplicationContext("resource/spring.xml");
Car c=(Car)ap.getBean("c");
c.printData();
}
}
<!--spring.xml-->
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- activate autowire annotation -->
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
<bean id="engine" class="beans.Engine">
<property name="modelyear" value="2015"/>
</bean>
<bean id="e1" class="beans.Engine">
<property name="modelyear" value="2016"/>
</bean>
<bean id="c" class="beans.Car">
</bean>
</beans>
When I am trying to run Client.java class ,I am getting following error:
Can someone suggest why I am facing this issue?
Mar 11, 2017 10:19:24 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#70d18a80: display name [org.springframework.context.support.ClassPathXmlApplicationContext#70d18a80]; startup date [Sat Mar 11 10:19:24 IST 2017]; root of context hierarchy
Mar 11, 2017 10:19:24 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [resource/spring.xml]
Mar 11, 2017 10:19:25 AM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext#70d18a80]: org.springframework.beans.factory.support.DefaultListableBeanFactory#18d1cf9e
Mar 11, 2017 10:19:25 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Mar 11, 2017 10:19:25 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#18d1cf9e: defining beans [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor,engine,e1,c]; root of factory hierarchy
Mar 11, 2017 10:19:25 AM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#18d1cf9e: defining beans [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor,engine,e1,c]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'c': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private beans.Engine beans.Car.engine; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.resolveDependency(Lorg/springframework/beans/factory/config/DependencyDescriptor;Ljava/lang/String;Ljava/util/Set;Lorg/springframework/beans/TypeConverter;)Ljava/lang/Object;
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private beans.Engine beans.Car.engine; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.resolveDependency(Lorg/springframework/beans/factory/config/DependencyDescriptor;Ljava/lang/String;Ljava/util/Set;Lorg/springframework/beans/TypeConverter;)Ljava/lang/Object;
Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.config.ConfigurableListableBeanFactory.resolveDependency(Lorg/springframework/beans/factory/config/DependencyDescriptor;Ljava/lang/String;Ljava/util/Set;Lorg/springframework/beans/TypeConverter;)Ljava/lang/Object;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredElement.inject(AutowiredAnnotationBeanPostProcessor.java:361)
at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:61)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:228)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:414)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:122)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:66)
at test.Client.main(Client.java:13)
Set of jars which I am using are:
List of jars used and reference libraries while creating the project

Spring Rich Client Toolbar Menu won't show

I have downloaded Spring Rich Client 1.1.0 from sourceforge and wired up all the beans. When I run the app, I see a pane but no menubar. No warnings or errors in the console.
Here are the menuBar beans:
<bean id="menuBar" class="org.springframework.richclient.command.CommandGroupFactoryBean" >
<property name="members">
<list>
<ref bean="userManagementMenu" />
</list>
</property>
</bean>
<bean id="userManagementMenu" class="org.springframework.richclient.command.CommandGroupFactoryBean" >
<property name="members">
<list>
<ref bean="userCommand"/>
<ref bean="userGroupCommand"/>
<value>separator</value>
</list>
</property>
</bean>
<bean id="fd1" class="org.springframework.richclient.command.config.CommandFaceDescriptor">
<constructor-arg index="0" value="hello"/>
</bean>
<bean id="fd2" class="org.springframework.richclient.command.config.CommandFaceDescriptor">
<constructor-arg index="0" value="there"/>
</bean>
<bean id="userCommand" class="org.springframework.richclient.command.support.WidgetViewCommand">
<property name="widgetViewDescriptorId" value="userView" />
<property name="faceDescriptor" ref="fd1"/>
</bean>
<bean id="userGroupCommand" class="org.springframework.richclient.command.support.WidgetViewCommand">
<property name="widgetViewDescriptorId" value="userGroupView" />
<property name="faceDescriptor" ref="fd2"/>
</bean>
And it is called as follows:
<bean id="lifecycleAdvisor" class="org.springframework.richclient.application.config.DefaultApplicationLifecycleAdvisor">
<property name="windowCommandBarDefinitions" value="ctx/commands.xml"/>
<property name="windowCommandManagerBeanName" value="windowCommandManager"/>
<property name="startingPageId" value="userGroupView"/>
<property name="menubarBeanName" value="menuBar"/>
</bean>
Here are the view related beans:
<bean name="userView" scope="prototype" class="org.springframework.richclient.application.support.DefaultViewDescriptor">
<property name="viewClass" value="com.mycom.views.UserGroupView"/>
</bean>
<bean name="userGroupView" scope="prototype" class="org.springframework.richclient.application.support.DefaultViewDescriptor">
<property name="viewClass" value="com.mycom.views.UserGroupView"/>
</bean>
Here are the misc beans
<bean id="serviceLocator" class="org.springframework.richclient.application.ApplicationServicesLocator">
<property name="applicationServices" ref="applicationServices" />
</bean>
<bean id="applicationServices"
class="org.springframework.richclient.application.support.DefaultApplicationServices" />
<bean id="applicationEventMulticaster"
class="org.springframework.context.event.SimpleApplicationEventMulticaster" />
<bean id="application" class="org.springframework.richclient.application.Application">
<constructor-arg index="0" ref="applicationDescriptor"/>
<constructor-arg index="1" ref="lifecycleAdvisor"/>
</bean>
<bean id="applicationDescriptor" class="org.springframework.richclient.application.support.DefaultApplicationDescriptor">
<property name="version" value="1.0"/>
<property name="buildId" value="20060408-001"/>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>messages</value>
</list>
</property>
</bean>
Here is the UserGroupView:
package com.mycom.views;
import java.awt.BorderLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import org.springframework.richclient.application.support.AbstractView;
public class UserGroupView extends AbstractView {
private JTextField field = new JTextField();
private JLabel lbl = new JLabel("UserGroup:");
public JComponent createControl() {
JPanel view = new JPanel();
view.add(lbl, BorderLayout.NORTH);
view.add(field, BorderLayout.SOUTH);
return view;
}
}
Here is the code for UserView
package com.mycom.views;
import java.awt.BorderLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import org.springframework.richclient.application.support.AbstractView;
public class UserView extends AbstractView {
private JTextField field = new JTextField();
private JLabel lbl = new JLabel("User:");
public JComponent createControl() {
JPanel view = new JPanel();
view.add(lbl, BorderLayout.NORTH);
view.add(field, BorderLayout.SOUTH);
return view;
}
}
Here is the console log:
Feb 24, 2016 9:21:13 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#45283ce2: display name [org.springframework.context.support.ClassPathXmlApplicationContext#45283ce2]; startup date [Wed Feb 24 09:21:13 PST 2016]; root of context hierarchy
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/appbundle.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/application.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/commands.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/models.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/filters.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/filterforms.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/editors.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/forms.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/dataproviders.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/services.xml]
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/views.xml]
Feb 24, 2016 9:21:13 AM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext#45283ce2]: org.springframework.beans.factory.support.DefaultListableBeanFactory#591f989e
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#591f989e: defining beans [serviceLocator,applicationServices,applicationEventMulticaster,application,windowCommandManager,lifecycleAdvisor,applicationDescriptor,messageSource,menuBar,userManagementMenu,fd1,fd2,userCommand,userGroupCommand,baseModel,user,userGroup,userFilter,userGroupFilter,abstractFilterForm,userFilterForm,userGroupFilterForm,abstractDataEditor,userDataEditor,userGroupDataEditor,abstractForm,userForm,userGroupForm,abstractDataProvider,userDataProvider,userGroupDataProvider,userService,userGroupService,userView,userGroupView]; root of factory hierarchy
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationServices$8 build
INFO: Creating default service impl: CommandConfigurer
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationServices$7 build
INFO: No object configurer bean Id has been set; configuring defaults.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationServices$4 build
INFO: Creating default service impl: CommandServices
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.foreground]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.background]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.caption]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.description]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationServices$10 build
INFO: Creating default service impl: IconSource
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationServices$9 build
INFO: Creating default service impl: ImageSource
Feb 24, 2016 9:21:13 AM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
INFO: Loading properties file from class path resource [org/springframework/richclient/image/images.properties]
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userCommand.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userCommand.large.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.foreground]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.background]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.caption]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userCommand.description]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userCommand.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userCommand.large.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.foreground]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.background]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.caption]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.description]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userGroupCommand.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userGroupCommand.large.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.foreground]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.background]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.caption]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userGroupCommand.description]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userGroupCommand.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userGroupCommand.large.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userManagementMenu.foreground]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userManagementMenu.background]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer loadMessage
INFO: The message source is unable to find message code [userManagementMenu.description]. Ignoring and returning null.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userManagementMenu.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.image.DefaultIconSource getIcon
INFO: No image resource found for icon with key 'userManagementMenu.large.icon'; returning a icon.
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.ApplicationLauncher displaySplashScreen
INFO: No splash screen bean found to display. Continuing...
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationServices$25 build
INFO: Creating default service impl: ApplicationWindowFactory
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationWindowFactory createApplicationWindow
INFO: Creating new DefaultApplicationWindow
Feb 24, 2016 9:21:13 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.richclient.application.config.DefaultApplicationLifecycleAdvisor$CommandBarApplicationContext#21cf5ed5: display name [org.springframework.richclient.application.config.DefaultApplicationLifecycleAdvisor$CommandBarApplicationContext#21cf5ed5]; startup date [Wed Feb 24 09:21:13 PST 2016]; parent: org.springframework.context.support.ClassPathXmlApplicationContext#45283ce2
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [ctx/commands.xml]
Feb 24, 2016 9:21:13 AM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.richclient.application.config.DefaultApplicationLifecycleAdvisor$CommandBarApplicationContext#21cf5ed5]: org.springframework.beans.factory.support.DefaultListableBeanFactory#5853b97a
Feb 24, 2016 9:21:13 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#5853b97a: defining beans [menuBar,userManagementMenu,fd1,fd2,userCommand,userGroupCommand]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory#591f989e
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationServices$26 build
INFO: Creating default service impl: ApplicationPageFactory
Feb 24, 2016 9:21:13 AM org.springframework.richclient.application.support.DefaultApplicationPageFactory createApplicationPage
INFO: Creating new DefaultApplicationPage
Feb 24, 2016 9:21:13 AM org.springframework.richclient.core.LabeledObjectSupport getDisplayName
INFO: This labeled object's display name is not configured; returning 'displayName'
Feb 24, 2016 9:21:13 AM org.springframework.richclient.core.LabeledObjectSupport getDisplayName
INFO: This labeled object's display name is not configured; returning 'displayName'
Feb 24, 2016 9:21:14 AM org.springframework.richclient.application.support.DefaultApplicationServices$2 build
INFO: Creating default service impl: MenuFactory
Feb 24, 2016 9:21:14 AM org.springframework.richclient.application.support.DefaultApplicationServices$3 build
INFO: Creating default service impl: ButtonFactory
Feb 24, 2016 9:21:14 AM org.springframework.richclient.application.support.DefaultApplicationServices$5 build
INFO: Creating default service impl: ComponentFactory
Feb 24, 2016 9:21:14 AM org.springframework.richclient.application.support.DefaultApplicationServices$19 build
INFO: Creating default service impl: ViewDescriptorRegistry
Feb 24, 2016 9:21:14 AM org.springframework.richclient.application.support.DefaultApplicationServices$27 build
INFO: Creating default service impl: PageComponentPaneFactory
Feb 24, 2016 9:21:14 AM org.springframework.richclient.core.LabeledObjectSupport getDisplayName
INFO: This labeled object's display name is not configured; returning 'displayName'
Feb 24, 2016 9:33:19 AM org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext#45283ce2: display name [org.springframework.context.support.ClassPathXmlApplicationContext#45283ce2]; startup date [Wed Feb 24 09:21:13 PST 2016]; root of context hierarchy
Feb 24, 2016 9:33:19 AM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#591f989e: defining beans [serviceLocator,applicationServices,applicationEventMulticaster,application,windowCommandManager,lifecycleAdvisor,applicationDescriptor,messageSource,menuBar,userManagementMenu,fd1,fd2,userCommand,userGroupCommand,baseModel,user,userGroup,userFilter,userGroupFilter,abstractFilterForm,userFilterForm,userGroupFilterForm,abstractDataEditor,userDataEditor,userGroupDataEditor,abstractForm,userForm,userGroupForm,abstractDataProvider,userDataProvider,userGroupDataProvider,userService,userGroupService,userView,userGroupView]; root of factory hierarchy
The label and text box are displayed, but there is no tool bar. Any idea why? Thanking you in anticipation.
package com.mycom.form;
import com.mycom.model.User;
import org.springframework.richclient.form.builder.FormLayoutFormBuilder;
public class UserForm extends AbstractForm{
public UserForm(String formId, User user) throws Exception{
super(formId, user);
}
protected void addComponents(FormLayoutFormBuilder builder){
super.addComponents(builder);
builder.addPropertyAndLabel("dateOfBirth");
builder.nextRow();
builder.addPropertyAndLabel("userGroup");
}
}
AbstractForm code:
package com.mycom.form;
import javax.swing.JComponent;
import com.jgoodies.forms.layout.FormLayout;
import com.mycom.model.BaseModel;
import org.springframework.binding.form.FieldMetadata;
import org.springframework.richclient.form.FormModelHelper;
import org.springframework.richclient.form.TabbedForm;
import org.springframework.richclient.form.builder.FormLayoutFormBuilder;
public class AbstractForm extends TabbedForm{
private String tabName;
public AbstractForm(String formId, BaseModel baseModel) throws Exception{
super(FormModelHelper.createFormModel(baseModel, formId));
}
protected Tab[] getTabs(){
FormLayout layout = new FormLayout("default, 3dlu, fill:pref:nogrow", "default");
FormLayoutFormBuilder builder = new FormLayoutFormBuilder(getBindingFactory(), layout);
addComponents(builder);
return new Tab[] {new Tab(getTabName(), builder.getPanel())};
}
protected void addComponents(FormLayoutFormBuilder builder){
builder.addPropertyAndLabel("id");
builder.nextRow();
JComponent nameComponent = builder.addPropertyAndLabel("name")[1];
builder.nextRow();
FieldMetadata idMetaData = getFormModel().getFieldMetadata("id");
idMetaData.setReadOnly(true);
setFocusControl(nameComponent);
}
protected String getTabName(){
return tabName;
}
public void setTabName(String tabName) {
this.tabName = tabName;
}
}
Form beans:
<bean name="abstractForm" scope="prototype" abstract = "true">
<property name= "tabName" value="Detail" />
</bean>
<bean name="userForm" scope="prototype" class="com.mycom.form.UserForm">
<constructor-arg index = "0" value="userForm" />
<constructor-arg index = "1" ref="user" />
<property name= "tabName" value="User Detail" />
</bean>

Issues with Oracle JDBC with Hibernate... Sometimes

I'm having a bit of a unique issue.
I'm able to successfully connect and manage entities when running JUnit tests, but once I start my actual application, I get "Specified JDBC Driver oracle.jdbc.OracleDriver class not found."
What confuses me is that it is there. It works when running my JUnit Tests.
Any insights are appreciated!
hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="db">
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:#host:port/db</property>
<property name="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.default_schema">db</property>
<property name="show_sql">true</property>
<mapping resource="org/entity/RunResultEntity.hbm.xml"/>
<mapping resource="org/entity/TransactionResultEntity.hbm.xml"/>
<mapping resource="org/entity/FailureResultEntity.hbm.xml"/>
</session-factory>
</hibernate-configuration>
HibernateUtil.java
package org.util;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.*;
public class HibernateUtil {
private static SessionFactory sessionFactory = buildSessionFactory();
private static SessionFactory buildSessionFactory() {
try {
// Create the SessionFactory from hibernate.cfg.xml
Configuration configuration = new Configuration();
configuration.configure();
ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(
configuration.getProperties()
).buildServiceRegistry();
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
return sessionFactory;
} catch (Throwable ex) {
// Exception thrown here!
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
public static void shutdown() {
// Close caches and connection pools
getSessionFactory().close();
}
}
pom.xml (dependency added to local repository)
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3.0</version>
<scope>provided</scope>
</dependency>
log
Oct 09, 2014 3:02:58 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Oct 09, 2014 3:02:58 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.0.1.Final}
Oct 09, 2014 3:02:58 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Oct 09, 2014 3:02:58 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Oct 09, 2014 3:02:58 PM org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
Oct 09, 2014 3:02:58 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
Oct 09, 2014 3:02:58 PM org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: org/entity/RunResultEntity.hbm.xml
Oct 09, 2014 3:02:59 PM org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: org/entity/TransactionResultEntity.hbm.xml
Oct 09, 2014 3:02:59 PM org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: org/entity/FailureResultEntity.hbm.xml
Oct 09, 2014 3:02:59 PM org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: db
Oct 09, 2014 3:02:59 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
Initial SessionFactory creation failed.org.hibernate.HibernateException: Specified JDBC Driver oracle.jdbc.OracleDriver class not found
Exception in thread "main" java.lang.ExceptionInInitializerError
I found my problem. Lower in my pom.xml I had this little snippet
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.1.Final</version>
<classifier>tests</classifier>
</dependency>
The classifier was only giving access to my test suite. Removing the classifier fixed the issue.
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.1.Final</version>
</dependency>

WARNING: No mapping found for HTTP request with URI [/CustomerDetails/] in DispatcherServlet with name 'customerdispatcher' [duplicate]

This question already has answers here:
Why does Spring MVC respond with a 404 and report "No mapping found for HTTP request with URI [...] in DispatcherServlet"?
(13 answers)
Closed 6 years ago.
I had a issue in spring3 frameowrk.org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/CustomerDetails/] in DispatcherServlet with name 'customerdispatcher'
Please see the following
Jun 01, 2014 11:16:27 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\PC Connectivity Solution\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Sony\VAIO Improvement\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files\MySQL\MySQL Server 5.1\bin;;.
Jun 01, 2014 11:16:28 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:CustomerDetails' did not find a matching property.
Jun 01, 2014 11:16:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 01, 2014 11:16:28 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 01, 2014 11:16:28 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1635 ms
Jun 01, 2014 11:16:28 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 01, 2014 11:16:28 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.50
Jun 01, 2014 11:16:30 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\Smileanbu\Documents\Spring_JDBC\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\CustomerDetails\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
Jun 01, 2014 11:16:33 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jun 01, 2014 11:16:33 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'customerdispatcher'
Jun 01, 2014 11:16:33 AM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'customerdispatcher': initialization started
Jun 01, 2014 11:16:33 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'customerdispatcher-servlet': startup date [Sun Jun 01 11:16:33 IST 2014]; root of context hierarchy
Jun 01, 2014 11:16:34 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/customerdispatcher-servlet.xml]
Jun 01, 2014 11:16:34 AM org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider registerDefaultFilters
INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
Jun 01, 2014 11:16:35 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#19705d39: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,viewResolver,dataSource,sessionFactory,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,transactionManager,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
300 [localhost-startStop-1] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
312 [localhost-startStop-1] INFO org.hibernate.cfg.Environment - Hibernate 3.6.10.Final
315 [localhost-startStop-1] INFO org.hibernate.cfg.Environment - hibernate.properties not found
321 [localhost-startStop-1] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
327 [localhost-startStop-1] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
479 [localhost-startStop-1] INFO org.hibernate.cfg.Configuration - configuring from url: file:/C:/Users/Smileanbu/Documents/Spring_JDBC/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/CustomerDetails/WEB-INF/classes/hibernate.cfg.xml
538 [localhost-startStop-1] WARN org.hibernate.util.DTDEntityResolver - recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
594 [localhost-startStop-1] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
688 [localhost-startStop-1] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.springforbeginners.model.Customer
778 [localhost-startStop-1] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.springforbeginners.model.Customer on table CUSTOMER
900 [localhost-startStop-1] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
Jun 01, 2014 11:16:36 AM org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory
INFO: Building new Hibernate SessionFactory
919 [localhost-startStop-1] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
929 [localhost-startStop-1] INFO org.hibernate.connection.ConnectionProviderFactory - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
1606 [localhost-startStop-1] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
1641 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Database ->
name : MySQL
version : 5.1.73-community
major : 5
minor : 1
1641 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Driver ->
name : MySQL-AB JDBC Driver
version : mysql-connector-java-5.1.14 ( Revision: ${bzr.revision-id} )
major : 5
minor : 1
1644 [localhost-startStop-1] INFO org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
1648 [localhost-startStop-1] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
1648 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
1648 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
1649 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
1649 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
1651 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
1651 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
1651 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
1653 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
1654 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
1654 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
1654 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
1654 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
1654 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
1661 [localhost-startStop-1] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
1661 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
1661 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
1663 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
1663 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
1663 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
1681 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
1681 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
1699 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
1701 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
1702 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
1702 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
1702 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
1702 [localhost-startStop-1] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
1751 [localhost-startStop-1] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
1788 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType#236f7565
1788 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [clob] overrides previous : org.hibernate.type.ClobType#6a844c0f
1788 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType#6a844c0f
1788 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType#139da36b
1788 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType#5253cfdc
1788 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType#7c739ebd
1788 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType#abaca20
1789 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [blob] overrides previous : org.hibernate.type.BlobType#6d2c0060
1789 [localhost-startStop-1] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType#6d2c0060
2313 [localhost-startStop-1] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
Jun 01, 2014 11:16:38 AM org.springframework.orm.hibernate3.HibernateTransactionManager afterPropertiesSet
INFO: Using DataSource [org.apache.commons.dbcp.BasicDataSource#1c53ccd6] of Hibernate SessionFactory for HibernateTransactionManager
Jun 01, 2014 11:16:38 AM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'customerdispatcher': initialization completed in 4758 ms
Jun 01, 2014 11:16:38 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 01, 2014 11:16:38 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 01, 2014 11:16:38 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 10104 ms
Jun 01, 2014 11:16:40 AM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/CustomerDetails/] in DispatcherServlet with name 'customerdispatcher'
customerdispatcher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<context:annotation-config />
<context:component-scan base-package="com.springforbeginners.controller.CustomerController" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/customerdb"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<tx:annotation-driven />
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
</beans>
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<servlet>
<servlet-name>customerdispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>customerdispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/index</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
</web-app>
CustomerController class
package com.springforbeginners.controller;
import com.springforbeginners.model.Customer;
import com.springforbeginners.service.CustomerService;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
#Controller
public class CustomerController {
#Autowired
private CustomerService customerService;
#RequestMapping("/index")
public String listCustomers(Map<String, Object> map) {
map.put("customer", new Customer());
map.put("customerList", customerService.listCustomer());
return "customer";
}
#RequestMapping(value = "/add", method = RequestMethod.POST)
public String addCustomer(#ModelAttribute("customer") Customer customer, BindingResult result) {
customerService.addCustomer(customer);
return "redirect:/index";
}
#RequestMapping("/delete/{customerId}")
public String deleteCustomer(#PathVariable("customerId") Integer customerId) {
customerService.removeCustomer(customerId);
return "redirect:/index";
}
}
I am not able to get my customer.jsp page it is present in my WEB_INF/jsp/customer.jsp.Please help me from this error No matching Http request for URL
WARNING: No mapping found for HTTP request with URI [/CustomerDetails/] in DispatcherServlet with name 'customerdispatcher'
In your controller or your web.xml, there's nothing that maps yor URI to CustomerDetails. You should either change
<url-pattern>/</url-pattern> to <url-pattern>/CustomerDetails</url-pattern>
or add this in your controller
#Controller
#RequestMapping(value = "CustomerDetails")
public class CustomerController {
...
}
And then you can call the url by:
Context/CustomerDetails/index
And by the way, in your <welcome-file-list>, if you are trying to call the servlet on initializing, it won't work, the <welcome-file> has to be a "file".

Getting error in spring RMI

I am getting the following error while developing an application of spring RMI below is the code ..
The serializable class..
package co.tcs.pojo;
import java.io.Serializable;
public class Message implements Serializable {
private final String message;
public Message(String message) { this.message = message; }
public String getMessage() { return message; }
}
the interface ...
package com.tcs;
import co.tcs.pojo.Message;
interface EasyServer {
Message exchangeMessage(String user);
}
the implementation class and the server class also...
package com.tcs;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import co.tcs.pojo.Message;
public class EasyServerImpl implements EasyServer {
public Message exchangeMessage(String user) {
return new Message(user + ", Spring rocks!");
}
public static void main(String[] args) {
try{
ApplicationContext appctx=new FileSystemXmlApplicationContext("src/SpringContainer.xml");
System.out.println("RMI Server started.....>>");
}
catch(Exception e)
{
System.out.println("Exception : ServerProgram : main() : "); System.out.println("----->");
e.printStackTrace();
System.out.println("<-----"); }
}
}
finally the xml ..
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="easyServer" class="com.tcs.EasyServerImpl">
</bean>
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
<!-- register the impl as the 'easyServerService' -->
<property name="serviceName" value="easyServerService"/>
<property name="service" ref="easyServer"/>
<property name="serviceInterface" value="EasyServer"/>
<!-- defaults to 1099 -->
<property name="registryPort" value="1199"/>
</bean>
</beans>
the snap shot of the package structure..
http://imageshack.us/photo/my-images/607/sd1l.jpg/
the error I am getting is..
15 Dec, 2012 5:01:10 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.FileSystemXmlApplicationContext#70eb7859: display name [org.springframework.context.support.FileSystemXmlApplicationContext#70eb7859]; startup date [Sat Dec 15 17:01:10 IST 2012]; root of context hierarchy
15 Dec, 2012 5:01:10 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [D:\Pos2Workspace\ztestRmi\src\SpringContainer.xml]
15 Dec, 2012 5:01:10 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext#70eb7859]: org.springframework.beans.factory.support.DefaultListableBeanFactory#28bb0d0d
15 Dec, 2012 5:01:10 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#28bb0d0d: defining beans [easyServer,org.springframework.remoting.rmi.RmiServiceExporter#0]; root of factory hierarchy
15 Dec, 2012 5:01:10 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#28bb0d0d: defining beans [easyServer,org.springframework.remoting.rmi.RmiServiceExporter#0]; root of factory hierarchy
Exception : ServerProgram : main() :
----->
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter#0' defined in file [D:\Pos2Workspace\ztestRmi\src\SpringContainer.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'serviceInterface'; nested exception is java.lang.IllegalArgumentException: Cannot find class [EasyServer]. Root cause: java.lang.ClassNotFoundException: EasyServer
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:124)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:68)
at com.tcs.EasyServerImpl.main(EasyServerImpl.java:18)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'serviceInterface'; nested exception is java.lang.IllegalArgumentException: Cannot find class [EasyServer]. Root cause: java.lang.ClassNotFoundException: EasyServer
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:395)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1313)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1285)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
... 13 more
Caused by: java.lang.IllegalArgumentException: Cannot find class [EasyServer]. Root cause: java.lang.ClassNotFoundException: EasyServer
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:252)
at org.springframework.beans.propertyeditors.ClassEditor.setAsText(ClassEditor.java:63)
at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:341)
at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:325)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:192)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:390)
... 17 more
Root cause: java.lang.ClassNotFoundException: EasyServer
interface EasyServer is in package com.tcs
you might want to try
<property name="serviceInterface" value="com.tcs.EasyServer"/>

Resources