Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Jun 24, 2016 1:39:36 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
- WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SpringDataDemo' did not find a matching property.
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Server version: Apache Tomcat/8.0.36
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Server built: Jun 9 2016 13:55:50 UTC
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Server number: 8.0.36.0
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: OS Name: Windows 10
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: OS Version: 10.0
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Architecture: amd64
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Java Home: C:Program FilesJavajre1.8.0_91
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: JVM Version: 1.8.0_91-b14
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: JVM Vendor: Oracle Corporation
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: CATALINA_BASE: C:UsersuserDevelopmentSpringProjects.metadata.pluginsorg.eclipse.wst.server.coretmp1
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: CATALINA_HOME: C:UsersuserDevelopmentSpringServerapache-tomcat-8.0.36
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Command line argument: -Dcatalina.base=C:UsersmuserDevelopmentSpringProjects.metadata.pluginsorg.eclipse.wst.server.coretmp1
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Command line argument: -Dcatalina.home=C:UsersuserDevelopmentSpringServerapache-tomcat-8.0.36
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Command line argument: -Dwtp.deploy=C:UsersuserDevelopmentSpringProjects.metadata.pluginsorg.eclipse.wst.server.coretmp1wtpwebapps
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Command line argument: -Djava.endorsed.dirs=C:UsersuserDevelopmentSpringServerapache-tomcat-8.0.36endorsed
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.VersionLoggerListener log
- INFORMATION: Command line argument: -Dfile.encoding=Cp1252
- Jun 24, 2016 1:39:36 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
- INFORMATION: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:Program FilesJavajre1.8.0_91bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;C:/Program Files/Java/jre1.8.0_91/bin/server;C:/Program Files/Java/jre1.8.0_91/bin;C:/Program Files/Java/jre1.8.0_91/lib/amd64;C:ProgramDataOracleJavajavapath;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:xamppphp;C:Program Filesnodejs;C:ProgramDataComposerSetupbin;C:Usersdennis.goldenbergAppDataRoamingnpm;C:Usersdennis.goldenbergAppDataRoamingComposervendorbin;C:Usersdennis.goldenbergAppDataRoamingnpmnode_modulesgulpbin;C:Program FilesJavajdk1.8.0_91bin;C:Program FilesGitcmd;C:Program Files (x86)GitExtensions;C:UsersuserDevelopmentSpringeclipse-jee-mars-2-win32-x86_64eclipse;C:Program FilesApachemavenbin;C:Program FilesApachemavenbin;C:Program Files (x86)SkypePhone;C:Program FilesMicrosoft SQL ServerClient SDKODBC110ToolsBinn;C:Program Files (x86)Microsoft SQL Server120ToolsBinn;C:Program FilesMicrosoft SQL Server120ToolsBinn;C:Program FilesMicrosoft SQL Server120DTSBinn;C:Program Files (x86)Microsoft SQL Server120ToolsBinnManagementStudio;C:Program Files (x86)Microsoft SQL Server120DTSBinn;C:UsersuserAppDataLocalAndroidSdkplatform-tools;C:UsersuserDevelopmentSpringsts-bundlests-3.7.3.RELEASE;;.
- Jun 24, 2016 1:39:36 PM org.apache.coyote.AbstractProtocol init
- INFORMATION: Initializing ProtocolHandler ["http-nio-8080"]
- Jun 24, 2016 1:39:36 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
- INFORMATION: Using a shared selector for servlet write/read
- Jun 24, 2016 1:39:36 PM org.apache.coyote.AbstractProtocol init
- INFORMATION: Initializing ProtocolHandler ["ajp-nio-8009"]
- Jun 24, 2016 1:39:36 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
- INFORMATION: Using a shared selector for servlet write/read
- Jun 24, 2016 1:39:36 PM org.apache.catalina.startup.Catalina load
- INFORMATION: Initialization processed in 434 ms
- Jun 24, 2016 1:39:36 PM org.apache.catalina.core.StandardService startInternal
- INFORMATION: Starting service Catalina
- Jun 24, 2016 1:39:36 PM org.apache.catalina.core.StandardEngine startInternal
- INFORMATION: Starting Servlet Engine: Apache Tomcat/8.0.36
- Jun 24, 2016 1:39:38 PM org.apache.jasper.servlet.TldScanner scanJars
- INFORMATION: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
- Jun 24, 2016 1:39:38 PM org.apache.coyote.AbstractProtocol start
- INFORMATION: Starting ProtocolHandler ["http-nio-8080"]
- Jun 24, 2016 1:39:38 PM org.apache.coyote.AbstractProtocol start
- INFORMATION: Starting ProtocolHandler ["ajp-nio-8009"]
- Jun 24, 2016 1:39:38 PM org.apache.catalina.startup.Catalina start
- INFORMATION: Server startup in 1274 ms
- public class SpringDataDemo {
- public static void main(String[] args) {
- try {
- ApplicationContext context = new ClassPathXmlApplicationContext("resources\spring-configuration.xml");
- // Fetch the DAO from Spring Bean Factory
- EmployeeDao employeeDao = (EmployeeDao) context.getBean("EmployeeDaoImpl");
- Employee employee = new Employee("Employee123");
- // employee.setEmployeeId("1");
- // Save an employee Object using the configured Data source
- employeeDao.save(employee);
- System.out.println("Employee Saved with EmployeeId " + employee.getEmployeeId());
- // find an object using Primary Key
- Employee emp = employeeDao.findByPrimaryKey(employee.getEmployeeId());
- System.out.println(emp);
- // Close the ApplicationContext
- ((ConfigurableApplicationContext) context).close();
- } catch (BeansException | SQLException e) {
- e.printStackTrace();
- }
- }
- }
- <?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:aop="http://www.springframework.org/schema/aop"
- xmlns:context="http://www.springframework.org/schema/context" 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.0.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd">
- <context:component-scan base-package="com.base" />
- <bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver" />
- <property name="url" value="jdbc:mysql://localhost:3306/maschinedb?serverTimezone=UTC" />
- <property name="username" value="root" />
- <property name="password" value="" />
- </bean>
- <bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
- <bean id="entityManagerFactory"
- class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
- <property name="persistenceUnitName" value="jcgPersistence" />
- <property name="dataSource" ref="dataSource" />
- <property name="persistenceXmlLocation" value="META-INF/persistence.xml" />
- <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
- <property name="jpaDialect" ref="jpaDialect" />
- <property name="jpaProperties">
- <props>
- <prop key="hibernate.hbm2ddl.auto">validate</prop>
- <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
- </props>
- </property>
- </bean>
- <bean id="jpaVendorAdapter"
- class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
- </bean>
- <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="entityManagerFactory" />
- <property name="dataSource" ref="dataSource" />
- <property name="jpaDialect" ref="jpaDialect" />
- </bean>
- <tx:annotation-driven transaction-manager="txManager" />
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement