Tomcat部署的战争没有部署在JBoss上

时间:2018-03-08 05:24:11

标签: spring-mvc tomcat jboss pom.xml war

我正在研究Spring MVC project。 它在Tomcat服务器(apache-tomcat-7.0.85)上本地部署,没有任何问题。 但我的主管要求我在JBoss服务器上部署它,因为我们公司在生产级别使用JBoss服务器。 因此,我尝试在本地将它部署在JBoss服务器上,但它运行不正常。

我的网址(http://localhost:8080/MCloudServices-1.0/test)给出了404错误。 问题是服务器日志中没有任何错误。

是否存在任何版本错误或者在将Tomcat移动到JBoss时我是否需要执行一些配置更改?我在谷歌搜索这个,但无法找到任何解决方案。 我是Spring MVC的新手,希望找到解决方案。

我使用的Tomcat版本 - > Apache的Tomcat的7.0.85

我检查的JBoss版本 - > jboss-5.0.0.GA和jboss-6.1.0.Final

春季版 - > 4.1.9.RELEASE

此外,我附上了pom.xml和server.log

的server.log

=============================================================================== JBoss Bootstrap Environment JBOSS_HOME: C:\jboss-5.0.0.GA JAVA: C:\Program Files\Java\jdk1.8.0_144\bin\java JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 CLASSPATH: C:\jboss-5.0.0.GA\bin\run.jar =============================================================================== Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 10:02:21,850 INFO [ServerImpl] Starting JBoss (Microcontainer)... 10:02:21,850 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.0.GA (build: SVNTag=JBoss_5_0_0_GA date=200812041714) 10:02:21,850 INFO [ServerImpl] Bootstrap URL: null 10:02:21,850 INFO [ServerImpl] Home Dir: C:\jboss-5.0.0.GA 10:02:21,850 INFO [ServerImpl] Home URL: file:/C:/jboss-5.0.0.GA/ 10:02:21,850 INFO [ServerImpl] Library URL: file:/C:/jboss-5.0.0.GA/lib/ 10:02:21,850 INFO [ServerImpl] Patch URL: null 10:02:21,850 INFO [ServerImpl] Common Base URL: file:/C:/jboss-5.0.0.GA/common/ 10:02:21,850 INFO [ServerImpl] Common Library URL: file:/C:/jboss-5.0.0.GA/common/lib/ 10:02:21,850 INFO [ServerImpl] Server Name: default 10:02:21,850 INFO [ServerImpl] Server Base Dir: C:\jboss-5.0.0.GA\server 10:02:21,865 INFO [ServerImpl] Server Base URL: file:/C:/jboss-5.0.0.GA/server/ 10:02:21,865 INFO [ServerImpl] Server Config URL: file:/C:/jboss-5.0.0.GA/server/default/conf/ 10:02:21,865 INFO [ServerImpl] Server Home Dir: C:\jboss-5.0.0.GA\server\default 10:02:21,865 INFO [ServerImpl] Server Home URL: file:/C:/jboss-5.0.0.GA/server/default/ 10:02:21,865 INFO [ServerImpl] Server Data Dir: C:\jboss-5.0.0.GA\server\default\data 10:02:21,865 INFO [ServerImpl] Server Library URL: file:/C:/jboss-5.0.0.GA/server/default/lib/ 10:02:21,865 INFO [ServerImpl] Server Log Dir: C:\jboss-5.0.0.GA\server\default\log 10:02:21,865 INFO [ServerImpl] Server Native Dir: C:\jboss-5.0.0.GA\server\default\tmp\native 10:02:21,865 INFO [ServerImpl] Server Temp Dir: C:\jboss-5.0.0.GA\server\default\tmp 10:02:21,865 INFO [ServerImpl] Server Temp Deploy Dir: C:\jboss-5.0.0.GA\server\default\tmp\deploy 10:02:22,214 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/C:/jboss-5.0.0.GA/server/default/conf/bootstrap.xml 10:02:22,487 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.IterableTimedVFSCache] 10:02:22,487 INFO [VFSCacheFactory] Using VFSCache [IterableTimedVFSCache{lifetime=1800, resolution=60}] 10:02:22,643 INFO [CopyMechanism] VFS temp dir: C:\jboss-5.0.0.GA\server\default\tmp 10:02:22,643 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled. 10:02:23,574 INFO [ServerInfo] Java version: 1.8.0_144,Oracle Corporation 10:02:23,574 INFO [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 25.144-b01,Oracle Corporation 10:02:23,574 INFO [ServerInfo] OS-System: Windows 10 10.0,amd64 10:02:23,590 INFO [JMXKernel] Legacy JMX core initialized 10:02:24,973 INFO [ProfileServiceImpl] Loading profile: default from: org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@61842590(root=C:\jboss-5.0.0.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]) 10:02:24,973 INFO [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@61842590(root=C:\jboss-5.0.0.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]) 10:02:24,973 INFO [ProfileServiceImpl] Loaded profile: ProfileImpl@1619ca3d{key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]} 10:02:29,452 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/ 10:02:33,786 INFO [NativeServerConfig] JBoss Web Services - Stack Native Core 10:02:33,786 INFO [NativeServerConfig] 3.0.4.SP1 10:02:44,016 INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1090/jmxconnector 10:05:46,163 INFO [MailService] Mail Service bound to java:/Mail 10:05:47,141 WARN [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this. 10:05:47,141 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent 10:05:47,251 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc. 10:05:47,251 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer 10:05:47,440 INFO [TransactionManagerService] Initializing recovery manager 10:05:47,520 INFO [TransactionManagerService] Recovery manager configured 10:05:47,521 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference 10:05:47,546 INFO [TransactionManagerService] Starting transaction recovery manager 10:05:47,952 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080 10:05:47,952 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009 10:05:47,952 INFO [StandardService] Starting service jboss.web 10:05:47,952 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.1.GA 10:05:47,968 INFO [Catalina] Server startup in 58 ms 10:05:47,984 INFO [TomcatDeployment] deploy, ctxPath=/web-console, vfsUrl=management/console-mgr.sar/web-console.war 10:05:48,958 INFO [TomcatDeployment] deploy, ctxPath=/jbossws, vfsUrl=jbossws.sar/jbossws-management.war 10:05:48,989 INFO [TomcatDeployment] deploy, ctxPath=/invoker, vfsUrl=http-invoker.sar/invoker.war 10:05:49,228 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml 10:05:49,321 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml 10:05:49,384 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml 10:05:49,531 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml 10:05:49,594 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.0.0.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml 10:05:49,672 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main 10:05:49,688 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created. 10:05:49,688 INFO [RAMJobStore] RAMJobStore initialized. 10:05:49,688 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties' 10:05:49,688 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2 10:05:49,688 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started. 10:05:50,047 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS' 10:05:50,464 WARN [QuartzTimerServiceFactory] sql failed: CREATE TABLE QRTZ_JOB_DETAILS(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, DESCRIPTION VARCHAR(120) NULL, JOB_CLASS_NAME VARCHAR(128) NOT NULL, IS_DURABLE VARCHAR(1) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, IS_STATEFUL VARCHAR(1) NOT NULL, REQUESTS_RECOVERY VARCHAR(1) NOT NULL, JOB_DATA BINARY NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP)) 10:05:50,480 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main 10:05:50,480 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created. 10:05:50,480 INFO [JobStoreCMT] Using db table-based data access locking (synchronization). 10:05:50,480 INFO [JobStoreCMT] Removed 0 Volatile Trigger(s). 10:05:50,480 INFO [JobStoreCMT] Removed 0 Volatile Job(s). 10:05:50,480 INFO [JobStoreCMT] JobStoreCMT initialized. 10:05:50,480 INFO [StdSchedulerFactory] Quartz scheduler 'JBossEJB3QuartzScheduler' initialized from an externally provided properties instance. 10:05:50,495 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2 10:05:50,495 INFO [JobStoreCMT] Freed 0 triggers from 'acquired' / 'blocked' state. 10:05:50,495 INFO [JobStoreCMT] Recovering 0 jobs that were in-progress at the time of the last shut-down. 10:05:50,495 INFO [JobStoreCMT] Recovery complete. 10:05:50,495 INFO [JobStoreCMT] Removed 0 'complete' triggers. 10:05:50,495 INFO [JobStoreCMT] Removed 0 stale fired job entries. 10:05:50,495 INFO [QuartzScheduler] Scheduler JBossEJB3QuartzScheduler_$_NON_CLUSTERED started. 10:05:50,707 INFO [ServerPeer] JBoss Messaging 1.4.1.GA server [0] started 10:05:50,754 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000 10:05:50,769 WARN [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover 10:05:50,769 WARN [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing 10:05:50,801 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds 10:05:50,801 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@cbd98e3 started 10:05:50,801 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds 10:05:50,801 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@2d3a34ff started 10:05:50,801 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000 10:05:50,801 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds 10:05:50,801 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@21fff299 started 10:05:50,847 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA' 10:05:52,424 INFO [TomcatDeployment] deploy, ctxPath=/MCloudServices-1.0, vfsUrl=MCloudServices-1.0.war 10:05:52,492 WARN [config] Unable to process deployment descriptor for context '/MCloudServices-1.0' 10:05:52,795 INFO [TomcatDeployment] deploy, ctxPath=/, vfsUrl=ROOT.war 10:05:52,888 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console, vfsUrl=jmx-console.war 10:05:52,942 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080 10:05:52,952 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009 10:05:52,983 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.GA (build: SVNTag=JBoss_5_0_0_GA date=200812041714)] Started in 3m:31s:118ms

的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>MCloudServices</groupId>
  <artifactId>MCloudServices</artifactId>
  <version>1.0</version>
  <packaging>war</packaging>

  <build>

    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
    </plugins>
  </build>
    <properties>
        <springframework.version>4.1.9.RELEASE</springframework.version>
        <hibernate.version>4.3.6.Final</hibernate.version>
        <mysql.connector.version>5.0.4</mysql.connector.version>
        <joda-time.version>2.3</joda-time.version>
        <testng.version>6.9.4</testng.version>                         
    </properties>
    <dependencies>
  <!-- Spring -->

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${springframework.version}</version>
        </dependency>

        <!-- Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>

        <!-- jsr303 validation -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.1.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.1.3.Final</version>
        </dependency>

        <!-- MySQL -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.connector.version}</version>
        </dependency>

        <!-- Joda-Time -->       
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
        </dependency>

        <!-- To map JodaTime with database type -->      
        <dependency>
            <groupId>org.jadira.usertype</groupId>
            <artifactId>usertype.core</artifactId>
            <version>3.0.0.CR1</version>
        </dependency>

        <!-- Servlet+JSP+JSTL -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>


        <!-- Testing dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${springframework.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Json dependency -->
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20180130</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.5.3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.5</version>
        </dependency>   
  </dependencies>
</project>

1 个答案:

答案 0 :(得分:0)

尝试在$a = Test 3 $a | ft Value Name ----- ---- 3 Name3 3 Name3 3 Name3 文件夹下放置jboss-web.xml

WEB-INF