关于tomcat的server.xml配置文件 host 中配置多个Context 的问题? 5C

配置文件中的代码片段如下所示:

<Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Context path="/mn" docBase="/usr/local/yiyun/project/yiyunManage"/>
        <Context path="/yymn" docBase="/usr/local/yiyun/project/yiyunManagePro"/>

如上面代码所示!我的“/usr/local/yiyun/project/”路径下面的两个项目都是存在的。然后两个context 中 ,单独每一个都能够正常的启动tomcat,并且都能够访问到对应的路径下面的工程。但是当我两个路径都存在时我的 '/mn' 路径是能访问到的。 但是‘/yymn’路径404!!

12个回答

这里配置的是你项目在tomcat中的路径,不用配置俩个路径只需要一个就好了,当你把项目添加到tomcat中的时候,xml会自动改变context中的路径的。

qq_38256260
HarleYan 没太明白你的意思!我是需要在同一个tomcat中部署两个项目然后,这个路径不是这么配置 ,那我需要怎么配置搞定它!
一年多之前 回复

不用配置俩个路径只需要一个就好

qq_38256260
HarleYan 同一个tomcat部署两个项目,我只需要一个路径,比如 /yy + 对应的项目包名 是吧 ?
一年多之前 回复

检查下你的tomcat进程,全kill 掉后重启服务器访问下试试。ps -ef|grep tomcat 然后挨个kill进程号

没太明白你的意思!我是需要在同一个tomcat中部署两个项目然后,这个路径不是这么配置 ,那我需要怎么配置搞定它!

两个项目争夺资源吧,1.检查数据库连接是不是不够,启动2个项目的
2.项目独占问题,有的项目自己独占tomcat,即一个tomcat只能发布这样的项目一个,同样项目不行,其他项目可以一起发布

用ide就可以直接配置tomcat的热加载。不需要改动xml

不用故意去改这个的。项目放去webapps跑,service.xml会自动更改context的。然后“http://ip:port/项目名”就可以访问了

yymn 把mn改成其他的就可以

你在tomcat部署两个项目不是只要把项目部署到webapps下就行了吗,干嘛还改配置文件

用ide可以直接配置tomcat的热加载,项目放去webapps跑,不用改xml

