tomcat 不加载jar文件

validateJarFile(C:\Users\Administrator\Workspaces\Eclipse_neon.metadata.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\demo\WEB-INF\lib\javaee-api-7.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
那位大神帮忙解决下~

4个回答

把jar包放进 webinf 下就可以了

javaee-api-7.0.jar
这个jar在tomcat里面已经存在了!

ma951021
猿小马 我知道啊 他是jar no load 啊
大约 3 年之前 回复

如果在Tomcat目录和你的WEB-INF目录下同时存在这个jar,启动Tomcat的时候就会报这个错。可以把lib目录下的那个文件设置为编译时使用。
这样在Tomcat启动的时候就不会报错了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
spring+shiro 加载jar包里的配置文件时报错ClassNotFoundException
分为两个项目,shiro-client 与 shiro-server, server 依赖client , shiro的配置文件applicationShiro.xml 在client中,applicationShiro.xml 中有一些bean 比如自定义realm 等,报错 就是报这些错,找不到自定义的realm,filter等,这些自定义 realm 是在client中的,但就是找不到,我看tomcat中发布目录页是有这个client这个jar包 的,但就是找不到,会是哪里错了呢?
Nginx的tomcat集群使用Redis来共享session出现ClassNotFound
操作步骤 1、使用apache-tomcat-7.0.47-windows-x64 ,测试成功,可以打开8081 2、使用Redis-x64-3.2.100 安装成功,可以 ping get set 数据成功 3、然后下载了,commons-pool-1.5.4.jar,commons-pool2-2.4.1.jar,jedis-2.6.2.jar,tomcat-juli-adapters.jar,tomcat-redis-session-manager1.2.jar,tomcat-juli.jar 这6个jar包其中tomcat-juli.jar 和tomcat原来的tomcat-juli.jar 有冲突,一个大一点,一个小一点,估计里边的类不同。是否需要替换???我选择不替换。 4、然后在,tomcat的conf文件夹的context.xml配置文件添加 5、<!-- redis session 共享配置 --> <Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" /> <Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager" host="127.0.0.1" port="6379" database="0" maxInactiveInterval="60" /> </Context> 6、然后启动 tomcat,然后就报错了。 报错,ClassNotFoundException 找不到, com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve 没理由呀,RedisSessionHandlerValve在tomcat-redis-session-manager1.2.jar包里边,解压出来,在里边。路径也是一样的。 请问谁遇到了这样的情况??可以分享一下吗??
tomcat启动报错.context.ContextLoaderListener
今天在启动项目的时候遇到这样一个问题java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener然后网上收了很多解决方法,现在给出一个我解决的方法给大家。 Java虚拟机是根据Java ClassLoader(类加载器)决定如何加载Class。 系统默认提供了3个ClassLoader Root ClassLoader,ClassPath Loader,Ext ClassLoader 我们也可以编写自己的ClassLoader,去加载特定环境下的Jar文件。 能不能加载Jar,加载哪里的Jar,是由ClassLoader决定的。 楼主的问题可能是 导入的仅仅是jar包的引用,例如在eclipse中通过build path加进user lib……(类似快捷方式) 这种在Java Application中没问题,但在web Application中可能会出现找不到类的异常。 在WEB Application中jar包最好放在webroot或webcontent下的lib文件夹内,特别是xml中用到的jar包。 因为我是通过eclipse的build path直接引用的jar包,没有把jar文件拷贝到lib目录下。 随后我将所需的jar包全部拷贝到WEB-INF/lib下,再重新启动tomcat便能顺利通过了
把freemarker模板放在jar中,经常报java.io.FileNotFoundException错误,有何办法吗?
我把freemarker模板放在jar中,每次修改后,用ant把所有源文件都打到jar也包括ftl文件,如果仅修改ftl文件,则不需要在tomcat中reload该应用(尽管jar文件被更新了但jar没有重新装载吧,刷新页面会发现freemarker模板的改动生效,似乎从jar包中取模板仅是使用路径),而改过类文件后需要reload重新装载jar,但是reload之后,却又找不到其中的ftl文件了,报错如下: java.io.FileNotFoundException: JAR entry com/originsys/manager/systemservice/view/cachelist.ftl not found in D:\apache-tomcat\webapps\eap2\WEB-INF\lib\eap-manager.jar at 。。。。。。 但是ftl文件的确在那个jar中,只好重启tomcat才能找到,重启tomcat比reload应用慢多了,这样弄效率太低了,请问高手:reload应用后找不到jar中的ftl文件是什么原因?如何才能够找到呢? [b]问题补充:[/b] playfish:打包到jar中也是freemarker推荐的一种做法,因为这样可以保证模板与应用一起发布,提供了ClassTemplateLoader来加载基于类路径的模板。freemarker更推荐多加载器,当文件系统中找不到时则加载类路径中的。我就是这么设置的,但我不想同时修改两份,所有只保留jar中的。 lovewhzlq :我还没找到规律,大部分情况是会出错,如果改类重新发布并reload似乎不出错。freemarker文档中指出,freemarker模板是缓存的,当模板被改变时则刷新缓存,但打到jar中的模板被修改时不能实时获得修改的通知--也许与这有关,但我不知如何调整能避免这个问题 [b]问题补充:[/b] [b]找到规律了:[/b] tomcat重启后为正常状态,此时reload或者从eclipse通过ant发布(打包jar到lib下)均正常,但如果修改后再打包发布,与reload无关,则会报找不到ftl文件。 [b]也就是说,当jar文件被真正修改(增加或修改了类或ftl,使jar文件大小发生了变化,简单修改如删除一句注释则没有影响),则会找不到ftl文件,即使reload也不起作用,只能重启。[/b]
zabbix 监控tomcat 问题
已经搭建好了zabbix监控服务,并且按照网上介绍的步骤安装zabbix_java_gateway, 配置好了setting.sh文件,修改了zabbix__server.conf文件, 修改了tomcat的catalina.sh,tomcat启动成功,通过测试:java -jar cmdline-jmxclient-0.10.3.jar等测试可以返回数据,netstat -nlp|grep 10052 监控正常; 但是就是在zabbix管理页面添加了jmx interfaces后,jmx图标还是灰色,没有变绿,所以再zabbix管理页面看不到监控数据,有哪位大侠知道什么原因吗? 使用的zabbix3.0.3
基于OSGI的WEB项目如何加载制定文件夹jsp文件运行
现在手上开发的一个项目是基于OSGI的web项目,运行期会把模块打成jar包放在一般web工程下面去运行,运行环境暂订tomcat。 现在出现的问题如下:项目中有一个模块会生成一些文件到指定文件夹中(运行期为文件服务器),生成的文件包括js,jsp,css文件,其中js会到模块中去做请求后台数据,并且生成的文件会用到模块中的js或css样式。请问如何才能将生成的文件加载到tomcat中运行。
zabbix监控tomcat遇到的问题
已经搭建好了zabbix监控服务,并且按照网上介绍的步骤安装zabbix_java_gateway, 配置好了setting.sh文件,修改了zabbix__server.conf文件, 修改了tomcat的catalina.sh,tomcat启动成功,通过测试:java -jar cmdline-jmxclient-0.10.3.jar等测试可以返回数据,netstat -nlp|grep 10052 监控正常; 但是就是在zabbix管理页面添加了jmx interfaces后,jmx图标还是灰色,没有变绿,所以再zabbix管理页面看不到监控数据,有哪位大侠知道什么原因吗?
TOMCAT不能加载项目的问题,哪位帮我看看啊,万分感谢..急啊
? \ 我自己有个项目,是对的,在自己的TOMCAT上跑都是对的,现在我放别人的TOMCAT下去跑,但是就出现问题了,我在想可能是他TOMCAT上少什么或者哪儿设置了,你帮我看看,怎么解决哈 \ 2008-6-26 9:42:32 org.apache.catalina.core.StandardHostDeployer install 信息: Processing Context configuration file URL file:C:\ahm\ahmWeb\conf\Catalina \localhost\njproject.xml 2008-06-26 09:42:33,265 INFO [org.apache.myfaces.config.FacesConfigurator] Read ing standard config org/apache/myfaces/resource/standard-faces-config.xml 2008-06-26 09:42:33,375 INFO [org.apache.myfaces.config.FacesConfigurator] Read ing config jar:file:/C:/ahm/ahmWeb/webapps/njproject/WEB-INF b/facestrace-0.8. 1.jar!/META-INF/faces-config.xml 2008-06-26 09:42:33,390 INFO [org.apache.myfaces.config.FacesConfigurator] Read ing config jar:file:/C:/ahm/ahmWeb/webapps/njproject/WEB-INF b/tomahawk-1.1.5- SNAPSHOT.jar!/META-INF/faces-config.xml 2008-06-26 09:42:33,453 INFO [org.apache.myfaces.config.FacesConfigurator] Star ting up MyFaces-package : myfaces-api in version : 1.1.5-SNAPSHOT from path : fi le:/C:/ahm/ahmWeb/webapps/njproject/WEB-INF b/myfaces-api-1.1.5-SNAPSHOT.jar 2008-06-26 09:42:33,453 INFO [org.apache.myfaces.config.FacesConfigurator] Star ting up MyFaces-package : myfaces-impl in version : 1.1.5-SNAPSHOT from path : f ile:/C:/ahm/ahmWeb/webapps/njproject/WEB-INF b/myfaces-impl-1.1.5-SNAPSHOT.jar 2008-06-26 09:42:33,453 INFO [org.apache.myfaces.config.FacesConfigurator] MyFa ces-package : tomahawk-sandbox not found. 2008-06-26 09:42:33,453 INFO [org.apache.myfaces.config.FacesConfigurator] Star ting up MyFaces-package : tomahawk in version : 1.1.5-SNAPSHOT from path : file: /C:/ahm/ahmWeb/webapps/njproject/WEB-INF b/tomahawk-1.1.5-SNAPSHOT.jar 2008-06-26 09:42:33,531 WARN [org.apache.myfaces.shared_impl.util.LocaleUtils] Locale name in faces-config.xml null or empty, setting locale to default locale : zh_CN 2008-06-26 09:42:34,328 INFO [org.apache.myfaces.config.FacesConfigurator] Seri alization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSer ialFactory 2008-06-26 09:42:34,359 INFO [org.apache.myfaces.webapp.StartupServletContextLi stener] ServletContext 'C:\ahm\ahmWeb\webapps\njproject\' initialized. 2008-6-26 9:42:34 org.apache.catalina.core.StandardContext start 严重: Error filterStart 2008-6-26 9:42:34 org.apache.catalina.core.StandardContext start 严重: Context startup failed due to previous errors 2008-6-26 9:42:34 org.apache.catalina.core.StandardHostDeployer install 这就是报的那个错, 服务启动哦,这个项目都访问不到啊 HTTP Status 404 - /njproject/njhomepage/crbtdinggeinfopage.html -------------------------------------------------------------------------------- type Status report message /njproject/njhomepage/crbtdinggeinfopage.html description The requested resource (/njproject/njhomepage/crbtdinggeinfopage.html) is not available. -------------------------------------------------------------------------------- 根本就找不到这个项目 但是服务下他原来的项目是对的,我们现在的TOMCAT与JDK的版本都一致了,但是他的TOMCAT应该是像发布产品那样,发布出来的,之前可能有过改动,哪位给看看... [b]问题补充:[/b] 嗯,TOMCAT下相应的包我都看了,都一样的.... 这个是就是LOGS文件内容 2008-06-26 09:23:28 StandardContext[/servlets-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1f88f7b') 2008-06-26 09:23:28 StandardContext[/servlets-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@193f50c') 2008-06-26 09:23:28 StandardContext[/servlets-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@bd13bf') 2008-06-26 09:23:28 StandardContext[/servlets-examples]SessionListener: contextDestroyed() 2008-06-26 09:23:28 StandardContext[/servlets-examples]ContextListener: contextDestroyed() 2008-06-26 09:24:04 StandardContext[/balancer]Exception starting filter BalancerFilter java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester at org.apache.webapp.balancer.RulesParser.createDigester(RulesParser.java:65) at org.apache.webapp.balancer.RulesParser.<init>(RulesParser.java:43) at org.apache.webapp.balancer.BalancerFilter.init(BalancerFilter.java:79) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) 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:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) 2008-06-26 09:24:04 StandardContext[/jsp-examples]ContextListener: contextInitialized() 2008-06-26 09:24:04 StandardContext[/jsp-examples]SessionListener: contextInitialized() 2008-06-26 09:24:05 StandardContext[/servlets-examples]ContextListener: contextInitialized() 2008-06-26 09:24:05 StandardContext[/servlets-examples]SessionListener: contextInitialized() 2008-06-26 09:26:33 StandardContext[/servlets-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1650cea') 2008-06-26 09:26:33 StandardContext[/servlets-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@132ece7') 2008-06-26 09:26:33 StandardContext[/servlets-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@5f6ed4') 2008-06-26 09:26:33 StandardContext[/servlets-examples]SessionListener: contextDestroyed() 2008-06-26 09:26:33 StandardContext[/servlets-examples]ContextListener: contextDestroyed() 2008-06-26 09:26:35 StandardContext[/jsp-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1ba3c1f') 2008-06-26 09:26:35 StandardContext[/jsp-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@1c12050') 2008-06-26 09:26:35 StandardContext[/jsp-examples]ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FILES', '[Ljava.lang.String;@309239') 2008-06-26 09:26:35 StandardContext[/jsp-examples]SessionListener: contextDestroyed() 2008-06-26 09:26:35 StandardContext[/jsp-examples]ContextListener: contextDestroyed() [b]问题补充:[/b] 唯一觉得有点不一样的就他的server.xml <?xml version='1.0' encoding='utf-8'?> <Server> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/> <GlobalNamingResources> <Environment name="simpleValue" type="java.lang.Integer" value="30"/> <Resource auth="Container" description="User database that can be updated and saved" name="UserDatabase" type="org.apache.catalina.UserDatabase"/> <ResourceParams name="UserDatabase"> <parameter> <name>factory</name> <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value> </parameter> <parameter> <name>pathname</name> <value>conf/tomcat-users.xml</value> </parameter> </ResourceParams> </GlobalNamingResources> <Service name="Catalina"> <Connector URIEncoding="GBK" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="8080" redirectPort="8443" maxSpareThreads="75" maxThreads="150" minSpareThreads="25"> </Connector> <Connector port="8009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" redirectPort="8443" URIEncoding="GBK"> </Connector> <Engine defaultHost="localhost" name="Catalina" jvmRoute="tomcat1"> <Host appBase="webapps" name="localhost"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_log." suffix=".txt" timestamp="true"/> </Host> <Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true"/> <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/> </Engine> </Service> </Server> 少了一些东西 [b]问题补充:[/b] 版本一样哈 [b]问题补充:[/b] 我把包放在了 commer/lib 还是不行哈 。那个包也有
Spring mvc+mybatis+maven的项目tomcat启动的时候,控制台不输出xml文件的加载信息
2014-3-17 9:52:18 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.24 using APR version 1.4.6. 2014-3-17 9:52:18 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2014-3-17 9:52:18 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized (OpenSSL 1.0.1c 10 May 2012) 2014-3-17 9:52:19 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-apr-8080"] 2014-3-17 9:52:19 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-apr-8009"] 2014-3-17 9:52:19 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1944 ms 2014-3-17 9:52:19 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 2014-3-17 9:52:19 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.32 2014-3-17 9:52:19 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\apache-tomcat-7.0.32\webapps\sso 2014-3-17 9:52:23 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 09:52:25.000 [localhost-startStop-1] DEBUG org.apache.ibatis.logging.LogFactory - Logging initialized using 'org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter. 09:52:26.250 [localhost-startStop-1] DEBUG o.m.spring.SqlSessionFactoryBean - Property 'configLocation' not specified, using default MyBatis Configuration 09:52:26.343 [localhost-startStop-1] DEBUG o.m.spring.SqlSessionFactoryBean - Property 'mapperLocations' was not specified or no matching resources found 09:52:26.734 [localhost-startStop-1] DEBUG net.sf.ehcache.CacheManager - Creating new CacheManager with default config 09:52:26.750 [localhost-startStop-1] DEBUG net.sf.ehcache.CacheManager - Configuring ehcache from classpath. 09:52:26.750 [localhost-startStop-1] WARN n.s.e.config.ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/apache-tomcat-7.0.32/webapps/sso/WEB-INF/lib/ehcache-core-2.4.3.jar!/ehcache-failsafe.xml 09:52:26.750 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationFactory - Configuring ehcache from URL: jar:file:/D:/apache-tomcat-7.0.32/webapps/sso/WEB-INF/lib/ehcache-core-2.4.3.jar!/ehcache-failsafe.xml 09:52:26.750 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationFactory - Configuring ehcache from InputStream 09:52:26.781 [localhost-startStop-1] DEBUG net.sf.ehcache.config.BeanHandler - Ignoring ehcache attribute xmlns:xsi 09:52:26.781 [localhost-startStop-1] DEBUG net.sf.ehcache.config.BeanHandler - Ignoring ehcache attribute xsi:noNamespaceSchemaLocation 09:52:26.781 [localhost-startStop-1] DEBUG n.s.e.config.DiskStoreConfiguration - Disk Store Path: D:\apache-tomcat-7.0.32\temp 09:52:26.843 [localhost-startStop-1] DEBUG net.sf.ehcache.util.PropertyUtil - propertiesString is null. 09:52:26.843 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationHelper - No CacheManagerEventListenerFactory class specified. Skipping... 09:52:26.921 [localhost-startStop-1] DEBUG net.sf.ehcache.Cache - No BootstrapCacheLoaderFactory class specified. Skipping... 09:52:26.921 [localhost-startStop-1] DEBUG net.sf.ehcache.Cache - CacheWriter factory not configured. Skipping... 09:52:26.921 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationHelper - No CacheExceptionHandlerFactory class specified. Skipping... 09:52:26.968 [localhost-startStop-1] DEBUG n.s.e.s.c.f.DiskOverflowStorageFactory - Deleting data file com.ustl.gd.droit.daoImpl.DroitDao.data 09:52:27.000 [localhost-startStop-1] DEBUG net.sf.ehcache.Cache - Initialised cache: com.ustl.gd.droit.daoImpl.DroitDao 09:52:27.000 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationHelper - CacheDecoratorFactory not configured for defaultCache. Skipping for 'com.ustl.gd.droit.daoImpl.DroitDao'. 09:52:27.109 [localhost-startStop-1] DEBUG n.s.e.s.c.f.DiskOverflowStorageFactory - Deleting data file com.ustl.gd.rtd.daoImpl.RtdDao.data 09:52:27.109 [localhost-startStop-1] DEBUG net.sf.ehcache.Cache - Initialised cache: com.ustl.gd.rtd.daoImpl.RtdDao 09:52:27.109 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationHelper - CacheDecoratorFactory not configured for defaultCache. Skipping for 'com.ustl.gd.rtd.daoImpl.RtdDao'. 09:52:27.125 [localhost-startStop-1] DEBUG n.s.e.s.c.f.DiskOverflowStorageFactory - Deleting data file com.ustl.gd.utr.daoImpl.UtrDao.data 09:52:27.125 [localhost-startStop-1] DEBUG net.sf.ehcache.Cache - Initialised cache: com.ustl.gd.utr.daoImpl.UtrDao 09:52:27.125 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationHelper - CacheDecoratorFactory not configured for defaultCache. Skipping for 'com.ustl.gd.utr.daoImpl.UtrDao'. 09:52:27.156 [localhost-startStop-1] DEBUG n.s.e.s.c.f.DiskOverflowStorageFactory - Deleting data file com.ustl.gd.user.daoImpl.UserDao.data 09:52:27.156 [localhost-startStop-1] DEBUG net.sf.ehcache.Cache - Initialised cache: com.ustl.gd.user.daoImpl.UserDao 09:52:27.156 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationHelper - CacheDecoratorFactory not configured for defaultCache. Skipping for 'com.ustl.gd.user.daoImpl.UserDao'. 09:52:27.171 [localhost-startStop-1] DEBUG n.s.e.s.c.f.DiskOverflowStorageFactory - Deleting data file com.ustl.gd.role.daoImpl.RoleDao.data 09:52:27.171 [localhost-startStop-1] DEBUG net.sf.ehcache.Cache - Initialised cache: com.ustl.gd.role.daoImpl.RoleDao 09:52:27.171 [localhost-startStop-1] DEBUG n.s.e.config.ConfigurationHelper - CacheDecoratorFactory not configured for defaultCache. Skipping for 'com.ustl.gd.role.daoImpl.RoleDao'. 2014-3-17 9:52:27 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'spring-mvc' 09:52:27.937 [net.sf.ehcache.CacheManager@30a895] DEBUG net.sf.ehcache.util.UpdateChecker - Checking for update... 2014-3-17 9:52:29 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-apr-8080"] 2014-3-17 9:52:29 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-apr-8009"] 2014-3-17 9:52:29 org.apache.catalina.startup.Catalina start 信息: Server startup in 9622 ms 09:52:31.234 [net.sf.ehcache.CacheManager@30a895] DEBUG net.sf.ehcache.util.UpdateChecker - Update check failed: java.net.SocketTimeoutException: connect timed out
一个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)
IDEA Struts2项目 启动tomcat失败
## **项目是通过勾选web application 和Struts2生成的,lib是Struts2自动下载的。** ## **尝试了通过本地使用从官网下载的Struts2 jar文件也不行** ## **把jar依赖文件添加到WEB-INF/lib中也不行** ## ## **希望大佬解答** 下面是错误信息 D:\Software\apache-tomcat-9.0.27\bin\catalina.bat run [2019-11-19 08:13:32,924] Artifact newtest3:war exploded: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\zouha\.IntelliJIdea2019.1\system\tomcat\Unnamed_newtest3" Using CATALINA_HOME: "D:\Software\apache-tomcat-9.0.27" Using CATALINA_TMPDIR: "D:\Software\apache-tomcat-9.0.27\temp" Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_221" Using CLASSPATH: "D:\Software\apache-tomcat-9.0.27\bin\bootstrap.jar;D:\Software\apache-tomcat-9.0.27\bin\tomcat-juli.jar" 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/9.0.27 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器构建: Oct 7 2019 09:57:22 UTC 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.27.0 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 架构: amd64 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: C:\Program Files\Java\jdk1.8.0_221\jre 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 版本: 1.8.0_221-b11 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\zouha\.IntelliJIdea2019.1\system\tomcat\Unnamed_newtest3 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\Software\apache-tomcat-9.0.27 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\zouha\.IntelliJIdea2019.1\system\tomcat\Unnamed_newtest3\conf\logging.properties 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote= 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\zouha\.IntelliJIdea2019.1\system\tomcat\Unnamed_newtest3\jmxremote.password 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\zouha\.IntelliJIdea2019.1\system\tomcat\Unnamed_newtest3\jmxremote.access 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\zouha\.IntelliJIdea2019.1\system\tomcat\Unnamed_newtest3 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\Software\apache-tomcat-9.0.27 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\Software\apache-tomcat-9.0.27\temp 19-Nov-2019 20:13:34.763 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.23] using APR version [1.7.0]. 19-Nov-2019 20:13:34.778 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 19-Nov-2019 20:13:34.778 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 19-Nov-2019 20:13:34.794 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1c 28 May 2019] 19-Nov-2019 20:13:34.997 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"] 19-Nov-2019 20:13:35.028 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["ajp-nio-8009"] 19-Nov-2019 20:13:35.028 信息 [main] org.apache.catalina.startup.Catalina.load 服务器在[465]毫秒内初始化 19-Nov-2019 20:13:35.059 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 19-Nov-2019 20:13:35.059 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.27] 19-Nov-2019 20:13:35.075 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"] 19-Nov-2019 20:13:35.075 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["ajp-nio-8009"] 19-Nov-2019 20:13:35.075 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in [56] milliseconds Connected to server [2019-11-19 08:13:35,564] Artifact newtest3:war exploded: Artifact is being deployed, please wait... ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... ERROR Dispatcher Dispatcher initialization failed java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:289) at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:422) at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:231) at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:52) at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:106) at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:584) at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:581) at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:560) at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:581) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:287) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:162) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73) at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:251) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4533) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1728) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:456) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:405) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at java.security.AccessController.doPrivileged(Native Method) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:287) ... 66 more Caused by: java.lang.ExceptionInInitializerError at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:88) ... 71 more Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency! at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:169) ... 72 more Caused by: java.lang.ClassNotFoundException: javassist.ClassPool at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:166) ... 72 more 19-Nov-2019 20:13:36.564 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常 java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector File: ContainerImpl.java [2019-11-19 08:13:36,595] Artifact newtest3:war exploded: Error during artifact deployment. See server log for details. Method: inject Line: 289 - com/opensymphony/xwork2/inject/ContainerImpl.java:289:-1 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:509) at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73) at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:251) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4533) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5172) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1728) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:456) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:405) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:289) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at java.security.AccessController.doPrivileged(Native Method) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:289) at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:422) at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:231) at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:52) at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:106) at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:584) at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:581) at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:560) at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:581) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:287) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:162) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) ... 52 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:287) ... 66 more Caused by: java.lang.ExceptionInInitializerError at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:88) ... 71 more Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency! at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:169) ... 72 more Caused by: java.lang.ClassNotFoundException: javassist.ClassPool at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:166) ... 72 more 19-Nov-2019 20:13:36.579 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file 19-Nov-2019 20:13:36.579 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors 19-Nov-2019 20:13:45.090 信息 [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [D:\Software\apache-tomcat-9.0.27\webapps\manager] 19-Nov-2019 20:13:45.153 信息 [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Software\apache-tomcat-9.0.27\webapps\manager] has finished in [63] ms
请教tomcat5.5配置MagickImage的问题
我想做一个将上传的图片进行清晰压缩的功能,所以想用MagickImage来实现,google了一下,找了很多资料,也按步骤配置了,可是每次在上传的时候tomcat就自动跳出来。调了好久都没效果,希望有朋友能帮忙一下。以下是我配置的步骤和图片压缩的代码: 1、下载ImageMagick-6.6.2-9-Q16-windows-dll.exe并安装,安装后系统会自动在环境变量path中添加值C:\Program Files\ImageMagick-6.6.2-Q16。 2、将ImageMagick-6.6.2-9-Q16-windows-dll安装目录下的所有.dll文件都拷到C:\WINDOWS\system32下。 3、下载jmagick-win-6.3.9-Q16.zip并解压,解压后,将文件jmagick.dll拷到C:\WINDOWS\system32下和jdk的bin目录下各一份。 4、将jmagick.jar复制到Tomcat下的lib文件夹里 和 所使用项目的WEB-INF下lib文件里 各一份。 5、将jmagick.jar复制一份到jdk\jre\lib\ext目录下(有人说这步骤也可以通过在java脚本中加上一句:static{System.setProperty("jmagick.systemclassloader","no");}来实现)。目前我们是两种方法都做上去的。 6、代码: //该方法为将图片按比率高清压缩为150*120范围内的缩略图,在上传函数中调用。 //参数:filePath为上传图片的路径,toPath为压缩后图片的路径。 public boolean scale(String filePath, String toPath) throws Exception { System.setProperty("jmagick.systemclassloader","no"); boolean sf = false; ImageInfo info = null; MagickImage image = null; Dimension imageDim = null; MagickImage scaled = null; try { info = new ImageInfo(filePath); image = new MagickImage(info); imageDim = image.getDimension(); float width = imageDim.width; float height = imageDim.height; float bl = 1; float bl_w = width / 150; float bl_h = height / 120; if (bl_w >= bl_h) { bl = bl_w; } else { bl = bl_h; } width = width / bl; height = height / bl; int new_width = (int) width; int new_height = (int) height; scaled = image.scaleImage(new_width, new_height); scaled.setFileName(toPath); scaled.writeImage(info); sf = true; } catch (Exception ex) { sf = false; } finally { if (scaled != null) { scaled.destroyImages(); } } return sf; } 我按以上方式配置后,每次上传的时候,tomcat5.5就自动跳出消失。 上网找了下,有人说是jvm内存的问题,说要在tomcat/bin/catalina.bat文件中加上语句: set JAVA_OPTS=%JAVA_OPTS% -Xms256M -Xmx768M -XX:MaxPermSize=128M – Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager – Djava.util.logging.config.file=”${catalina.base}\conf\logging.properties” 由于我装的tomcat5.5是ext版本的,bin目录下并没有catalina.bat文件,所以我就下载了tomcat5.5.zip版本,从里面的bin目录中拷贝出catalina.bat和setclasspath.bat这两个文件到我的tomcat5.5下面的bin目录下。并将上述语句加到catalina.bat中。 但我这样做了,问题还是存在,还是老问题,一上传就tomcat就跳出来。搞了好久都没能弄好,希望有朋友能帮忙解答一下。谢谢!
tomcat7 log4j配置一部分日志还在catalina.out输出
我按照网上配置在tomcat配置了log4j,一部分日志是按我配置那样输出的,但是有一部分日志还是写入catalina.out,不知道为什么,我看了主要是线程调用的类输出的日志。 有谁知道原因吗? 步骤如下: 1. 把log4j-1.2.17.jar,tomcat-juli.jar,tomcat-juli-adapters.jar拷贝到tomcate目录/ lib下 2. 把tomcat-juli.jar拷贝到tomcate目录/ bin下,并覆盖原来的tomcat-juli.jar 3. 在tomcate目录/ lib下(例如/tomcat/apache-tomcat-7.0.59/lib)新建一个文件log4j.properties,并添加如下内容 log4j.rootLogger=INFO, CATALINA # Define all the appenders log4j.appender.CATALINA=org.apache.log4j.RollingFileAppender log4j.appender.CATALINA.File=${catalina.base}/logs/catalina. log4j.appender.CATALINA.MaxFileSize=50MB log4j.appender.CATALINA.MaxBackupIndex=100 log4j.appender.CATALINA.Append=true log4j.appender.CATALINA.Encoding=GBK # Roll-over the log once per day log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd-HH-mm'.log' log4j.appender.CATALINA.layout = org.apache.log4j.PatternLayout log4j.appender.CATALINA.layout.ConversionPattern = %d [%t] %-5p %c- %m%n log4j.appender.LOCALHOST=org.apache.log4j.DailyRollingFileAppender log4j.appender.LOCALHOST.File=${catalina.base}/logs/localhost. log4j.appender.LOCALHOST.Append=true log4j.appender.LOCALHOST.Encoding=GBK log4j.appender.LOCALHOST.DatePattern='.'yyyy-MM-dd-HH'.log' log4j.appender.LOCALHOST.layout = org.apache.log4j.PatternLayout log4j.appender.LOCALHOST.layout.ConversionPattern = %d [%t] %-5p %c- %m%n log4j.appender.MANAGER=org.apache.log4j.DailyRollingFileAppender log4j.appender.MANAGER.File=${catalina.base}/logs/manager. log4j.appender.MANAGER.Append=true log4j.appender.MANAGER.Encoding=GBK log4j.appender.MANAGER.DatePattern='.'yyyy-MM-dd'.log' log4j.appender.MANAGER.layout = org.apache.log4j.PatternLayout log4j.appender.MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n log4j.appender.HOST-MANAGER=org.apache.log4j.DailyRollingFileAppender log4j.appender.HOST-MANAGER.File=${catalina.base}/logs/host-manager. log4j.appender.HOST-MANAGER.Append=true log4j.appender.HOST-MANAGER.Encoding=GBK log4j.appender.HOST-MANAGER.DatePattern='.'yyyy-MM-dd'.log' log4j.appender.HOST-MANAGER.layout = org.apache.log4j.PatternLayout log4j.appender.HOST-MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.Encoding=GBK log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern = %d [%t] %-5p %c- %m%n # Configure which loggers log to which appenders log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO, LOCALHOST log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]=\ INFO, MANAGER log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]=\ INFO, HOST-MANAGER 4. 在tomcate目录/ conf下(例如/tomcat/apache-tomcat-7.0.59/conf)打开context.xml,把<Context>修改为<Context swallowOutput="true"> 5. 删除 Tomcat 的/tomcat/apache-tomcat-7.0.59/conf/logging.properties 文件(或者重命名-建议)
Spring框架入门,tomcat启动成功,但是出现关于上下文加载异常?
这是一个制作登陆页面的小练习,大概长这样 ![图片说明](https://img-ask.csdn.net/upload/201907/20/1563604903_663111.png) **错误信息是在Server startup后立马就出现的**,还没来得及访问index.jsp呢!求指点,谢谢。 web.xml存放在WEB-INF文件夹下 ![图片说明](https://img-ask.csdn.net/upload/201907/20/1563607667_370819.png) ## 错误信息: ``` 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.5.42 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Jun 4 2019 20:29:04 UTC 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.5.42.0 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 10 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 10.0 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files\Java\jdk1.8.0_201\jre 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_201-b09 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: D:\apache-tomcat-8.5.42 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=D:\apache-tomcat-8.5.42 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=D:\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-8.5.42\endorsed 七月 20, 2019 3:20:35 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=UTF-8 七月 20, 2019 3:20:35 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5]. 七月 20, 2019 3:20:35 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 七月 20, 2019 3:20:35 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 七月 20, 2019 3:20:35 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018] 七月 20, 2019 3:20:35 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8080"] 七月 20, 2019 3:20:36 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 20, 2019 3:20:36 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8009"] 七月 20, 2019 3:20:36 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 20, 2019 3:20:36 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1265 ms 七月 20, 2019 3:20:36 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service [Catalina] 七月 20, 2019 3:20:36 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.5.42 七月 20, 2019 3:20:39 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 七月 20, 2019 3:20:39 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 七月 20, 2019 3:20:39 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 七月 20, 2019 3:20:42 下午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usersService' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'usersMapper' of bean class [yan.ibbie.service.impl.UsersServiceImpl]: Bean property 'usersMapper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1718) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4770) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5236) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'usersMapper' of bean class [yan.ibbie.service.impl.UsersServiceImpl]: Bean property 'usersMapper' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:243) at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:426) at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278) at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:266) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:97) at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:77) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1714) ... 22 more 七月 20, 2019 3:20:42 下午 org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file 七月 20, 2019 3:20:42 下午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/SpringLogin] startup failed due to previous errors 七月 20, 2019 3:20:42 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 七月 20, 2019 3:20:42 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc 警告: The web application [SpringLogin] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 七月 20, 2019 3:20:42 下午 org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads 警告: The web application [SpringLogin] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144) com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:85) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) java.lang.Thread.run(Thread.java:748) 七月 20, 2019 3:20:42 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8080"] 七月 20, 2019 3:20:42 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8009"] 七月 20, 2019 3:20:42 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 5949 ms 七月 20, 2019 3:20:45 下午 org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading 信息: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1384) at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1034) at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.checkThreadContextClassLoader(AbandonedConnectionCleanupThread.java:117) at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:84) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ## web.xml配置如下: ``` <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> <!-- 设置Spring配置文件路径 --> <!-- 当tomcat加载web.xml时,会把Spring配置文件信息存放到application对象 --> <!-- WebApplicationContext是ApplicationContext的子接口 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- 加载Spring配置文件 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app> ``` ## applicationContext.xml的Spring配置如下: ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- 数据源封装类 --> <bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/ssm?serverTimezone=GMT%2B8"/> <property name="username" value="root"/> <property name="password" value="147852369"/> </bean> <!-- SqlSessionFactory --> <bean id="factory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="datasource"/> </bean> <!-- 扫描器 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactory" ref="factory"/> <property name="basePackage" value="yan.ibbie.mapper"/> </bean> <!-- 创建UsersService的实现类,其中usersMapper是Spring自动创建的bean --> <bean id="usersService" class="yan.ibbie.service.impl.UsersServiceImpl"> <property name="usersMapper" ref="usersMapper"/> </bean> </beans> ``` ## index.jsp页面如下: ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <script type="text/javascript" src="/js/jquery-3.4.1.js"></script> <script type="text/javascript"> $(function(){ $("a").click(function(){ $("img").attr("src","validcode?date="+new Date()); return false; }) }) </script> </head> <body> ${error } <form action="Login" method="post"> 用户名:<input type="text" name="username" /><br> 密码:<input type="password" name="password" /><br> 验证码:<input type="text" size="1" name="code"/><img src="validcode" width="80" height="40"/><a href="">看不清</a><br> <input type="submit" value="登陆" /><input type="reset" value="重置" /> </form> </body> </html> ``` ## 出错的是LoginServlet中一堆aaaaa那行,LoginServlet如下: ``` package yan.ibbie.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.context.ApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import yan.ibbie.pojo.Users; import yan.ibbie.service.UsersService; import yan.ibbie.service.impl.UsersServiceImpl; /** * Servlet implementation class LoginServlet */ @WebServlet("/Login") public class LoginServlet extends HttpServlet { private static final long serialVersionUID = 1L; private UsersService usersService; @Override public void init() throws ServletException { System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"+getServletContext()); ApplicationContext ac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()); usersService = ac.getBean("usersService",UsersServiceImpl.class); } @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String code = req.getParameter("code"); HttpSession session = req.getSession(); String codeSession = session.getAttribute("validcode").toString(); if (codeSession.equals(code)) { Users users = new Users(); String username = req.getParameter("username"); String password = req.getParameter("password"); users.setUsername(username); users.setPasserword(password); Users user = usersService.login(users); if (user!=null) { resp.sendRedirect("main.jsp"); }else { req.setAttribute("error", "用户名和密码不正确"); req.getRequestDispatcher("index.jsp").forward(req, resp); } }else { req.setAttribute("error", "验证码不正确"); req.getRequestDispatcher("index.jsp").forward(req, resp); } } } ```
struts1.2中Tomcat启动错误,请帮忙看看
用Myeclipse添加的Struts1.2环境,检查后发现jar包、标签库文件和配置文件都正常,不知道为什么会出现下列错误: 严重: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@1f21c50 org.apache.struts.action.ActionServlet java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)。。。 [b]问题补充:[/b] 我用Myeclipse6.0自动添加的包,添加后在工程列表中出现了“Struts1.2 Libraries ”里面有8个包,但是在WEB-INF的Lib目录中却没有对应的出现,然后启动Tomcat出现上面的错误; 我再尝试用手工添加,直接把8个包拖到Myeclipse中的Lib中,然后出现了“Referenced Libraries ”里面是8个包,我相应的文件目录中Lib也出现了包了,这时候启动Tomcat就没有错误了。 不太明白这是为什么,为什么它自动添加的不行呢?
JavaTomcat部署远程web启动错误-本地部署远程web启动错误
JavaTomcat启动错误 关键错误日志如下: 28-Jun-2019 07:54:44.034 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 28-Jun-2019 07:54:44.147 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\WebServer\apache-tomcat-8.0.35\webapps\DaysToDie] 28-Jun-2019 07:54:44.173 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DaysToDie]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@aaca5bc] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@77cfd824] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140) at Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: error in opening zip file at Caused by: java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(Unknown Source) at java.util.zip.ZipFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at java.util.jar.JarFile.<init>(Unknown Source) at 放到远程之后无法启动,本地正常 1.看了报错之后,这边第一时间是去删tomcat-catalina缓存,然后进行开启 2.仔细检查过web.xml没有问题,甚至删除了后面添加的一部分进行测试,也就是之前这个在远程能正常访问的 3.继续看下面的日志,他说无法打开zip文件后面还报了一些jar资源文件错误 jar文件可以确保是没错误的,刚开始这些放到远程正常启动 我是直接把本地tomcat-webapps放到远程上面的tomcat-webapps的,远程的访问加载路径这些都在第一次使用时改过,后面一段时间也正常使用 后面改了一些代码,然后重新部署时出现该错误
tomcat内存溢出问题,急求解决
tomcat报错信息 当前JDK版本:20.45-b01 最大内存=1437MB; 总的内存=1437MB; 空闲内存=1367MB; [SHWT] 2017年03月30日 09:43:50 服务器:发布框架版本_Ver.2.2.3 [SHWT] 2017年03月30日 09:43:50 服务器:已成功绑定Web容器上下文... [SHWT] 2017年03月30日 09:43:50 服务器:网上消息文件上载临时路径->>C:\Users\Administrator\workspace\ssxf\WebContent\upload [SHWT] 2017年03月30日 09:43:50 服务器:网上消息文件下载临时路径->>C:\Users\Administrator\workspace\ssxf\WebContent\wsxxBackUp [SHWT] 2017年03月30日 09:43:50 服务器:DEPLOYID=SHWT [SHWT] 2017年03月30日 09:43:50 服务器:加载系统配置信息完成... [SHWT] 2017年03月30日 09:43:50 高速缓存:TS_BZDM 共加载258条记录 [SHWT] 2017年03月30日 09:43:50 高速缓存:TS_BZDM(list) 共加载11条记录 [SHWT] 2017年03月30日 09:43:50 高速缓存:T_USER 共加载112条记录 [SHWT] 2017年03月30日 09:43:50 高速缓存:TS_DEPART 共加载40条记录 [SHWT] 2017年03月30日 09:43:50 高速缓存:TS_FYMC 共加载3572条记录 [SHWT] 2017年03月30日 09:43:50 高速缓存:T_ROLE 共加载14条记录 [SHWT] 2017年03月30日 09:43:50 服务器:缓存对象加载完成... [SHWT] 2017年03月30日 09:43:50 定时器:在线用户检测服务启动完成... [SHWT] 2017年03月30日 09:43:50 服务器:发布信访版本_Ver.2016-02-26 [SHWT] 2017年03月30日 09:43:50 服务器:Request线程同步器注册成功... 2017-3-30 9:43:50 org.apache.cxf.transport.servlet.CXFServlet updateContext 信息: Load the bus with application context 2017-3-30 9:43:50 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources 信息: No cxf.xml configuration file detected, relying on defaults. 2017-3-30 9:43:50 org.apache.cxf.transport.servlet.AbstractCXFServlet replaceDestinationFactory 信息: Servlet transport factory already registered 2017-3-30 9:43:53 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(C:\Users\Administrator\workspace\ssfw_apporg\WebContent\WEB-INF\lib\servlet-api2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class java.lang.reflect.InvocationTargetException 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) Exception in thread "main" java.lang.OutOfMemoryError: PermGen space at java.lang.Throwable.getStackTraceElement(Native Method) at java.lang.Throwable.getOurStackTrace(Throwable.java:591) at java.lang.Throwable.printStackTraceAsCause(Throwable.java:481) at java.lang.Throwable.printStackTrace(Throwable.java:468) at java.lang.Throwable.printStackTrace(Throwable.java:451) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:421) Exception in thread "DefaultQuartzScheduler_QuartzSchedulerThread" java.lang.OutOfMemoryError: PermGen space 内存明明还有很多,但却报内存溢出![图片说明](https://img-ask.csdn.net/upload/201703/30/1490838696_386678.png)
项目中使用了shiro,我添加了几个实体类,启动tomcat报错
Error creating bean with name 'entityManagerFactory' defined in URL [file:/F:/eclipseWorkSpace1219/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/OmpApp/WEB-INF/classes/spring/spring-dao.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build EntityManagerFactory,我的项目是用pom管理的,分了一个war项目和是个jar项目,我在jar项目A中添加了五个实体类,然后在war项目B中的pom文件中增加了对A项目的依赖,但是启动服务器的时候报错。我这个项目使用的shiro,在spring-shiro.xml文件中定义了安全认证过滤器shiroFilter,启动的时候,shiro对实体类进行过滤吗?
jaxws,WebService,布署到独立Tomcat7,无法启动
工具:MyEclipse2014 for spring 问题: 使用jaxws开发的WebService服务端,布署到独立的Tomcat7.0.54时,无法启动。 日志 严重: Error configuring application listener of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener java.lang.ClassNotFoundException: com.sun.xml.ws.transport.http.servlet.WSServletContextListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:529) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:139) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4888) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) **后来搜索了一下,说是jdk不带jaxws的包,下载了jaxws-ri-2.2.10.zip把lib的jar放到项目lib下成功启动。** 但是在用MyEclipse开发时运行就没有问题,用的是MyEclipse自己带的Tomcat _**我的问题是:为什么在Myeclipse自带的Tomcat中它就能启动,我搜索了整个Myeclipse文件夹,也没找到WSServletContextListener这个类,为什么它就能加载这个类,MyEclipse的Tomcat从哪里加载这个类?*_*
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch
深深的码丨Java HashMap 透析
HashMap 相关概念 HashTab、HashMap、TreeMap 均以键值对像是存储或操作数据元素。HashTab继承自Dictionary,HashMap、TreeMap继承自AbstractMap,三者均实现Map接口 **HashTab:**同步哈希表,不支持null键或值,因为同步导致性能影响,很少被使用 **HashMap:**应用较多的非同步哈希表,支持null键或值,是键值对...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
相关热词 c# 输入ip c# 乱码 报表 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件
立即提问