我在我的eclipse(helios)环境中设置了Tomcat v7.0服务器,用于测试Web应用程序.目前我在我的工作区中有一个struts web-app,它正确地加载到服务器中,以及我试图上传的两个动态web项目.主要是,我想为第一个项目转换为axis2的web服务,为第二个项目转换为简单的html页面(用于测试此问题).
但是,没有人在服务器内正确加载,我看到另一个进程错误导致锁定.
服务器控制台给出的错误是:
Publishing failed with multiple errors
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\activation-1.1.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\antlr-2.7.7.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axiom-api-1.2.11.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axiom-dom-1.2.11.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axiom-impl-1.2.11.jar. May be locked by another process.
Could not delete C:\Documents and Settings\xgeneric\workspaceSkillInventory\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\WStest3\WEB-INF\lib\axis2-adb-1.6.0.jar. May be locked by …Run Code Online (Sandbox Code Playgroud) 我想做mvn clean package tomcat7:deploy但总是得到这个错误:tomcatManager status code:403, ReasonPhrase:Forbbiden
我的配置是下一个:
〜/ .m2目录/ settings.xml中
<servers>
<server>
<id>localhost</id>
<username>tomcat</username>
<password>s3cret</password>
</server>
</servers>
Run Code Online (Sandbox Code Playgroud)
的pom.xml
<profiles>
<profile>
<id>tomcat-localhost</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<tomcat-server>localhost</tomcat-server>
<tomcat-url>http://localhost:8080/manager/html</tomcat-url>
</properties>
</profile>
</profiles>
<build>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<server>${tomcat-server}</server>
<url>${tomcat-url}</url>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
的tomcat-users.xml中
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
Run Code Online (Sandbox Code Playgroud)
我的错是什么?因为我没有看到它.
完成邮件错误:
[INFO] --- tomcat7-maven-plugin:2.0:deploy (default-cli) @ WebApp ---
[INFO] Deploying war to http://localhost:8080/Baskeitor
Uploading: http://localhost:8080/manager/html/deploy?path=%2FWebApp
Uploaded: http://localhost:8080/manager/html/deploy?path=%2FWebApp (7985 KB at 50215.2 KB/sec)
[INFO] tomcatManager status code:403, …Run Code Online (Sandbox Code Playgroud) 这可能是一个noob问题,但是在很多教程和示例中,我看到这些注释被用作好像它们做同样的事情.
然而,我遇到一些限制使用@Named一个(特别是依赖注入等)我找不到解释差异的来源,如果有人可以粗略概述何时使用一个或者其他.
我正在尝试读取test1.properties位于外部文件夹的文件.
这是我的spring配置文件:
<bean id="propertyConfigurer3" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="locations">
<list>
<value>classpath:test.properties</value>
<value>classpath:test1.properties</value>
</list>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
如果我把它test1.properties放在tomcat7/lib文件夹中,我就能阅读它.但是,我想将它放在不同的目录中tomcat7/env/test1.properties
我添加了以下路径conf/catalina.properties:
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/env
Run Code Online (Sandbox Code Playgroud)
这不起作用,请帮忙
解决方案:
好的..终于解决了..我一直都在正确地做这件事..这是我的IDE造成的问题.IDE没有获取catalina.properties文件中的更改.我不得不在IDE中删除服务器配置并重新配置它.
这些链接一般有用:
这是我尝试将maven项目部署到tomcat时 遇到的 错误mvn tomcat7:deploy错误: INFO:validateJarFile(D:\ Softwares\tomcat\apache-tomcat-7.0.50\webapps\myWebApp_ 1\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar未加载.请参阅Servlet规范3. 0,第10.7.2节.违规类:javax/servlet/Servlet.class
但是WEB-INF\lib中的javax.servlet-api-3.0.1.jar谢谢
我试图升级到Java 8时开始我们的tomcat7服务器,使用Java 7编译.war文件,我得到下面的神秘错误.
我应该期待这个吗?这篇文章说tomcat 7应该可以使用1.6及更高版本.我不知道Tomcat是应该责备还是.war.切换出我得到的不同Java版本:
是tomcat还是.war?
Caused by: org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2032)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1891)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1877)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
Run Code Online (Sandbox Code Playgroud) 我目前正在尝试将我的项目从Java EE转移到Spring Boot项目.但是,我对调度程序servlet和web.xml的部分感到困惑和困惑,似乎web.xml不再被项目读取了.当前项目在tomcat 7上运行.
在我的web.xml文件,我有很多的servlet,servlet-mapping,filter和filter mapping我真的不知道该怎么办的调度映射.
我附上了我的web.xml下面的样本,版本是2.5.
<?xml version="1.0" encoding="UTF-8"?>
<web-app metadata-complete="true" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>displayName</display-name>
<description>description</description>
<resource-ref>
...
</resource-ref>
<filter>
<filter-name>Some Filter Name</filter-name>
<filter-class>Some Filter Class</filter-class>
<init-param>
<param-name>Some Param Name</param-name>
<param-value>Some Value</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Some Filter Name</filter-name>
<url-pattern>Some url-pattern</url-pattern>
</filter-mapping>
<context-param>
<param-name>Some Param Name</param-name>
<param-value>Some Param Value</param-value>
</context-param>
<servlet>
<servlet-name>Some Servlet Name</servlet-name>
<servlet-class>Some Servlet Class</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Some Servlet Name</servlet-name>
<url-pattern>Some Url Pattern</url-pattern> …Run Code Online (Sandbox Code Playgroud)我的应用程序和Tomcat 7存在很大问题.我的应用程序需要将会话cookie设置为"/"路径而不是"/ context"路径.在tomcat 6中,它是向Connector添加另一个属性的问题(emptySessionPath ="true"),Tomcat 7无法识别此事.我知道Servlet 3.0规范允许在每个上下文的基础上配置它,但我无法使它与Tomcat 7一起使用.它仍然添加了上下文路径而不是"/".
我将非常感谢收到如何做到这一点.
我正在尝试使用Tomcat 7.0.22中的管理器应用程序登录Mac OS X 10.7.这是我得到的错误:http://f.cl.ly/items/421q1K3f1i0X1H1M181v/so.tiff
401 Unauthorized
You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.
For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
Run Code Online (Sandbox Code Playgroud)
我已经在我的tomcat-users.xml中添加了这个,仍然没有使用相同的用户名/密码.
<tomcat-users> …Run Code Online (Sandbox Code Playgroud) 我正在使用Tomcat 7 for Spring和JPA Application,数据库MySQL.一切都工作正常.但有时realm.LockOutRealm验证问题将出现.我还在我的应用程序中使用了连接池,如:
persistence.xml中:
<properties>
<property name="hibernate.connection.username" value="---"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.password" value="----------"/>
<property name="hibernate.connection.url" value="jdbc:mysql://----------?autoReconnect=true"/>
<!--Connection Pooling c3p0 configuration-->
<!--Minimum number of JDBC connections in the pool. Hibernate default: 1-->
<property name="hibernate.c3p0.min_size" value="5"/>
<!--Maximum number of JDBC connections in the pool. Hibernate default: 100-->
<property name="hibernate.c3p0.max_size" value="20"/>
<!--When an idle connection is removed from the pool (in second). Hibernate default: 0, never expire.-->
<property name="hibernate.c3p0.timeout" value="300"/>
<!--Number of prepared statements will be cached. Increase performance. Hibernate …Run Code Online (Sandbox Code Playgroud) tomcat7 ×10
java ×3
tomcat ×2
catalina ×1
eclipse ×1
el ×1
jar ×1
jsf-2 ×1
manager-app ×1
maven ×1
maven-3 ×1
maven-plugin ×1
osx-lion ×1
servlet-3.0 ×1
servlets ×1
spring ×1
spring-boot ×1
spring-mvc ×1
terminal ×1
web-services ×1
web.xml ×1