共12条数据 1 尾页
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
我想请教一下关于easyui中easyui.css文件中的类easyui-tabs的高度无法调整
easyui我是参照菜鸟教程中《jQuery EasyUI 布局 - 动态添加标签页(Tabs》 网址:https://www.runoob.com/jeasyui/jeasyui-layout-tabs2.html 源代码: main_view.jsp <%-- Created by IntelliJ IDEA. User: Atlantide Date: 2020/1/27 Time: 15:51 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="jquery,ui,easy,easyui,web"> <meta name="description" content="easyui help you build your web page easily!"> <title>jQuery EasyUI Demo</title> <link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="http://www.w3cschool.cc/try/jeasyui/themes/icon.css"> <link href="../css/main/main_view.css" rel="stylesheet" type="text/css" /> <link type="text/css" rel="stylesheet" href="../css/main/style.css"/> <link type="text/css" rel="stylesheet" href="../css/main/index.css"/> <script src="../js/jquery.min.js"></script> <!-- 动态菜单JS --> <script type="text/javascript" src="../js/menu.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="http://www.w3cschool.cc/try/jeasyui/jquery.easyui.min.js"></script> <script> function addTab(title, url){ if ($('#tt').tabs('exists', title)){ $('#tt').tabs('select', title); } else { var content = '<iframe scrolling="auto" frameborder="0" src="'+url+'" style="width:100%;height:100%;"></iframe>'; $('#tt').tabs('add',{ title:title, content:content, closable:true }); } } </script> </head> <body> <div class="cont-top"> <img src="../images/main/华依logo.jpg" width="100px" height="80px"> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <img src="../images/main/用户头像.jpg" width="60px" height="50px"> </div> <div style="margin-bottom:10px"> <div class="left-menu" style="height:949px;"> <div class="menu-list"> <ul> <li class="menu-list-01" > <p class="fumenu">库房管理</p> <img class="xiala" src="../images/main/xiala.png" /> <div class="list-p"> <p class="zcd"><a href="#" class="a" onclick="addTab('库房分配','/erp/warehouse_distribution')"> <font color="white">库房分配</font></a></p> <p class="zcd"><a href="#" class="a" onclick="addTab('入库单','/erp/material_warehouse')"> <font color="white">入库单</font></a></p> <p class="zcd"><a href="#" class="a" onclick="addTab('出库单','/erp/product_warehouse')"> <font color="white">出库单</font></a></p> <p class="zcd"><a href="#" class="a" onclick="addTab('库存余额','/erp/product_warehouse')"> <font color="white">库存余额</font></a></p> </div> </li> <li class="menu-list-02" > <p class="fumenu">销售管理</p> <img class="xiala" src="../images/main/xiala.png" /> <div class="list-p"> <p class="zcd"><a href="#" class="a" onclick="addTab('库房分配','/erp/warehouse_distribution')"> <font color="white">库房分配</font></a></p> <p class="zcd"><a href="#" class="a" onclick="addTab('入库单','/erp/material_warehouse')"> <font color="white">入库单</font></a></p> <p class="zcd"><a href="#" class="a" onclick="addTab('出库单','/erp/product_warehouse')"> <font color="white">出库单</font></a></p> <p class="zcd"><a href="#" class="a" onclick="addTab('库存余额','/erp/product_warehouse')"> <font color="white">库存余额</font></a></p> </div> </li> </ul> </div> </div></div> <div class="right-menu"> <div id="tt" class="easyui-tabs" style="width:1200px;height:1000px"> <div title="首页"> </div> </div> </div> </body> </html> warehouse_distribution.jsp <%@ page import="java.util.List" %> <%@ page import="com.springboot.erp.entity.Warehouse" %> <%@ page import="java.util.ArrayList" %><%-- Created by IntelliJ IDEA. User: Atlantide Date: 2020/1/27 Time: 20:47 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>库房分配</title> <link type="text/css" rel="stylesheet" href="../css/main/main_view.css"/> </head> <body> <% List<Warehouse> warehouseList=new ArrayList<Warehouse>(); if(session.getAttribute("all_warehouses_session")!=null){ warehouseList=(List)session.getAttribute("all_warehouses_session"); session.removeAttribute("all_warehouses_session"); } %> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <form action="" method="post"> 请输入仓库号: &emsp;&emsp;&emsp; <input type="text" name="warehouse_no"> &emsp;&emsp;&emsp; <input type="submit" value="查询"> </form> <table border="1" class="t1" width="70%"> <tr> <th>仓库编号</th> <th>仓库名称</th> <th>仓库地址</th> <th>仓库容量</th> <th>仓库租金</th> <th>操作</th> </tr> <% for(Warehouse wh:warehouseList){ %> <tr> <td align="center"><%=wh.getWarehouse_no()%></td> <td align="center"><%=wh.getName()%></td> <td align="center"><%=wh.getLocation()%></td> <td align="center"><%=wh.getVolume()%></td> <td align="center"><%=wh.getRent()%></td> </tr> <% } %> </table> </body> </html> ![图片说明](https://img-ask.csdn.net/upload/202001/29/1580227234_221935.png)
一个Tomcat部署两个springboot项目有一个项目失效
异常信息 ``` com- opens ymphony - xwork2. conf ig - Conf igurat ionException: Unable to load conf iguration. at com . opens ymphon y - xwork2 - conf ig . Conf igurat ionManager . ge tConf igurat ionConf igurat ionManager - java ?0> ~[xwork-core 2.3 -24. jar:2 324] at org . apac he . s truts2. dis patcher . Dis patcher . getCont a iner(Dis patcher . java967) "[struts2 -core 2.324. jar:2.3241 at org . apache . struts2. dis patcher . Dis patcher . init_ Pre loadConf igurat ion(Dipatcher . java:435) "[struts2 core 2.324. jar:2.3.24] at org. apac he . s truts2. dis patc her . Dis patcher . in it (Dis patcher . java:479) [struts2 -core 2.324. jar:2.3.24 at org . apac he . s truts2. dis patc her - ng- In itOperat ions . in itDis patc her( In it0prat ions . java:74) [struts2 -core 2.324.jar:2.3.241 at org- apac he . s truts2. dis patcher - ng .f ilter - St rut s Pre pare AndExecuteFilter. init (S truts Pre pareAndExecute Filter . java:57> [struts2-core -2.3 .24. jar:2.3 24] at org. apac he . catalina . core . Applicat ionFilterConf ig. in itFilter(Applicat inFilterConf ig . java:285> [catalina. jar:8.5.38 ] at org . apac he - cat alina . core - Applic at ionFilterConf ig - ge tF ilter(Applic at ionFilterConf ig . java:266> [catalina. jar:8.5.38 ] at org . apac he . catalina - core . Appl icat ion ilterConf ig . < init (Applicat ion ilterConf ig . java:108> [catalina. jar:8.5.38 at org . apac he . cat alina. core . st andardContext .f ilterS tart (St andardContext .java:4662> [catalina. jar:8.5.38 ] at org - apac he . catalina - core . St andardContext . s tart Inte rnal(S t andardContexjava:5309> [catalina. jar:8.538 ] at org . apac he . cat al ina. ut il. Lifecyc le Base .s tart (Lif ec yc leBase . java:150)[catalina. jar:8.5.38 ] at org. apac he . catalina - core . Conta inerBase . addChildInte rnal(Cont ainerBas e. java:754) [catalina. jar:8.5.38 ] at org . apac he . c at al ina. core . ContainerBas e . addChi ld(ContainerBase . java:73a) [catalina. jar:8.538 at org. apac he . catalina . core . StandardHost . addChild(StandardHos t . java:734>[catalina. jar:8.538 ] at org. apac he . catalina. startup Hos tConf ig . deplo yDirec tory(Hos tConf ig . java:1140> [catalina.jar:8.538 ] at org. apac he . catalina. startup Hos tConf ig$ Deplo yDirec tory - run Hos tConf ig. java:1875> [catalina . jar:8.5381 at java.ut il. concurrent . Executors RunnableAdapter .call(Executors .java:51D [?:1.8.0 181 ] at java. ut il. concurrent . FutureTas k.run(FutureTask . java:266> [?:1.8.0 181 at java. ut il. concurrent . Thre adPoo lExecutor . runWo rke r< Thre adPoo lExecutor. ``` 在每个springboot的配置文件中也都添加了下面这句代码,保证了spring.jmx.default-domain的不同,但是还是有一个失效 ![图片说明](https://img-ask.csdn.net/upload/201911/27/1574821795_169195.png)
apache 配置 多个tomcat 只有第一个项目可用
我的项目,静态资源直接部署apache,3个项目ajp-tomcat 虚拟主机 LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_alias_module modules/mod_authn_alias.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule ldap_module modules/mod_ldap.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule include_module modules/mod_include.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule info_module modules/mod_info.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule substitute_module modules/mod_substitute.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule cache_module modules/mod_cache.so LoadModule suexec_module modules/mod_suexec.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule cgi_module modules/mod_cgi.so LoadModule version_module modules/mod_version.so ProxyPass / ajp://localhost:8050/ ProxyPassReverse / ajp://localhost:8050/ ServerName 211.*.197.*:8020/cont ErrorLog logs/cont-error_log CustomLog logs/cont-access_log common ProxyPass / ajp://localhost:8050/ ProxyPassReverse / ajp://localhost:8050/ ServerName 211.*.197.*:8020/logic ErrorLog logs/logic-error_log CustomLog logs/logic-access_log common ProxyPass / ajp://localhost:8040/ ProxyPassReverse / ajp://localhost:8040/ ServerName 211.*.197.*:8020/upload ErrorLog logs/upload-error_log CustomLog logs/upload-access_log common
Tomcat启动时报错了,严重: Error filterStart
Tomcat启动的时候报错了,严重:Error filterstart. 但是我去掉web.xml的所有filter的配置后,Tomcat启动正常。 详细信息:[code="java"] 2009-08-18 09:24:43,671 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] - Using ASTQueryTranslatorFactory 2009-08-18 09:24:43,687 INFO [org.hibernate.cfg.SettingsFactory] - Query languag e substitutions: {} 2009-08-18 09:24:43,687 INFO [org.hibernate.cfg.SettingsFactory] - JPA-QL strict compliance: disabled 2009-08-18 09:24:43,703 INFO [org.hibernate.cfg.SettingsFactory] - Second-level cache: enabled 2009-08-18 09:24:43,718 INFO [org.hibernate.cfg.SettingsFactory] - Query cache: disabled 2009-08-18 09:24:43,718 INFO [org.hibernate.cfg.SettingsFactory] - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory 2009-08-18 09:24:43,734 INFO [org.hibernate.cfg.SettingsFactory] - Optimize cach e for minimal puts: disabled 2009-08-18 09:24:43,750 INFO [org.hibernate.cfg.SettingsFactory] - Structured se cond-level cache entries: disabled 2009-08-18 09:24:43,765 INFO [org.hibernate.cfg.SettingsFactory] - Echoing all S QL to stdout 2009-08-18 09:24:43,781 INFO [org.hibernate.cfg.SettingsFactory] - Statistics: d isabled 2009-08-18 09:24:43,781 INFO [org.hibernate.cfg.SettingsFactory] - Deleted entit y synthetic identifier rollback: disabled 2009-08-18 09:24:43,796 INFO [org.hibernate.cfg.SettingsFactory] - Default entit y-mode: pojo 2009-08-18 09:24:43,812 INFO [org.hibernate.cfg.SettingsFactory] - Named query c hecking : enabled 2009-08-18 09:24:43,890 INFO [org.hibernate.impl.SessionFactoryImpl] - building session factory 2009-08-18 09:24:44,468 INFO [org.hibernate.impl.SessionFactoryObjectFactory] - Not binding factory to JNDI, no JNDI name configured 2009-08-18 09:24:44,984 INFO [org.springframework.jdbc.datasource.DriverManagerD ataSource] - Loaded JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerDriver 2009-08-18 09:24:45,390 INFO [org.springframework.web.context.ContextLoader] - R oot WebApplicationContext: initialization completed in 4656 ms 2009-8-18 9:24:45 org.apache.catalina.core.StandardContext start 严重: Error filterStart 2009-8-18 9:24:45 org.apache.catalina.core.StandardContext start 严重: Context startup failed due to previous errors 2009-08-18 09:24:45,937 INFO [org.springframework.web.context.support.XmlWebAppl icationContext] - Closing org.springframework.web.context.support.XmlWebApplicat ionContext@354749: display name [Root WebApplicationContext]; startup date [Tue Aug 18 09:24:40 CST 2009]; root of context hierarchy 2009-08-18 09:24:45,953 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - Destroying singletons in org.springframework.beans.factory .support.DefaultListableBeanFactory@12b19c5: defining beans [com.oa.co ntroller.service.LoginService,com.oa.controller.service.CreateCodeServ ice,com.oa.controller.service.LoginIbatisService,com.oa.cont roller.service.ModuleMangerService,com.oa.controller.service.UserServi ce,com.profplan.controller.service.CreateNewProfPlanService,com.whirlp ool.profplan.controller.service.GroupProfService,com.profplan.controll er.service.AccountCodeService,com.profplan.controller.service.CostCent erService,com.profplan.controller.service.ProfUserService,com.whirlpoo l.profplan.controller.service.AssignCostCenterService,com.profplan.con troller.service.FillInRecordService,com.profplan.controller.service.Fi llProfPlanService,com.profplan.controller.service.SearchProfPlanServic e,com.profplan.controller.service.MangeCostCenterService,sessionFactor y,transactionManager,txAdvice,org.springframework.aop.config.internalAutoProxyCr eator,allManagerMethod,org.springframework.aop.support.DefaultBeanFactoryPointcu tAdvisor#0,propertyConfig,dataSource,sqlMapClient,sqlMapClientTemplate,transacti onManagerIbatis,baseTransactionProxy]; root of factory hierarchy 2009-08-18 09:24:46,015 INFO [org.springframework.orm.hibernate3.LocalSessionFac toryBean] - Closing Hibernate SessionFactory 2009-08-18 09:24:46,031 INFO [org.hibernate.impl.SessionFactoryImpl] - closing 2009-08-18 09:24:46,031 INFO [org.hibernate.connection.DriverManagerConnectionPr ovider] - cleaning up connection pool: jdbc:microsoft:sqlserver://159.155.212.8: 1433 2009-8-18 9:24:46 org.apache.catalina.core.StandardHostDeployer install 信息: Installing web application at context path from URL file:C:\Program Files \Apache Software Foundation\Tomcat 5.0\webapps\ROOT 2009-8-18 9:24:46 org.apache.catalina.core.StandardHostDeployer install 信息: Installing web application at context path /servlets-examples from URL fil e:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\servlets-exampl es[/code] web.xml这样配置的: [code="java"] <?xml version="1.0" encoding="UTF-8"?> <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"> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:context/**/*.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class> org.springframework.web.util.IntrospectorCleanupListener </listener-class> </listener> <listener> <listener-class> core.view.listener.InitBeanFactoryListener <!-- com.conair.core.view.listener.InitBeanFactoryListener --> </listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <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>encodingFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> </web-app> [/code] 这样在我myeclipse工程里运行正常,但是放到服务器上上时发生此问题。 顺便说下:我开发时候用的tomcat为5.5的。服务器上的为:5.0的,不知道这个有影响不? 刚测试。极有可能是tomcat版本的问题。但如何处理却不知道。
各位,最近做了ssh整合,在项目启动时候报错,我已经引入了所有需要的jar包,
项目结构: ![图片说明](https://img-ask.csdn.net/upload/201610/10/1476113463_114402.png) 启动报错: ``` 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:518) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:499) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4733) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5251) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 十月 10, 2016 11:23:15 下午 org.apache.catalina.core.StandardContext listenerStart ``` 项目中web.xml配置如下: ``` <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- spring核心配置 --> <context-param> <!-- 参数名为ContextConfigLocation --> <param-name>contextConfigLocation</param-name> <param-value>classpath:bean.xml</param-value> </context-param> <!-- 监听器配置 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> ``` 这个错误,我百度了很多,也看了一些其他的问答帖子,还是没能解决我的问题。 stackoverflow上面的帖子也有看,主要意思就是我得把spring所有相关jar包,放到tomcat---》webapps-----》项目------》.......-----》lib。。我也照做了,又报了 ``` ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the cont..... ``` 。 这是stackoverflow上的java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener的错误解决办法。可是并没有对我的项目生效。 ``` http://stackoverflow.com/questions/6210757/java-lang-classnotfoundexception-org-springframework-web-context-contextloaderl ```
纠结的了一上午ssh的问题
2010-6-6 11:05:07 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.19. 2010-6-6 11:05:07 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], rand om [true]. 2010-6-6 11:05:08 org.apache.coyote.http11.Http11AprProtocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 2010-6-6 11:05:08 org.apache.coyote.ajp.AjpAprProtocol init 信息: Initializing Coyote AJP/1.3 on ajp-8009 2010-6-6 11:05:08 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1494 ms 2010-6-6 11:05:08 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2010-6-6 11:05:08 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.24 2010-6-6 11:05:08 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor host-manager.xml 2010-6-6 11:05:09 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor manager.xml 2010-6-6 11:05:09 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory docs 2010-6-6 11:05:09 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory examples 2010-6-6 11:05:09 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 2010-6-6 11:05:09 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 2010-6-6 11:05:09 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory ROOT 2010-6-6 11:05:09 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory test_online 2010-6-6 11:05:11 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2010-06-06 11:05:11 Root WebApplicationContext: initialization started 2010-06-06 11:05:12 Refreshing org.springframework.web.context.support.XmlWebApp licationContext@8cd4db: display name [Root WebApplicationContext]; startup date [Sun Jun 06 11:05:12 CST 2010]; root of context hierarchy 2010-06-06 11:05:12 Looking for matching resources in directory tree [C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\test_online\WEB-INF\classes ] 2010-06-06 11:05:12 Searching directory [C:\Program Files\Apache Software Founda tion\Tomcat 6.0\webapps\test_online\WEB-INF\classes] for files matching pattern [C:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/test_online/WEB- INF/classes/bean-*.xml] 2010-06-06 11:05:12 Resolved location pattern [classpath:bean-*.xml] to resource s [file [C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\test_onl ine\WEB-INF\classes\bean-action.xml], file [C:\Program Files\Apache Software Fou ndation\Tomcat 6.0\webapps\test_online\WEB-INF\classes\bean-hibernate.xml], file [C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\test_online\WEB -INF\classes\bean-service.xml]] 2010-06-06 11:05:12 Loading XML bean definitions from file [C:\Program Files\Apa che Software Foundation\Tomcat 6.0\webapps\test_online\WEB-INF\classes\bean-acti on.xml] 2010-06-06 11:05:13 Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderF actoryImpl] 2010-06-06 11:05:14 Loading schema mappings from [META-INF/spring.schemas] 2010-06-06 11:05:14 Loaded schema mappings: {http://www.springframework.org/sche ma/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd , http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframe work/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema /context/spring-context-2.5.xsd=org/springframework/context/config/spring-contex t-2.5.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/ springframework/context/config/spring-context-2.5.xsd, http://www.springframewor k.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.5.xs d, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springfram ework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/sche ma/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2. 5.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springfram ework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schem a/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0 .xsd, http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframe work/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema /beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2 .0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/sprin gframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org /schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring- beans-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/ springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframewo rk.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.5.x sd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframewo rk/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/ tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http: //www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/ config/spring-jee-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop- 2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springfram ework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-ao p-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/spri ngframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema /lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.x sd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframewo rk/beans/factory/xml/spring-util-2.5.xsd} 2010-06-06 11:05:14 Found XML schema [http://www.springframework.org/schema/bean s/spring-beans-2.0.xsd] in classpath: org/springframework/beans/factory/xml/spri ng-beans-2.0.xsd 2010-06-06 11:05:14 Loading bean definitions 2010-06-06 11:05:14 No XML 'id' specified - using 'LoginAction' as bean name and [] as aliases 2010-06-06 11:05:14 No XML 'id' specified - using 'CheckAction' as bean name and [] as aliases 2010-06-06 11:05:14 Loading XML bean definitions from file [C:\Program Files\Apa che Software Foundation\Tomcat 6.0\webapps\test_online\WEB-INF\classes\bean-hibe rnate.xml] 2010-06-06 11:05:14 Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderF actoryImpl] 2010-06-06 11:05:14 Found XML schema [http://www.springframework.org/schema/bean s/spring-beans-2.5.xsd] in classpath: org/springframework/beans/factory/xml/spri ng-beans-2.5.xsd 2010-06-06 11:05:14 Loading bean definitions 2010-06-06 11:05:14 Loading XML bean definitions from file [C:\Program Files\Apa che Software Foundation\Tomcat 6.0\webapps\test_online\WEB-INF\classes\bean-serv ice.xml] 2010-06-06 11:05:14 Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderF actoryImpl] 2010-06-06 11:05:14 Found XML schema [http://www.springframework.org/schema/bean s/spring-beans-2.0.xsd] in classpath: org/springframework/beans/factory/xml/spri ng-beans-2.0.xsd 2010-06-06 11:05:14 Loading bean definitions 2010-06-06 11:05:14 No XML 'id' specified - using 'UserCheckService' as bean nam e and [] as aliases 2010-06-06 11:05:14 No XML 'id' specified - using 'build' as bean name and [] as aliases 2010-06-06 11:05:14 Loaded 9 bean definitions from location pattern [classpath:b ean-*.xml] 2010-06-06 11:05:14 Bean factory for application context [org.springframework.we b.context.support.XmlWebApplicationContext@8cd4db]: org.springframework.beans.fa ctory.support.DefaultListableBeanFactory@3087f9 2010-06-06 11:05:14 9 beans defined in org.springframework.web.context.support.X mlWebApplicationContext@8cd4db: display name [Root WebApplicationContext]; start up date [Sun Jun 06 11:05:12 CST 2010]; root of context hierarchy 2010-06-06 11:05:15 Unable to locate MessageSource with name 'messageSource': us ing default [org.springframework.context.support.DelegatingMessageSource@137e2dc ] 2010-06-06 11:05:15 Unable to locate ApplicationEventMulticaster with name 'appl icationEventMulticaster': using default [org.springframework.context.event.Simpl eApplicationEventMulticaster@16e1111] 2010-06-06 11:05:15 Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBundleThemeSource@5b5df0 ] 2010-06-06 11:05:15 Pre-instantiating singletons in org.springframework.beans.fa ctory.support.DefaultListableBeanFactory@3087f9: defining beans [LoginAction,Che ckAction,dataSource,sessionFactory,TestDAO,StudentsDAO,QuesttionDAO,UserCheckSer vice,build]; root of factory hierarchy 2010-06-06 11:05:15 Creating shared instance of singleton bean 'dataSource' 2010-06-06 11:05:15 Creating instance of bean 'dataSource' 2010-06-06 11:05:15 Eagerly caching bean 'dataSource' to allow for resolving pot ential circular references 2010-06-06 11:05:15 Finished creating instance of bean 'dataSource' 2010-06-06 11:05:15 Creating shared instance of singleton bean 'sessionFactory' 2010-06-06 11:05:15 Creating instance of bean 'sessionFactory' 2010-06-06 11:05:15 Eagerly caching bean 'sessionFactory' to allow for resolving potential circular references 2010-06-06 11:05:15 Returning cached instance of singleton bean 'dataSource' 2010-06-06 11:05:15 Invoking afterPropertiesSet() on bean with name 'sessionFact ory' 2010-06-06 11:05:15 Hibernate 3.2.7 2010-06-06 11:05:15 hibernate.properties not found 2010-06-06 11:05:15 Bytecode provider name : cglib 2010-06-06 11:05:15 using JDK 1.4 java.sql.Timestamp handling 2010-06-06 11:05:16 trying to resolve system-id [http://hibernate.sourceforge.ne t/hibernate-mapping-3.0.dtd] 2010-06-06 11:05:16 recognized hibernate namespace; attempting to resolve on cla sspath under org/hibernate/ 2010-06-06 11:05:16 located [http://hibernate.sourceforge.net/hibernate-mapping- 3.0.dtd] in classpath 2010-06-06 11:05:17 Mapping class: pro.ncbuct.bean.Questtion -> questtion 2010-06-06 11:05:17 Mapped property: id -> id 2010-06-06 11:05:17 Mapped property: title -> title 2010-06-06 11:05:17 Mapped property: score -> score 2010-06-06 11:05:17 Mapped property: answer -> answer 2010-06-06 11:05:17 Mapped property: option1 -> option1 2010-06-06 11:05:17 Mapped property: option2 -> option2 2010-06-06 11:05:17 Mapped property: option3 -> option3 2010-06-06 11:05:17 Mapped property: option4 -> option4 2010-06-06 11:05:17 trying to resolve system-id [http://hibernate.sourceforge.ne t/hibernate-mapping-3.0.dtd] 2010-06-06 11:05:17 recognized hibernate namespace; attempting to resolve on cla sspath under org/hibernate/ 2010-06-06 11:05:17 located [http://hibernate.sourceforge.net/hibernate-mapping- 3.0.dtd] in classpath 2010-06-06 11:05:17 Mapping class: pro.ncbuct.bean.Students -> students 2010-06-06 11:05:17 Mapped property: id -> id 2010-06-06 11:05:17 Mapped property: name -> name 2010-06-06 11:05:17 Mapped property: loginNum -> login_num 2010-06-06 11:05:17 Mapped property: num -> num 2010-06-06 11:05:17 trying to resolve system-id [http://hibernate.sourceforge.ne t/hibernate-mapping-3.0.dtd] 2010-06-06 11:05:17 recognized hibernate namespace; attempting to resolve on cla sspath under org/hibernate/ 2010-06-06 11:05:17 located [http://hibernate.sourceforge.net/hibernate-mapping- 3.0.dtd] in classpath 2010-06-06 11:05:17 Mapping class: pro.ncbuct.bean.Test -> test 2010-06-06 11:05:17 Mapped property: id -> id 2010-06-06 11:05:17 Mapped property: userId -> user_id 2010-06-06 11:05:17 Mapped property: questId -> quest_id 2010-06-06 11:05:17 Mapped property: SAns -> s_ans 2010-06-06 11:05:17 Mapped property: testScore -> test_score 2010-06-06 11:05:17 processing extends queue 2010-06-06 11:05:17 processing collection mappings 2010-06-06 11:05:17 processing native query and ResultSetMapping mappings 2010-06-06 11:05:17 processing association property references 2010-06-06 11:05:17 processing foreign key constraints 2010-06-06 11:05:17 Building new Hibernate SessionFactory 2010-06-06 11:05:17 Preparing to build session factory with filters : {} 2010-06-06 11:05:17 processing extends queue 2010-06-06 11:05:17 processing collection mappings 2010-06-06 11:05:17 processing native query and ResultSetMapping mappings 2010-06-06 11:05:17 processing association property references 2010-06-06 11:05:17 processing foreign key constraints 2010-06-06 11:05:17 Initializing connection provider: org.springframework.orm.hi bernate3.LocalDataSourceConnectionProvider 2010-06-06 11:05:18 RDBMS: MySQL, version: 5.1.45-community 2010-06-06 11:05:18 JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector- java-5.0.8 ( Revision: ${svn.Revision} ) 2010-06-06 11:05:18 Using dialect: org.hibernate.dialect.MySQLDialect 2010-06-06 11:05:18 Transaction strategy: org.springframework.orm.hibernate3.Spr ingTransactionFactory 2010-06-06 11:05:18 No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2010-06-06 11:05:18 Automatic flush during beforeCompletion(): disabled 2010-06-06 11:05:18 Automatic session close at end of transaction: disabled 2010-06-06 11:05:18 JDBC batch size: 15 2010-06-06 11:05:18 JDBC batch updates for versioned data: disabled 2010-06-06 11:05:18 Scrollable result sets: enabled 2010-06-06 11:05:18 Wrap result sets: disabled 2010-06-06 11:05:18 JDBC3 getGeneratedKeys(): enabled 2010-06-06 11:05:18 Connection release mode: auto 2010-06-06 11:05:18 Maximum outer join fetch depth: 2 2010-06-06 11:05:18 Default batch fetch size: 1 2010-06-06 11:05:18 Generate SQL with comments: disabled 2010-06-06 11:05:18 Order SQL updates by primary key: disabled 2010-06-06 11:05:18 Order SQL inserts for batching: disabled 2010-06-06 11:05:18 Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFa ctory 2010-06-06 11:05:18 Using ASTQueryTranslatorFactory 2010-06-06 11:05:18 Query language substitutions: {} 2010-06-06 11:05:18 JPA-QL strict compliance: disabled 2010-06-06 11:05:18 Second-level cache: enabled 2010-06-06 11:05:18 Query cache: disabled 2010-06-06 11:05:18 Cache provider: org.hibernate.cache.NoCacheProvider 2010-06-06 11:05:18 Optimize cache for minimal puts: disabled 2010-06-06 11:05:18 Structured second-level cache entries: disabled 2010-06-06 11:05:18 Statistics: disabled 2010-06-06 11:05:18 Deleted entity synthetic identifier rollback: disabled 2010-06-06 11:05:18 Default entity-mode: pojo 2010-06-06 11:05:18 Named query checking : enabled 2010-06-06 11:05:18 building session factory 2010-06-06 11:05:18 Session factory constructed with filter configurations : {} 2010-06-06 11:05:18 instantiating session factory with properties: {java.runtime .name=Java(TM) SE Runtime Environment, sun.boot.library.path=C:\Program Files\Ja va\jdk1.6.0_18\jre\bin, java.vm.version=16.0-b13, shared.loader=, java.vm.vendor =Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, tomcat.util.buf.StringCache.byte.enable d=true, file.encoding.pkg=sun.io, user.country=CN, sun.java.launcher=SUN_STANDAR D, sun.os.patch.level=, java.vm.specification.name=Java Virtual Machine Specific ation, user.dir=C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin, java .runtime.version=1.6.0_18-b07, java.awt.graphicsenv=sun.awt.Win32GraphicsEnviron ment, hibernate.current_session_context_class=org.springframework.orm.hibernate3 .SpringSessionContext, java.endorsed.dirs=C:\Program Files\Apache Software Found ation\Tomcat 6.0/common/endorsed, os.arch=x86, java.io.tmpdir=C:\Program Files\A pache Software Foundation\Tomcat 6.0\temp, line.separator= , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, java.naming .factory.url.pkgs=org.apache.naming, os.name=Windows 7, sun.jnu.encoding=GBK, ja va.library.path=C:\Program Files\Java\jdk1.6.0_18\bin;C:\Program Files\Apache So ftware Foundation\Tomcat 6.0\bin, java.specification.name=Java Platform API Spec ification, java.class.version=50.0, sun.management.compiler=HotSpot Client Compi ler, hibernate.transaction.factory_class=org.springframework.orm.hibernate3.Spri ngTransactionFactory, os.version=6.1, sun.io.useCanonCaches=false, user.home=C:\ Documents and Settings\Administrator, catalina.useNaming=true, user.timezone=Asi a/Shanghai, java.awt.printerjob=sun.awt.windows.WPrinterJob, java.specification. version=1.6, file.encoding=GBK, catalina.home=C:\Program Files\Apache Software F oundation\Tomcat 6.0, user.name=Administrator, java.class.path=C:\Program Files\ Apache Software Foundation\Tomcat 6.0/bin/bootstrap.jar;C:\Program Files\Java\jd k1.6.0_18/lib/tools.jar, hibernate.bytecode.use_reflection_optimizer=false, java .naming.factory.initial=org.apache.naming.java.javaURLContextFactory, package.de finition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,o rg.apache.jasper., java.vm.specification.version=1.0, sun.arch.data.model=32, ja va.home=C:\Program Files\Java\jdk1.6.0_18\jre, hibernate.dialect=org.hibernate.d ialect.MySQLDialect, java.specification.vendor=Sun Microsystems Inc., user.langu age=zh, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, java.vers ion=1.6.0_18, java.ext.dirs=C:\Program Files\Java\jdk1.6.0_18\jre\lib\ext;C:\Win dows\Sun\Java\lib\ext, sun.boot.class.path=C:\Program Files\Java\jdk1.6.0_18\jre \lib\resources.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\rt.jar;C:\Program F iles\Java\jdk1.6.0_18\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_18\j re\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_18\jre\lib\jce.jar;C:\Program Fil es\Java\jdk1.6.0_18\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_18\jre\c lasses, java.vendor=Sun Microsystems Inc., server.loader=, catalina.base=C:\Prog ram Files\Apache Software Foundation\Tomcat 6.0, file.separator=\, java.vendor.u rl.bug=http://java.sun.com/cgi-bin/bugreport.cgi, hibernate.connection.provider_ class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, comm on.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,$ {catalina.home}/lib/*.jar, sun.cpu.endian=little, sun.io.unicode.encoding=Unicod eLittle, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache. tomcat.,org.apache.jasper.,sun.beans., sun.desktop=windows, sun.cpu.isalist=pent ium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86} 2010-06-06 11:05:19 Destroying singletons in org.springframework.beans.factory.s upport.DefaultListableBeanFactory@3087f9: defining beans [LoginAction,CheckActio n,dataSource,sessionFactory,TestDAO,StudentsDAO,QuesttionDAO,UserCheckService,bu ild]; root of factory hierarchy 2010-06-06 11:05:19 Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name 'sessionFactory' defined in file [C:\Program Files\Apache Software Founda tion\Tomcat 6.0\webapps\test_online\WEB-INF\classes\bean-hibernate.xml]: Invocat ion of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTu plizer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory $1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Ab stractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi ngleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abst ractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst antiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFac toryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(Abstr actApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(Co ntextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(Cont extLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(Con textLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java: 3972) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7 91) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964 ) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.hibernate.HibernateException: Unable to instantiate default tupli zer [org.hibernate.tuple.entity.PojoEntityTuplizer] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTup lizerFactory.java:110) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(En tityTuplizerFactory.java:135) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEn tityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:323) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntity Persister.java:433) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTable EntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFacto ry.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:231) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1313) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory (LocalSessionFactoryBean.java:814) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFacto ry(LocalSessionFactoryBean.java:732) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertie sSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 39 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces sorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc torAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTup lizerFactory.java:107) ... 52 more Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:165) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy .java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java: 216) at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLaz yInitializer.java:117) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyF actory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTu plizer.java:188) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTupli zer.java:128) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java :78) ... 57 more Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.CodeVisitor at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1484) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1329) ... 70 more 2010-6-6 11:05:19 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class or g.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name 'sessionFactory' defined in file [C:\Program Files\Apache Software Founda tion\Tomcat 6.0\webapps\test_online\WEB-INF\classes\bean-hibernate.xml]: Invocat ion of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTu plizer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory $1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Ab stractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi ngleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(Abst ractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst antiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFac toryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(Abstr actApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(Co ntextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(Cont extLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(Con textLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java: 3972) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7 91) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964 ) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.hibernate.HibernateException: Unable to instantiate default tupli zer [org.hibernate.tuple.entity.PojoEntityTuplizer] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTup lizerFactory.java:110) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(En tityTuplizerFactory.java:135) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEn tityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:323) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntity Persister.java:433) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTable EntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFacto ry.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:231) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1313) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory (LocalSessionFactoryBean.java:814) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFacto ry(LocalSessionFactoryBean.java:732) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertie sSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 39 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces sorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc torAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTup lizerFactory.java:107) ... 52 more Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:165) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy .java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java: 216) at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLaz yInitializer.java:117) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyF actory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTu plizer.java:188) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTupli zer.java:128) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java :78) ... 57 more Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.CodeVisitor at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1484) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1329) ... 70 more 2010-6-6 11:05:19 org.apache.catalina.core.StandardContext start 严重: Error listenerStart 2010-6-6 11:05:19 org.apache.catalina.core.StandardContext start 严重: Context [/test_online] startup failed due to previous errors 2010-6-6 11:05:19 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 2010-6-6 11:05:19 org.apache.catalina.loader.WebappClassLoader clearReferencesJd bc 严重: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but fai led to unregister it when the web application was stopped. To prevent a memory l eak, the JDBC Driver has been forcibly unregistered. 2010-6-6 11:05:19 org.apache.catalina.loader.WebappClassLoader clearReferencesTh reads 严重: A web application appears to have started a thread named [Timer-0] but has f ailed to stop it. This is very likely to create a memory leak. 2010-6-6 11:05:19 org.apache.catalina.loader.WebappClassLoader clearReferencesTh reads 严重: A web application appears to have started a thread named [MySQL Statement Ca ncellation Timer] but has failed to stop it. This is very likely to create a mem ory leak. 2010-6-6 11:05:19 org.apache.catalina.loader.WebappClassLoader clearThreadLocalM ap 严重: A web application created a ThreadLocal with key of type [null] (value [com. sun.faces.config.ConfigureListener$1@18c4d8e]) and a value of type [null] (value [null]) but failed to remove it when the web application was stopped. To preven t a memory leak, the ThreadLocal has been forcibly removed. 2010-6-6 11:05:19 org.apache.catalina.loader.WebappClassLoader clearThreadLocalM ap 严重: A web application created a ThreadLocal with key of type [org.springframewor k.core.NamedThreadLocal] (value [Prototype beans currently in creation]) and a v alue of type [null] (value [null]) but failed to remove it when the web applicat ion was stopped. To prevent a memory leak, the ThreadLocal has been forcibly rem oved.
struts2 action找不到404
刚学习struts2,做到登录功能的时候登录按钮点击之后就显示action404的页面 我的工程结构是这样的 ![图片说明](https://img-ask.csdn.net/upload/201506/19/1434701793_764381.png) 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"> <display-name>ieZhan</display-name> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> ``` struts.xml ``` <package name="struts2" extends="struts-default" namespace="/"> <action name="login" class="com.login.struts2.loginAction"> <result name="success" type="redirect">/aboutus.jsp</result> <result name="failer" type="redirect">/contactus.jsp</result> </action> </package> ``` jsp页面中的form代码 ``` <s:form action="login" > <ul class="login_cont"> <li class="f14">会员登录</li> <li class="login_ipt"><p><span class="fl tr">账号:</span><input type="text" class="login_txt fl" name="username"/></p></li> <li class="login_ipt"><p><span class="fl tr">密码:</span><input type="password" class="login_txt fl" name="password"/></p></li> <li><a href="#" class="fr">忘记登录密码?</a><label><input type="checkbox" class="remember_psw" />记住密码</label></li> <li class="mt10"><button class="login_button login_button_signup" type="submit" >登录</button></li> </ul> </s:form> ``` 在启动tomcat的时候有出现警告 六月 19, 2015 3:59:32 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 警告: No configuration found for the specified action: 'loginAction' in namespace: '/pages'. Form action defaulting to 'action' attribute's literal value. 六月 19, 2015 3:59:33 下午 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 警告: No configuration found for the specified action: 'loginAction' in namespace: '/pages'. Form action defaulting to 'action' attribute's literal value. 我看了下在页面上的action的url是 ![图片说明](https://img-ask.csdn.net/upload/201506/19/1434702118_286666.png) 我试过加namespace=“/” 路径变成/ieZhan/login 也不行 希望有好心人帮忙解决下。
javax.naming.NameNotFoundException 求高手
获取数据库的连接代码 public Connection getConnectionDs(){ try { //初始化上下文 Context ctx = new InitialContext(); DataSource das = (DataSource)(ctx.lookup("java:comp/env/news")); cont = das.getConnection(); } catch (NamingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return cont; } 配置文件 tomcat conf目录下的context <Resource name = "news" auth = "Container" type = "javax.sql.DataSource" maxActive = "100" maxIdle = "30" maxWait = "10000" username = "root" password = "bdqn" driverClassName = "com.mysql.jdbc.Driver" url = "jdbc:mysql://127.0.0.1:3306/news"/>
为什么ucos当中的延时和阻塞都不执行?
在中断服务函数返回之后,执行当下优先级最高的任务,在任务当中进行延时30s,按此说会阻塞自己转而去执行下一个任务。但是我的延时函数并没有执行,反而直接跳过去执行了下一行代码,这期间我检查了像调度锁、中断嵌套和err 都是0,并没有什么异常但是就是没有执行而且没调度。 ``` void AppTaskSelf_Checking(void *p_arg) { OS_ERR err_Self_Checking; CPU_INT32U cpu_clk_freq; CPU_TS ts_Start,ts_Stop,ts_ZongChang; int cont; CPU_SR_ALLOC(); (void)p_arg; cpu_clk_freq = BSP_CPU_ClkFreq(); printf("\r\n电机自检任务开始·····"); Plus_flag = 1; Motro_BackOFF(Turn_OFF); /*给默认转动的方向确定一个参考系 */ Motor_Forward(Turn_ON); while(1) { if(HuiJiang == 1) /*当电机触发上限位or下限位的时候HuiJiang标志为置1 代表可进行回桨限位*/ { OS_CRITICAL_ENTER(); printf("\r\n进入回桨准备时刻···"); HuiJiang = 0; /*回桨标志位清0,表示此任务只执行一次*/ HuiJiangComplete = 1; /*回桨完成标志为置1,当另一个限位触发的时候在中断服务函数当中可判定执行命令*/ RedState = Reverse_limit; /*此过程为电机在回桨之前红灯快闪20s*/ OS_CRITICAL_EXIT(); // OSTaskSuspend((OS_TCB*)&APPTaskMotorForwardTCB,&err_Self_Checking); OSTimeDly(30000,OS_OPT_TIME_DLY,&err_Self_Checking); /*延时挂起自己20s,此时只有红灯一个任务可执行*/ LED_RED = 1; printf("\r\n回桨已经准备好,得到当下时刻的时间戳···"); ts_Start = OS_TS_GET(); Motro_BackOFF(Turn_ON); /*快闪结束后,得到开启回桨那一时刻的时间戳,等待另一半桨叶限位成功*/ } ```
tomcat连接池得到的连接在jsp中测试成功,在java main方法中测试conn为null
直接上代码 ``` //测试类 public class Draft { public static void main(String args[]){ Connection conn=Fconn.getPoolConn(); System.out.println(conn.toString()); } } ``` ``` //jsp测试页 <% Connection conn=Fconn.getPoolConn(); out.println(conn.toString()); %> ``` ![图片说明](https://img-ask.csdn.net/upload/201712/04/1512394487_116297.png) ``` //从池中获取连接功能类,测试程序中我用下面的工厂获得连接 public class GetConnectionFromPool { private Connection conn=null; public Connection getMySQLConnection(){ try{ String datasourcename="java:comp/env/jdbc/HanLinMysql"; Context cont=new InitialContext(); DataSource datasource=(DataSource)cont.lookup(datasourcename); this.conn=datasource.getConnection(); }catch(Exception e){ //this.conn=null; } return this.conn; } public Connection getSQLServerConnection(){ try{ String datasourcename="java:comp/env/jdbc/HanLinSQLServer/hanlinsale"; Context cont=new InitialContext(); DataSource datasource=(DataSource)cont.lookup(datasourcename); this.conn=datasource.getConnection(); }catch(Exception e){ //this.conn=null; } return this.conn; } } ``` ``` //连接工厂 public class Fconn { public static Connection getPoolConn(){ Connection conn=null; GetConnectionFromPool pool=new GetConnectionFromPool(); conn=pool.getSQLServerConnection(); return conn; } } ```
javascript里面两个if,为什么只有当第一个if括号里面为true时,下面的语句才可以执行?
``` function check() { if(Trim(document.reply.title.value) == "") { alert("please intput the title!"); document.reply.title.focus(); //return false; } alert("please intput the content!"); if(Trim(document.reply.cont.value) == "") { alert("please intput the content!"); document.reply.cont.focus(); return false; } return true; } javascript里面两个if,为什么只有当第一个if括号里面为true时,下面的语句才可以执行? ```
一条HQL语句引起的异常
表结构: CREATE TABLE IF NOT EXISTS tb_cases( id int(11) NOT NULL auto_increment, cdate date default NULL, title varchar(50) default NULL, cont text, imgpath varchar(80) default NULL, apply text, PRIMARY KEY (id) )ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; Hibernate映射文件: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.base.hibernate.po.Cases" table="tb_cases"> <id name="id" type="java.lang.Integer"> <column name="id" /> <generator class="native" /> </id> <property name="cdate" type="java.util.Date"> <column name="cdate" length="10" /> </property> <property name="title" type="java.lang.String"> <column name="title" length="50" /> </property> <property name="content" type="java.lang.String"> <column name="cont" /> </property> <property name="imgpath" type="java.lang.String"> <column name="imgpath" length="50" /> </property> <property name="apply" type="java.lang.String"> <column name="apply" /> </property> </class> </hibernate-mapping> HQL语句: String FIND_CASENUM = " from Cases order by cdate desc "; 实现方法: public List<Cases> getCasesNum(final int showPage, final int pageSize){ return getHibernateTemplate().executeFind(new HibernateCallback() { public Object doInHibernate(final Session session) { Query query = session.createQuery(FIND_CASENUM); query.setFirstResult((showPage - 1) * pageSize); query.setMaxResults(pageSize); List<Cases> casesList = query.list(); if(null == casesList || casesList.isEmpty()){ casesList = null; } return casesList; } }); } 抛出异常: Hibernate: select top 4 cases0_.id as id1_, cases0_.cdate as cdate1_, cases0_.title as title1_, cases0_.cont as cont1_, cases0_.imgpath as imgpath1_, cases0_.apply as apply1_ from tb_cases cases0_ order by cases0_.cdate desc 2009-07-08 13:06:22,281 [org.hibernate.util.JDBCExceptionReporter]-[WARN] SQL Error: 1064, SQLState: 42000 2009-07-08 13:06:22,281 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4 cases0_.id as id1_, cases0_.cdate as cdate1_, cases0_.title as title1_, cases0' at line 1 2009-07-08 13:06:26,812 [org.apache.struts.action.RequestProcessor]-[WARN] Unhandled Exception thrown: class org.springframework.dao.InvalidDataAccessResourceUsageException 2009-07-08 13:06:26,812 [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bianyaqi].[action]]-[ERROR] Servlet.service() for servlet action threw exception org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2223) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at com.base.hibernate.dao.impl.CasesDaoImpl$1.doInHibernate(CasesDaoImpl.java:65) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372) at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:342) at com.base.hibernate.dao.impl.CasesDaoImpl.getCasesNum(CasesDaoImpl.java:60) at com.base.spring.service.impl.CasesServiceImpl.getCasesNum(CasesServiceImpl.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy1.getCasesNum(Unknown Source) at com.base.struts.action.IndexAction.execute(IndexAction.java:130) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.base.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.base.common.filter.ForceNoCacheFilter.doFilter(ForceNoCacheFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4 cases0_.id as id1_, cases0_.cdate as cdate1_, cases0_.title as title1_, cases0' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1787) at org.hibernate.loader.Loader.doQuery(Loader.java:674) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) ... 54 more 怀疑是HQL语句有什么错误,但愣是没找出来 映射文件与表中的字段名也检查过了,没什么问题啊! 查看了好久也没找出到底什么地方的错误 还请各们朋友们帮下忙看下到底怎么回事! 补充: 如果将HQL语句改成 from Product 问题依旧 但在Mysql数据库中使用 select id,cdate,title,cont,imgpath,apply from tb_cases; 语句没有任何错误!
sql 优化 orcal数据库
数据库是orcal sql如下,其中uh_bl_cg_ip表中有数据400万条,并且还在不断增加预计能达到1000万条以上 问题是执行下面sql时不加分组速度还可以,但是加上分组就极慢 select sum(cg.amount * cg.eu_direct) amount dept.pk_dept, dept.name, cont.itemid, cont.itemname, cont.pk_father, cg.name_psn_phy, fa.itemname faitemname from uh_bl_cg_ip cg inner join uh_pv pv on cg.pk_pv = pv.pk_pv and pv.flag_canc = 'N' inner join org_dept dept on cg.pk_dept_ord = dept.pk_dept inner join bd_uh_srvudcate_cont_item contitem on cg.pk_srvcate = contitem.pk_srvcate inner join bd_uh_srvudcate_cont cont on contitem.pk_udcatecont = cont.pk_udcatecont and cont.pk_udcate = '1001UD1000000008G7FK' left outer join bd_uh_srvudcate_cont fa on cont.pk_father = fa.pk_udcatecont and cont.pk_udcate = '1001UD1000000008G7FK' where cg.date_cg between '2016-08-01 00:00:00' and '2016-08-23 00:00:00' and dept.pk_org = '0001UD10000000001Z3T' and cg.pk_dept_ord = '1001UD1000000000IY40' group by dept.pk_dept, dept.name, cont.itemid, cont.itemname, cont.pk_father, cg.name_psn_phy, fa.itemname 只要是uh_bl_cg_ip这张表就及会影响速度 索引已经建了
小程序多层渲染出现数据重复渲染问题,请问该怎么改?
![图片说明](https://img-ask.csdn.net/upload/201910/13/1570936628_317916.png) ``` <block class="goods" bindtap="goto" id="{{item.id}}" wx:for="{{list}}" wx:key="{{item._id}}"> <view wx:for="{{item}}" wx:for-item="child"> <view wx:for="{{child}}" wx:for-item="childs"> <image lazy-load="true" class="good-img" src="{{childs.image}}"></image> <view class="good-cont"> <text class="good-title">{{childs.title}}</text> <view class="good-price"> ¥{{childs.price}} <!-- <view>{{item._id}}</view> --> <view class="cart" data-item="{{childs}}" catchtap="addCart"> + </view> </view> </view> </view> </view> </block> ``` 数据是有的,但是显示不出来 ![图片说明](https://img-ask.csdn.net/upload/201910/13/1570936743_640236.png)
【在线等】Android 写入文件的小问题,文件创建成功了,但是没写入成功
public class FileUtils { public Context cont; public FileUtils(Context cont) { this.cont = cont; } // 写入文件中 public void save(String city) { FileOutputStream fos = null; BufferedWriter bw = null; try { fos = cont.openFileOutput("列表.txt", Context.MODE_APPEND); bw = new BufferedWriter(new OutputStreamWriter(fos)); bw.write(city); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (fos != null) fos.close(); if (bw != null) bw.close(); } catch (IOException e) { e.printStackTrace(); } } Toast.makeText(cont, "写入成功" + city, 0).show(); } }
jqGrid 从后台能获取xml数据,但是前台grid数据就是显示不出来!页面有三条记录
``` 后台打印出来的数据: <Response> <transResult> <resultCode>1</resultCode> <resultInfoDesc>交易处理成功</resultInfoDesc> </transResult> <object class="PageGrid"> <page>1</page> <total>1</total> <records>3</records> <data> <map> <PRODUCT__CHANNEL>Z250000034</PRODUCT__CHANNEL> <NAME>张三</NAME> <CONT__NO>QH41A8160122000086</CONT__NO> <START__ROWNUM__>1</START__ROWNUM__> <PAYMENT__NAME>在线支付</PAYMENT__NAME> <BIZE__CODE>101</BIZE__CODE> <ORDER__NO>925120160122016952</ORDER__NO> <HEART__STATUS>1</HEART__STATUS> <PLAN__CODE></PLAN__CODE> <RISK__CODE>41A8</RISK__CODE> <PAY__STATUS>3</PAY__STATUS> <ORG__FILE__PATH>http://127.0.0.1:8080/eservice/ebiz/client/insure.action?action=downloadPolicyFile&amp;paras=emh1bW9iYW5uYW1lPUpLNDFBOCZwYXJhcz0xJTNkUUg0MUE4MTYwMTIyMDAwMDg2Jmlzc2lnbj10cnVl</ORG__FILE__PATH> </map> <map> <PRODUCT__CHANNEL>Z250000034</PRODUCT__CHANNEL> <NAME>张三</NAME> <CONT__NO>QH41A8160122000084</CONT__NO> <START__ROWNUM__>2</START__ROWNUM__> <PAYMENT__NAME>在线支付</PAYMENT__NAME> <BIZE__CODE>101</BIZE__CODE> <ORDER__NO>925120160122016950</ORDER__NO> <HEART__STATUS>1</HEART__STATUS> <PLAN__CODE></PLAN__CODE> <RISK__CODE>41A8</RISK__CODE> <PAY__STATUS>3</PAY__STATUS> <ORG__FILE__PATH>http://127.0.0.1:8080/eservice/ebiz/client/insure.action?action=downloadPolicyFile&amp;paras=emh1bW9iYW5uYW1lPUpLNDFBOCZwYXJhcz0xJTNkUUg0MUE4MTYwMTIyMDAwMDg0Jmlzc2lnbj10cnVl</ORG__FILE__PATH> </map> <map> <PRODUCT__CHANNEL>Z250000034</PRODUCT__CHANNEL> <NAME>张三</NAME> <CONT__NO>QH41A8160122000085</CONT__NO> <START__ROWNUM__>3</START__ROWNUM__> <PAYMENT__NAME>在线支付</PAYMENT__NAME> <BIZE__CODE>101</BIZE__CODE> <ORDER__NO>925120160122016951</ORDER__NO> <HEART__STATUS>1</HEART__STATUS> <PLAN__CODE></PLAN__CODE> <RISK__CODE>41A8</RISK__CODE> <PAY__STATUS>3</PAY__STATUS> <ORG__FILE__PATH>http://127.0.0.1:8080/eservice/ebiz/client/insure.action?action=downloadPolicyFile&amp;paras=emh1bW9iYW5uYW1lPUpLNDFBOCZwYXJhcz0xJTNkUUg0MUE4MTYwMTIyMDAwMDg1Jmlzc2lnbj10cnVl</ORG__FILE__PATH> </map> </data> </object> </Response> 查询SQL: select ord.order_no,<!-- 订单时间 --> ord.cont_no, <!-- 保单号 --> ord.product_Channel,<!-- 渠道代码 --> insurance.risk_code, <!-- 产品编码 --> insurance.plan_code,<!-- 款别 --> appnt.name,<!-- 投保人 --> ord.payment_name, <!-- 支付方式 --> ord.bize_code,<!-- 业务类型 --> ord.pay_status, ord.HEART_STATUS, <!-- 导入核心状态 --> cont.ORG_FILE_PATH <!--电子保单下载地址--> from ebiz_order ord <!-- 订单表 --> left join ebiz_appnt appnt <!-- 投保人表 --> on ord.order_no =appnt.order_no left join ebiz_payment pay <!-- 订单支付表 --> on ord.unno = pay.order_no and pay.is_delete =0 left join EBIZ_ORDER_INSURANCE insurance <!-- (订单险种表) --> on ord.order_no = insurance.order_no and insurance.is_delete =0 left join EBIZ_ELEC_CONT cont on ord.cont_no = cont.cont_no where ord.is_delete =0 <isNotNull property="orderNo"> and ord.order_No = #orderNo# </isNotNull> <isNotNull property="contNo"> and ord.cont_No = #contNo# </isNotNull> <isNotNull property="channelName">and ord.channel_Name = #channelName# </isNotNull> <isNotNull property="productChannel">and ord.product_Channel = #productChannel# </isNotNull> <isNotNull property="riskCode">and insurance.risk_Code= #riskCode# </isNotNull> <isNotNull property="planCode">and insurance.plan_Code= #planCode# </isNotNull> <isNotNull property="name">and appnt.name= #name# </isNotNull> <isNotNull property="paymentName">and sale.payment_Name= #paymentName# </isNotNull> <isNotNull property="payStatus">and ord.pay_Status= #payStatus# </isNotNull> <isNotNull property="bizeCode">and ord.bize_Code= #bizeCode# </isNotNull> <isNotNull property="heartStatus">and ord.heart_Status= #heartStatus# </isNotNull> <isNotNull property="startDate"><![CDATA[and to_char(ord.modified_date,'yyyy-mm-dd') >= #startDate#]]></isNotNull> <isNotNull property="endDate" ><![CDATA[and to_char(ord.modified_date, 'yyyy-mm-dd') <= #endDate# ]]></isNotNull> order by ord.modified_date desc JS代码: $("#jqGridTableId").jqGrid({ url : Eservice.ctx +'/ebiz/inquire/contNoShow.action?action=getPolicyList&ajax=true', mtype : 'POST', postData : { heartStatus:$("#heartStatus").val(), contNo:$("#contNo").val(), riskCode:$("#riskCode").val(), planCode:$("#planCode").val(), channelName:$("#channelName").val(), productChannel:$("#productChannel").val(), name:$("#name").val(), paymentName:$("#paymentName").val(), bizeCode:$("#bizeCode").val() }, datatype : "xml", colNames : ['保单号','渠道代码', '险种代码','款别', '投保人','支付方式', '导入核心状态', '业务类型','操作','订单号','支付状态','电子保单下载地址'], colModel : [{ name : 'CONT__NO', index : 'CONT__NO', align : 'center', sortable : false, width: 70 },{ name : 'PRODUCT__CHANNEL', index : 'PRODUCT__CHANNEL', align : 'center', sortable : false, width: 70 },{ name : 'RISK__CODE', index : 'RISK__CODE', align : 'center', formatter : 'date', sortable : false, width: 55 },{ name : 'PLAN__CODE', index : 'PLAN__CODE', align : 'center', sortable : false, width: 120 },{ name : 'NAME', index : 'NAME', align : 'center', sortable : false, width: 55 },{ name : 'PAYMENT__NAME', index : 'PAYMENT__NAME', align : 'center', sortable : false, width: 50/*,*/ // formatter:function(val,rec){ // var cname; // if(val=='1'){ // cname="已支付"; // }else if(val=='2'){ // cname="未支付"; // }else if(val=='3'){ // cname="支付失败"; // } // return cname; // } },{ name : 'HEART__STATUS', index : 'HEART__STATUS', align : 'center', sortable : false, width: 50 /*,*/ /*formatter:function(val,rec){ var cname; if(val=='1'){ cname="已导入"; }else if(val=='2'){ cname="未导入"; }else if(val=='3'){ cname="导入失败"; } return cname; }*/ },{ name : 'BIZE__CODE', index : 'BIZE__CODE', align : 'center', sortable : false, width: 75/*, formatter:function(val,rec){ var cname; if(val=='101'){ cname="投保"; }else if(val=='102'){ cname="退保"; }else if(val=='103'){ cname="投保批改"; }else if(val=='104'){ cname="异步返回"; }else if(val=='105'){ cname="注销"; } return cname; }*/ },{ name : 'OPER', index : 'OPER', align : 'center', sortable : false, width: 75 },{ name : 'ORDER__NO', index : 'ORDER__NO', hidden: true },{ name : 'PAY__STATUS', index : 'PAY__STATUS', hidden: true },{ name : 'ORG__FILE__PATH', index : 'ORG__FILE__PATH', hidden: true }], shrinkToFit : true, rowNum : 10, rowList : [ 10, 30, 50 ], pager : '#jqGridPagerId', viewrecords : true, xmlReader : { repeatitems : false, root : "object", row : "map", page : 'page', total : 'total', records : 'records' }, caption : "保单信息", height:'auto', gridComplete: function(){ //获得所有行的ID数组 var ids = $("#jqGridTableId").jqGrid('getDataIDs'); alert(ids); var contNo=$('#contNo').val(); for(var i=0;i < ids.length;i++){ var arr = $("#jqGridTableId").jqGrid('getRowData',ids[i]); alert(arr.ORDER__NO); var linkReq = "<a href=# onclick=\'ContManage.winShowRequest('" + arr.ORDER__NO + "', '" + arr.CONT__NO + "')\'>" + arr.CONT__NO + "</a>"; $("#jqGridTableId").jqGrid('setRowData',ids[i],{CONT__NO:linkReq}); var linkHis = "<a href=# onclick=\'ContManage.winShowHis('" + arr.ORDER__NO + "', '" + arr.CONT__NO + "')\'>" + "日志" + "</a>"; $("#jqGridTableId").jqGrid('setRowData',ids[i],{OPER:linkHis}); var linkDetail = "<a href=# onclick=\'ContManage.winOpenOrder('" + arr.ORDER__NO + "', '" + arr.CONT__NO + "')\'>" + "详情" + "</a>"; $("#jqGridTableId").jqGrid('setRowData',ids[i],{OPER:linkDetail}); var linkDown = "<a href="+arr.ORG__FILE__PATH+"?"+ arr.CONT__NO + "\'>" + "电子保单下载" + "</a>"; $("#jqGridTableId").jqGrid('setRowData',ids[i],{OPER:linkDown}); } } }); ```
Tomcat服务器中url中文传值乱码,急,求解决。。。
<a href="changeCity?city=北京>">北京</a> <a href="changeCity?city=上海">上海</a> 在servlet中获取城市,设置了编码为UTF-8,然后跳转带页面, <% String city=(String)session.getAttribute("city"); %> <div class="wrap1200 hd_cont clearFix"> <div class="hd_cont_l fl clearFix"> <img alt="" src="images/icon/gxLogo.png" class="logo fl"/> <span class="fl city" ><%=city %><a href="xianxia/change.jsp">切换城市</a></span> </div> 不管选择哪个城市,最终显示在网页都是??,求各位大神给出个解决办法。。
项目由Tomcat转Weblogic部署,总是提示Unknown protocol: 'VM'
Unable to find a Validation Cont ext. java.lang.RuntimeException: javax.naming.ServiceUnavailableException: Unknown protocol: 'VM' [Root exception is java.net.Unknow nHostException: Unknown protocol: 'VM' 怀疑是jndi配置问题,尝试了两种jndi的配置方式,分别如下: <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>WLB</value> </property> </bean> 第二种: <jee:jndi-lookup id="dataSource" jndi-name="WLB" /> ![图片说明](https://img-ask.csdn.net/upload/201512/09/1449643640_735007.png)
求助大神一个sql 百分比的问题
select a.cont,CLng((select count(*) as cs from [order] b where b.order_cont like '*'+a.cont+'*'))/CLng((select count(*) from [order] b)) from [order_cont] a 这个输出不出来每一行除完之后的数 求大神帮忙看看这个
kindeditor获取视频文件上传后的路径 求解 急!!!!
js代码如下: ``` K('#vidb1').click(function() { editor.loadPlugin('media', function() { editor.plugin.media.edit({ }); }); }); ``` jsp代码如下: ``` <p><input type="text" id="vidt1" name="news.newsVideo" value="" /> <input type="button" id="vidb1" value="选择视频" />(本地上传)</p> ``` KindEditor上传的应该是一个embed标签 你可以页面先获取kindeditor里面的内容放在隐藏的div里 ``` <div class="cont" id="cont" runat="server" style="width: 550px; display: none;"> </div> ``` 然后js获取embed的src ``` var str = $(".cont embed").first().attr("src"); ``` 我是这么写的 不知道你说的是不是这个意思 ==================== 解释一下这个回答
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
win10系统安装教程(U盘PE+UEFI安装)
一、准备工作 u盘,电脑一台,win10原版镜像(msdn官网) 二、下载wepe工具箱  极力推荐微pe(微pe官方下载) 下载64位的win10 pe,使用工具箱制作启动U盘打开软件,   选择安装到U盘(按照操作无需更改) 三、重启进入pe系统   1、关机后,将U盘插入电脑 2、按下电源后,按住F12进入启动项选择(技嘉主板是F12)     选择需要启
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
Nginx 软件层面加强Nginx性能优化的面试问答和解决方案
Nginx 软件层面加强Nginx性能优化的面试问答和解决方案 去年我去爱卡汽车面试PHP,一轮和二轮面的都不错,在三轮面到Nginx的时候很多问题当时不知道怎么回答,确实没有深入学习过,花了一段时间的学习,终于能解答Nginx高性能优化的问题了,10月24号为了获得程序员勋章,发布了半个优化笔记,浏览到了1000+,受到这个鼓舞,我抽时间在仔细整理下关于Nginx性能优化的问题,我们从软件说起。...
【管理系统课程设计】美少女手把手教你后台管理
【文章后台管理系统】URL设计与建模分析+项目源码+运行界面 栏目管理、文章列表、用户管理、角色管理、权限管理模块(文章最后附有源码) 1. 这是一个什么系统? 1.1 学习后台管理系统的原因 随着时代的变迁,现如今各大云服务平台横空出世,市面上有许多如学生信息系统、图书阅读系统、停车场管理系统等的管理系统,而本人家里就有人在用烟草销售系统,直接在网上完成挑选、购买与提交收货点,方便又快捷。 试想,若没有烟草销售系统,本人家人想要购买烟草,还要独自前往药...
11月19日科技资讯|华为明日发布鸿蒙整体战略;京东宣告全面向技术转型;Kotlin 1.3.60 发布
「极客头条」—— 技术人员的新闻圈! CSDN 的读者朋友们早上好哇,「极客头条」来啦,快来看今天都有哪些值得我们技术人关注的重要新闻吧。扫描上方二维码进入 CSDN App 可以收听御姐萌妹 Style 的人工版音频哟。 一分钟速览新闻点! 6G 专家组成员:速率是 5G 的 10 至 100 倍,预计 2030 年商用 雷军:很多人多次劝我放弃WPS,能坚持下来并不是纯粹的商业决定 ...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n
化繁为简 - 腾讯计费高一致TDXA的实践之路
导语:腾讯计费是孵化于支撑腾讯内部业务千亿级营收的互联网计费平台,在如此庞大的业务体量下,腾讯计费要支撑业务的快速增长,同时还要保证每笔交易不错账。采用最终一致性或离线补...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
Java学习笔记(七十二)—— Cookie
概述 会话技术: 会话:一次会话中包含多次请求和响应 一次会话:浏览器第一次给服务器发送资源请求,会话建立,直到有一方断开为止 功能:在一次会话的范围内的多次请求间,共享数据 方式: 客户端会话技术:Cookie,把数据存储到客户端 服务器端会话技术:Session,把数据存储到服务器端 Cookie 概念:客户端会话技术,将数据存储到客户端 快速入门: 使用步骤: 创建C
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆  每天早上8:30推送 作者| Mr.K   编辑| Emma 来源| 技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯
程序员该看的几部电影
##1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
@程序员,如何花式构建线程?
作者 |曾建责编 | 郭芮出品 | CSDN(ID:CSDNnews)在项目和业务的开发中,我们难免要经常使用线程来进行业务处理,使用线程可以保证我们的业务在相互处理之间可以保证原子性...
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布了 2019年国民经济报告 ,报告中指出:年末中国大陆总人口(包括31个
强烈推荐10本程序员在家读的书
很遗憾,这个鼠年春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终
Linux自学篇——linux命令英文全称及解释
man: Manual 意思是手册,可以用这个命令查询其他命令的用法。 pwd:Print working directory 显示当前目录 su:Swith user 切换用户,切换到root用户 cd:Change directory 切换目录 ls:List files 列出目录下的文件 ps:Process Status 进程状态 mk
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
文章目录1. 前言2. 数据下载3. 数据处理4. 数据可视化 1. 前言 今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。 2月6日追记:本文发布后,腾讯的数据源多次变更u
智力题(程序员面试经典)
NO.1  有20瓶药丸,其中19瓶装有1克/粒的药丸,余下一瓶装有1.1克/粒的药丸。给你一台称重精准的天平,怎么找出比较重的那瓶药丸?天平只能用一次。 解法 有时候,严格的限制条件有可能反倒是解题的线索。在这个问题中,限制条件是天平只能用一次。 因为天平只能用一次,我们也得以知道一个有趣的事实:一次必须同时称很多药丸,其实更准确地说,是必须从19瓶拿出药丸进行称重。否则,如果跳过两瓶或更多瓶药
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
2020年的1月,我辞掉了我的第一份工作
其实,这篇文章,我应该早点写的,毕竟现在已经2月份了。不过一些其它原因,或者是我的惰性、还有一些迷茫的念头,让自己迟迟没有试着写一点东西,记录下,或者说是总结下自己前3年的工作上的经历、学习的过程。 我自己知道的,在写自己的博客方面,我的文笔很一般,非技术类的文章不想去写;另外我又是一个还比较热衷于技术的人,而平常复杂一点的东西,如果想写文章写的清楚点,是需要足够...
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
Java坑人面试题系列: 包装类(中级难度)
Java Magazine上面有一个专门坑人的面试题系列: https://blogs.oracle.com/javamagazine/quiz-2。 这些问题的设计宗旨,主要是测试面试者对Java语言的了解程度,而不是为了用弯弯绕绕的手段把面试者搞蒙。 如果你看过往期的问题,就会发现每一个都不简单。 这些试题模拟了认证考试中的一些难题。 而 “中级(intermediate)” 和 “高级(ad
Spring Boot 2.x基础教程:使用JdbcTemplate访问MySQL数据库
在第2章节中,我们介绍了如何通过Spring Boot来实现HTTP接口,以及围绕HTTP接口相关的单元测试、文档生成等实用技能。但是,这些内容还不足以帮助我们构建一个动态应用的服务端程序。不论我们是要做App、小程序、还是传统的Web站点,对于用户的信息、相关业务的内容,通常都需要对其进行存储,而不是像第2章节中那样,把用户信息存储在内存中(重启就丢了!)。 对于信息的存储,现在已经有非常非常多...
基于Python的人脸自动戴口罩系统
目录 1、项目背景 2、页面设计 3、器官识别 4、退出系统 1、项目背景 2019年新型冠状病毒感染的肺炎疫情发生以来,牵动人心,举国哀痛,口罩、酒精、消毒液奇货可居。 抢不到口罩,怎么办?作为技术人今天分享如何使用Python实现自动戴口罩系统,来安慰自己,系统效果如下所示: 本系统的实现原理是借助 Dlib模块的Landmark人脸68个关键点检测库轻松识别出人脸五官
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
相关热词 c# 为空 判断 委托 c#记事本颜色 c# 系统默认声音 js中调用c#方法参数 c#引入dll文件报错 c#根据名称实例化 c#从邮件服务器获取邮件 c# 保存文件夹 c#代码打包引用 c# 压缩效率
立即提问