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=" ...
随机推荐
- LSTM简介以及数学推导(FULL BPTT)
http://blog.csdn.net/a635661820/article/details/45390671 前段时间看了一些关于LSTM方面的论文,一直准备记录一下学习过程的,因为其他事儿,一直 ...
- ueditor插入自定义内容和样式
UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点 通过UEditor提供的API接口可以很方便的读写操作内容并设置编辑器里的样式 页 ...
- Softmax 函数的特点和作用是什么?
作者:张欣链接:https://www.zhihu.com/question/23765351/answer/98897364来源:知乎著作权归作者所有,转载请联系作者获得授权. softmax 回归 ...
- 保存登录plsql developer 的用户名和密码
1 保存用户名 tools -> Preferences -> User Interface - Options 勾选 Autosave username . 保存 2 保存密码 tool ...
- Android Studio打开出现:Default activity not found
昨天项目可以正常打开,没有问题,今天打开的时候就出现了这个问题.可以编译,但是无法生成APK调试.当然,如果选择 Do not launch Activity就可以成功编译.出现这个 Default ...
- Unlicensed ARC session – terminating!
问题描述 近日,发现ArcGIS10.4中存在很多bug,而且费了好多时间去测试它,最终决定改用10.1.在降级程序时遇到许可问题. 重装ArcGIS10.1后,打开工程,所有引用都自动映射,没报任何 ...
- SDE操作的许可问题
ArcGIS二次开发和ArcGIS桌面应用中,许可是一个老生常谈的问题.以前也小结过一些经验.参考: http://www.cnblogs.com/liweis/p/4185311.html 问题描述 ...
- windows安装python2.7后的注册(registry)问题
[提要]win平台上,python2.7官网的安装包在安装后不会添加环境变量且不会把安装信息写入注册表. 把python和pip的安装路径添加到环境变量是做python开发必要的一步,而写入注册表的原 ...
- Cocos开发中可能会遇到的问题
开发中碰到的问题及解决方案: 1:场景工程中没有被依赖关联的图片声音或者其它资源,导出到微信后找不到 有些在场景工程中没有指定而通过代码中动态加载的资源,cocos creator不会导出到发布目 ...
- oracle下的数据库实例、表空间、用户及其表的区分
完整的Oracle数据库通常由两部分组成:Oracle数据库和数据库实例. 1) 数据库是一系列物理文件的集合(数据文件,控制文件,联机日志,参数文件等): 2) Oracle数据库实例则是一组Ora ...