struts2.1+hibernate3.3+spring 3.0+jboss 6.0
s2sh部署到tomcat正常 但在jboss下面报404错误
自己新建了个项目 发布到jboss下是可以正常查看页面的
s2sh的applicationContext.xml文件如下
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver">
</property>
<property name="url" value="jdbc:mysql://localhost:3306/db_eshop">
</property>
<property name="username" value="root"></property>
<property name="password" value="58904879"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
</bean>
</beans>web.xml
<?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:/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GB2312</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--Spring的ApplicationContext 载入 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring 刷新Introspector防止内存泄露 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
网上说jta包和jboss冲突 但是我测试下 还是404错误。
s2sh部署到tomcat正常 但在jboss下面报404错误
自己新建了个项目 发布到jboss下是可以正常查看页面的
s2sh的applicationContext.xml文件如下
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver">
</property>
<property name="url" value="jdbc:mysql://localhost:3306/db_eshop">
</property>
<property name="username" value="root"></property>
<property name="password" value="58904879"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
</bean>
</beans>web.xml
<?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:/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GB2312</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--Spring的ApplicationContext 载入 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Spring 刷新Introspector防止内存泄露 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
网上说jta包和jboss冲突 但是我测试下 还是404错误。
解决方案 »
- 富文本控件怎么把数据存放到数据库中????
- 大家有用visio的没?哪个版本比较好用?给个下载地址,谢谢
- 奇怪的checkbox 问题
- 请问,访问一个机子的IP就可以访问到tomcat下的项目
- ServletContext对象和jsp中的作用域对象有什么联系?
- 请教一下各位大侠
- 哪个web压力测试的工具最牛(最好还有极强的性能测试功能)?
- 仅仅给喜欢Java的人,非Java人员莫入
- 关于JSP连接SQL SERVER的问题-无法建立连接(100分!!)
- 在javabean中如何实现级联删除?
- 今天姐去面试了,笔试的时候遇到这样一道题目,该怎么做呢?
- Response already committed是什么原因啊
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts></struts>
404一般是没有找到资源,应该是你application部署失败了;
你运行Jboss时会产生日志信息,找下提示的错误信息看是什么问题;
建议你先直接从tomcat下把应用copy到jboss下,再运行jboss,测试下是不是jar冲突的问题;
2011-12-02 15:36:19,453 ERROR [ProfileServiceBootstrap] (Thread-2) Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "AdminConsoleActivator" is missing the following dependencies:
Dependency "WebServer" (should be in state "Installed", but is actually in state "Configured")
Deployment "CachedConnectionManager" is missing the following dependencies:
Dependency "TransactionManager" (should be in state "Installed", but is actually in state "Instantiated")
Deployment "DefaultUserTransactionprovider" is missing the following dependencies:
Dependency "<UNKNOWN DefaultUserTransactionprovider>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'TransactionManager' **")
Deployment "JBossTransactionServices" is missing the following dependencies:
Dependency "TransactionManager" (should be in state "Installed", but is actually in state "Instantiated")
Deployment "JBossWSConsoleActivator" is missing the following dependencies:
Dependency "WebServer" (should be in state "Installed", but is actually in state "Configured")
Deployment "JmxConsoleActivator" is missing the following dependencies:
Dependency "WebServer" (should be in state "Installed", but is actually in state "Configured")
Deployment "ModClusterListener" is missing the following dependencies:
Dependency "WebServer" (should be in state "Create", but is actually in state "Configured")
Deployment "ObjectStoreBrowserBean" is missing the following dependencies:
Dependency "<UNKNOWN ObjectStoreBrowserBean>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'TransactionManager' **")
Deployment "RealTransactionManager" is missing the following dependencies:
Dependency "TransactionManager" (should be in state "Installed", but is actually in state "Instantiated")
Deployment "TransactionManager" is missing the following dependencies:
Dependency "XATerminator" (should be in state "Installed", but is actually in state "**ERROR**")
Deployment "UnifiedInvoker" is missing the following dependencies:
Dependency "TransactionManager" (should be in state "Create", but is actually in state "Instantiated")
Deployment "WebServer" is missing the following dependencies:
Dependency "jboss.jca:service=CachedConnectionManager" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:service=CachedConnectionManager' **")
Dependency "jboss:service=TransactionManager" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "WorkManager" is missing the following dependencies:
Dependency "TransactionManager" (should be in state "Installed", but is actually in state "Instantiated")
Deployment "jboss.ejb:persistencePolicy=database,service=EJBTimerService" is missing the following dependencies:
Dependency "jboss.jdbc:datasource=DefaultDS,service=metadata" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **")
Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
Deployment "jboss.ejb:service=EJBTimerService" is missing the following dependencies:
Dependency "jboss.ejb:persistencePolicy=database,service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss:service=TransactionManager" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "jboss.jca:name='jboss-local-jdbc.rar',service=RARDeployment" is missing the following dependencies:
Dependency "jboss:service=TransactionManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Dependency "jboss.jca:service=WorkManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.jca:service=WorkManager' **")
Deployment "jboss.jca:name='jboss-xa-jdbc.rar',service=RARDeployment" is missing the following dependencies:
Dependency "jboss.jca:service=WorkManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.jca:service=WorkManager' **")
Dependency "jboss:service=TransactionManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "jboss.jca:name='jms-ra.rar',service=RARDeployment" is missing the following dependencies:
Dependency "jboss.jca:service=WorkManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.jca:service=WorkManager' **")
Dependency "jboss:service=TransactionManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "jboss.jca:name='mail-ra.rar',service=RARDeployment" is missing the following dependencies:
Dependency "jboss.jca:service=WorkManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.jca:service=WorkManager' **")
Dependency "jboss:service=TransactionManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "jboss.jca:name='quartz-ra.rar',service=RARDeployment" is missing the following dependencies:
Dependency "jboss.jca:service=WorkManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.jca:service=WorkManager' **")
Dependency "jboss:service=TransactionManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "jboss.web.deployment:war=/ROOT" is missing the following dependencies:
Dependency "jboss.web:service=WebServer" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.web.deployment:war=/invoker" is missing the following dependencies:
Dependency "jboss.web:service=WebServer" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss.web.deployment:war=/t3" is missing the following dependencies:
Dependency "jboss.web:service=WebServer" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss:service=ClientUserTransaction" is missing the following dependencies:
Dependency "jboss:service=proxyFactory,target=ClientUserTransaction" (should be in state "Create", but is actually in state "Configured")
Dependency "jboss:service=proxyFactory,target=ClientUserTransactionFactory" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss:service=KeyGeneratorFactory,type=HiLo" is missing the following dependencies:
Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
Dependency "jboss:service=TransactionManager" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "jboss:service=invoker,type=local" is missing the following dependencies:
Dependency "jboss:service=TransactionManager" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss:service=TransactionManager' **")
Deployment "jboss:service=proxyFactory,target=ClientUserTransaction" is missing the following dependencies:
Dependency "jboss:service=invoker,type=unified" (should be in state "Create", but is actually in state "Configured")
Deployment "jboss:service=proxyFactory,target=ClientUserTransactionFactory" is missing the following dependencies:
Dependency "jboss:service=invoker,type=unified" (should be in state "Create", but is actually in state "Configured")
Deployment "vfs:///D:/jboss/server/default/deploy/hornetq/jms-ds.xml" is in error due to the following reason(s): java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/transaction/xa/XAResource"
Deployment "vfs:///D:/jboss/server/default/deploy/first.war" is in error due to the following reason(s): org.xml.sax.SAXException: cvc-datatype-valid.1.2.1: '2.2.3' is not a valid value for 'decimal'. @ vfs:///D:/jboss/server/default/deploy/first.war/WEB-INF/lib/struts2-core-2.1.8.1.jar/META-INF/struts-tags.tld[9,37]
Deployment "XATerminator" is in error due to the following reason(s): java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) previously initiated loading for a different type with name "javax/transaction/xa/Xid", **ERROR**
Deployment "vfs:///D:/jboss/server/default/deploy/test.war" is in error due to the following reason(s): org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'type'. One of '{"http://java.sun.com/xml/ns/javaee":rtexprvalue, "http://java.sun.com/xml/ns/javaee":deferred-value, "http://java.sun.com/xml/ns/javaee":deferred-method, "http://java.sun.com/xml/ns/javaee":fragment}' is expected. @ vfs:///D:/jboss/server/default/deploy/test.war/WEB-INF/lib/jsf-impl.jar/META-INF/html_basic.tld[1625,19]
Deployment "jboss.jdbc:datasource=DefaultDS,service=metadata" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **
Deployment "<UNKNOWN DefaultUserTransactionprovider>" is in error due to the following reason(s): ** UNRESOLVED Demands 'TransactionManager' **
Deployment "<UNKNOWN ObjectStoreBrowserBean>" is in error due to the following reason(s): ** UNRESOLVED Demands 'TransactionManager' **
Deployment "jboss.jca:service=WorkManager" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:service=WorkManager' **
Deployment "jboss:service=TransactionManager" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss:service=TransactionManager' **
Deployment "jboss.jca:name=DefaultDS,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **
Deployment "vfs:///D:/jboss/server/default/deploy/hsqldb-ds.xml" is in error due to the following reason(s): java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "javax/transaction/xa/XAResource"
Deployment "vfs:///D:/jboss/server/default/deploy/t2.war" is in error due to the following reason(s): org.xml.sax.SAXException: cvc-datatype-valid.1.2.1: '2.2.3' is not a valid value for 'decimal'. @ vfs:///D:/jboss/server/default/deploy/t2.war/WEB-INF/lib/struts2-core-2.1.8.1.jar/META-INF/struts-tags.tld[9,37]
Deployment "jboss:service=invoker,type=unified" is in error due to the following reason(s): Configured
Deployment "jboss.jca:service=CachedConnectionManager" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:service=CachedConnectionManager' **
Deployment "jboss.web:service=WebServer" is in error due to the following reason(s): Configured at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.2.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.2.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.1.0.Final]
at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.1.0.Final]
at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]
在myeclipse中新建一个项目 jboss里面是可以跑的。
你把D:/jboss/server/default/deploy/下的*.war 清理下,只保留Jboss自带的war和你自己的war来启动;