Tomcat 6 部署工程总结,使用JNDI数据源配置
<Resource name="ipeerDs" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="ipeer_new" password="passw0rd!" driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@1.1.1.1:1555:dbname"/>
</Context>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="localhost_oracle" transaction-type="JTA">
<description>generated-persistence-unit</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- jboss need -->
<!-- <jta-data-source>java:/ipeerDs</jta-data-source> -->
<class>com.iproject.core.domain.Authorities</class>
<class>com.iproject.core.domain.Users</class>
<class>com.iproject.core.domain.TSysFunction</class>
<class>com.iproject.core.domain.TSysLog</class>
<class>com.iproject.core.domain.TSysSeriano</class>
<class>com.iproject.core.domain.TBicAgtPrmInfo</class>
<class>com.iproject.core.domain.TBicFinChargebill</class>
<class>com.iproject.core.domain.TSysDept</class>
<class>com.iproject.core.domain.Domain</class>
<class>com.iproject.core.domain.DomainValue</class>
<class>com.iproject.core.domain.TBicPrdTyp</class>
<class>com.iproject.core.domain.TBicCancelInfo</class>
<class>com.iproject.core.domain.SynchronizationTask</class>
<class>com.iproject.core.domain.ProcessDefinition</class>
<class>com.iproject.core.domain.ProcessInstance</class>
<class>com.iproject.core.domain.TBicPrmPlyRel</class>
<class>com.iproject.core.domain.TBicPrmPlyRelId</class>
<class>com.iproject.core.domain.TBicResConfig</class>
<class>com.iproject.core.domain.TBicLog</class>
<class>com.iproject.core.domain.TBicEmp</class>
<class>com.iproject.core.domain.TBasTrdCode</class>
<class>com.iproject.core.domain.PlyuploadLob</class>
<class>com.iproject.core.domain.TBicPlyMain</class>
<class>com.iproject.core.domain.TBicPrdTypCvrgRel</class>
<class>com.iproject.core.domain.TBicPrdTypRel</class>
<class>com.iproject.core.domain.TBicPrmCompute</class>
<class>com.iproject.core.domain.TBicPrmComputeSet</class>
<class>com.iproject.core.domain.TBicEmpCombo</class>
<class>com.iproject.core.domain.TBicVariflightComm</class>
<class>com.iproject.core.domain.TSrcProdSpecRel</class>
<class>com.iproject.core.domain.TBicRateSetSpl</class>
<class>com.iproject.core.domain.TBicElecAir</class>
<class>com.iproject.core.domain.TBicPacketLog</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
</persistence>
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- The request dumper valve dumps useful debugging information about
the request and response data received and sent by Tomcat.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->
<!--
<Context path="/peerv6_test" docBase="G:\workspace\peerv6_test\WebRoot" reloadable="false"/>
-->
<Context path="/ipeer-interface" docBase="G:\workspace\ipeer-interface\WebRoot" reloadable="false">
<Resource name="ipeerDs" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="ipeer_new" password="passw0rd!" driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@1.1.1.1:1555:dbname"/>
</Context>
<!--
<Context path="/ipeer-task" docBase="G:\workspace\ipeer-task\WebRoot" reloadable="false"/>
-->
<!--
<Context path="/ipeer" docBase="G:\workspace\ipeer\WebRoot" reloadable="false"/>
-->
</Host>
</Engine>
</Service>
</Server>
spring-dao-context.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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/tx http://www.springframework.org/schema/tx/spring-tx-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/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
<!-- ******************************************************************** -->
<!-- Scan for service layer annotated beans -->
<!-- ******************************************************************** -->
<context:component-scan base-package="com.iproject.core.dao" scoped-proxy="interfaces" />
<!-- ******************************************************************** -->
<!-- PropertyConfigurer for the DAO -->
<!-- ******************************************************************** -->
<context:property-placeholder location="classpath:standard-dao.properties" />
<!-- ******************************************************************** -->
<!-- Setup the transaction manager -->
<!-- ******************************************************************** -->
<!-- Using Atomikos Transaction Manager -->
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close">
<property name="forceShutdown" value="true" />
<property name="startupTransactionService" value="true" />
<property name="transactionTimeout" value="60" />
</bean>
<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp" />
<!-- Configure the Spring framework to use JTA transactions from Atomikos -->
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="atomikosTransactionManager" />
<property name="userTransaction" ref="atomikosUserTransaction" />
<!-- <property name="transactionSynchronizationName" value="SYNCHRONIZATION_ON_ACTUAL_TRANSACTION" /> -->
</bean>
<!-- 启动注解功能 -->
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- ******************************************************************** -->
<!-- Setup a data source -->
<!-- ******************************************************************** -->
<bean name="localhost_oracleDS,springSecurityDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton">
<!-- jboss format -->
<!-- <property name="jndiName" value="java:/ipeerDs"/>-->
<!-- tomcat format -->
<property name="jndiName" value="java:comp/env/ipeerDs"/>
</bean>
<!-- Using Apache DBCP Data Sources -->
<!-- <bean class="org.apache.commons.dbcp.BasicDataSource"-->
<!-- destroy-method="close" name="localhost_oracleDS,springSecurityDataSource">-->
<!-- <property name="driverClassName" value="${localhost_oracle.connection.driver_class}" />-->
<!-- <property name="username" value="${localhost_oracle.connection.username}" />-->
<!-- <property name="password" value="${localhost_oracle.connection.password}" />-->
<!-- <property name="url" value="${localhost_oracle.connection.url}" />-->
<!-- <property name="maxIdle" value="${localhost_oracle.minPoolSize}" />-->
<!-- <property name="maxActive" value="${localhost_oracle.maxPoolSize}" />-->
<!-- </bean>-->
<!-- ******************************************************************** -->
<!-- Setup each persistence unit -->
<!-- ******************************************************************** -->
<!-- Configure a JPA vendor adapter -->
<bean id="localhost_oracleJPAVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="${localhost_oracle.show_sql}" />
<property name="generateDdl" value="${localhost_oracle.generateDdl}" />
<property name="databasePlatform" value="${localhost_oracle.dialect}" />
</bean>
<!-- EntityManager Factory that brings together the persistence unit, datasource,
and JPA Vendor -->
<bean
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
id="localhost_oracle">
<property name="dataSource" ref="localhost_oracleDS" />
<property name="persistenceUnitName" value="localhost_oracle" />
<property name="jpaVendorAdapter" ref="localhost_oracleJPAVendorAdapter" />
<property name="jpaPropertyMap">
<map>
<entry key="hibernate.transaction.manager_lookup_class"
value="com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup" />
<entry key="hibernate.connection.release_mode" value="on_close" />
</map>
</property>
</bean>
<bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
<property name="entityManagerFactory" ref="localhost_oracle" />
</bean>
<bean id="commonDAO" class="com.iproject.core.dao.CommonDAO">
<property name="entityManagerFactory" ref="localhost_oracle" />
</bean>
</beans>
web.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>ipeer-interface</display-name>
<description>永诚银保通接口平台</description>
<!-- JNDI数据源,tomcat6可以不需要 -->
<!-- <resource-ref>-->
<!-- <res-ref-name>ipeerDs</res-ref-name>-->
<!-- <res-type>javax.sql.DataSource</res-type>-->
<!-- <res-auth>Container</res-auth>-->
<!-- </resource-ref>-->
<context-param>
<description></description>
<param-name>EAPConfig</param-name>
<param-value>/WEB-INF/EAPConfig.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring刷新Interceptor防止内存泄漏 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<!-- 启动Socket服务 -->
<listener>
<listener-class>com.iproject.core.restful.SocketServiceInit</listener-class>
</listener>
<filter>
<description>generated-persistence-filter</description>
<filter-name>localhost_oracleFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
<init-param>
<param-name>entityManagerFactoryBeanName</param-name>
<param-value>localhost_oracle</param-value>
</init-param>
</filter>
<!-- Character Encoding filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>localhost_oracleFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>InitParameterServlet</servlet-name>
<servlet-class>com.iproject.core.fwk.web.servlet.InitParameterServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<servlet-name>EAPConfigServlet</servlet-name>
<servlet-class>com.iproject.core.fwk.web.servlet.EAPConfigServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- webservice -->
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/pages/login.jsp</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/pages/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/pages/error.jsp</location>
</error-page>
</web-app>
Tomcat 6 部署工程总结,使用JNDI数据源配置的更多相关文章
- Linux - tomcat -jndi数据源配置
Linux - tomcat -jndi数据源配置 tomcat/conf/context .xml 文件中修改如下 <Resource name="/jdbc/--" au ...
- JNDI数据源配置
一.数据源的由来 在Java开发中,使用JDBC操作数据库的四个步骤如下: ①加载数据库驱动程序(Class.forName("数据库驱动类");) ②连接数据库(Connec ...
- mysql连接超时与jndi数据源配置
昨天有运营说添加活动不能用了,我就看了一下后台日志,发现访问数据库是报错: at java.lang.Thread.run(Thread.java:722) Caused by: com.mysql. ...
- Hibernate Tomcat JNDI数据源配置(转)
简述: 配置JNDI 查找Tomcat 中server.xml中定义的数据源 步骤: 1. 修改elipse的数据源server.xml 主要修改如下, 1. 添加下面这段Context文本 其中St ...
- 在tomcat下部署工程
xx系统第一期工程完成,今天老大要我去部署系统,从来就没有在tomcat下部署过,一直都是在myeclipse下部署.启动.运行即可,所以这次遇到了几个问题,记录下来. tomcat启动 在安装tom ...
- Spring jndi数据源配置方法
xml配置: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverMana ...
- tomcat下context.xml中JNDI数据源配置
jndi(Java Naming and Directory Interface,Java命名和目录接口)是一组在Java应用中访问命名和目录服务的API.命名服务将名称和对象联系起来,使得我们可以用 ...
- tomcat之JNDI数据源配置
一.docbase包含方式部署项目 D:\apache-tomcat-6.0.29\conf\server.xml里面添加如下内容 <Host name="localhost&qu ...
- JNDI数据源配置注意事项
假设是在原有project上改动 1,applicationContext.xml中改动当中的value值 <bean id="dataSource" class=" ...
随机推荐
- getWidth() 和 getMeasuredWidth()的区别
getWidth(): View在设定好布局后整个View的宽度. getMeasuredWidth(): 对View上的内容进行测量后得到的View内容占据的宽度,前提是你必须在父布局的onLa ...
- RobotFramework+Selenium2+Appium环境搭建
转载:https://www.cnblogs.com/testway/p/7372326.html 装python 2.7 RobotFramework是python2 写的,图形界面使用的wxpyt ...
- myeclipse单元测试
步骤:1.新建new-other 2.选择Junit Test Case 3.注意红线圈出部分 4.选择需要测试的方法5.Finish后出现如下 示例代码: package com.jrgc.dao; ...
- linux安装experss搭建本地服务器
准备nodejs和npm 保证本地安装了nodeJS和npm,如果没有安装的话,通过下面的命令进行安装: sudo apt-get install nodejs //安装nodeJS sudo apt ...
- vasa构架
- Linux中使用ps、awk、sh一起批量杀死所有的dotnet进程。
一.操作 Linux中使用ps.awk.sh一起批量杀死所有的dotnet进程. 二.参考命令 ps -ef|grep dotnet|awk 'NR==2{print "kill " ...
- miniOrm
PetaPoco.Core https://www.nuget.org/packages/PetaPoco.Core/5.1.228
- linux2.6.30.4内核移植(2)——Nand Flash驱动移植
内核源码:linux2.6.30.4 交叉编译工具:3.4.5 移植linux内核至:TQ2440 工作基础:http://www.cnblogs.com/nufangrensheng/p/36696 ...
- The ECDSA host key for XXX has changed
运行Hadoop时出现了: 导致运行失败.仔细分析后发现,这是因为以前192.168.1.201的主机名为master,后来把192.168.1.202改名为master,由于两台主机的公钥不一样,所 ...
- SSH使用Log4j
1. 将Jar文件log4j-1.2.14.jar导入项目. 2. 在src文件夹下新建log4j.properties文件: log4j.rootLogger = debug,stdout,D,E ...