2013-04-11 89 views
1

我有一个我曾经在Tomcat Server Application 7.0中运行的项目。现在我必须将它迁移到Jboss 5.1。将Tomcat项目迁移到Jboss并在NetBeans中配置JBoss AS

我必须在我的项目中更改什么配置?

这里是我的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>com.labcon</groupId> 
<artifactId>Catalogo2</artifactId> 
<version>1.0-SNAPSHOT</version> 
<packaging>war</packaging> 

<name>Catalogo2</name> 

<properties> 
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
</properties> 

    <repositories> 


    <repository> 
     <url>http://download.java.net/maven/2/</url> 
     <id>jsf20</id> 
     <layout>default</layout> 
     <name>Repository for library Library[jsf20]</name> 
    </repository> 
    <repository> 
     <url>http://repo1.maven.org/maven2/</url> 
     <id>jstl11</id> 
     <layout>default</layout> 
     <name>Repository for library Library[jstl11]</name> 
    </repository> 
    <repository> 
     <id>prime-repo</id> 
     <name>PrimeFaces Maven Repository</name> 
     <url>http://repository.primefaces.org</url> 
     <layout>default</layout> 
    </repository> 


     <repository> 
      <releases> 
      <enabled>false</enabled> 
     </releases> 
     <snapshots> 
      <enabled>true</enabled> 
     </snapshots> 
     <id>apache.snapshots</id> 
     <name>Apache Snapshot Repository</name> 
     <url>https://repository.apache.org/content/repositories/snapshots</url> 
    </repository> 
</repositories> 

<dependencies> 

<dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>jstl</artifactId> 
    <version>1.2</version> 
</dependency> 

<dependency> 
    <groupId>javax.persistence</groupId> 
    <artifactId>persistence-api</artifactId> 
    <version>1.0</version> 
</dependency> 

<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-core</artifactId> 
    <version>3.1.2.RELEASE</version> 
</dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-expression</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-beans</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-aop</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-context</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-context-support</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-tx</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-jdbc</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-orm</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-web</artifactId> 
    <version>3.1.2.RELEASE</version> 
    </dependency> 

    <dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-entitymanager</artifactId> 
    <version>3.3.2.GA</version> 
    </dependency> 

    <dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate-validator</artifactId> 
    <version>4.0.2.GA</version> 
    </dependency> 

    <dependency> 
    <groupId>mysql</groupId> 
    <artifactId>mysql-connector-java</artifactId> 
    <version>5.1.15</version> 
    </dependency> 

    <dependency> 
    <groupId>cglib</groupId> 
    <artifactId>cglib-nodep</artifactId> 
    <version>2.2.2</version> 
    </dependency> 

    <dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-api</artifactId> 
    <version>1.6.1</version> 
    </dependency> 

    <dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-simple</artifactId> 
    <version>1.6.1</version> 
    </dependency> 

    <dependency> 
    <groupId>asm</groupId> 
    <artifactId>asm-commons</artifactId> 
    <version>3.1</version> 
    </dependency> 

    <dependency> 
    <groupId>junit</groupId> 
    <artifactId>junit</artifactId> 
    <version>4.10</version> 
    <scope>test</scope> 
    </dependency> 

    <dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>hibernate</artifactId> 
    <version>3.2.5.ga</version> 
    </dependency> 

    <dependency> 
    <groupId>org.hibernate</groupId> 
    <artifactId>ejb3-persistence</artifactId> 
    <version>1.0.1.GA</version> 
    </dependency> 

    <dependency> 
    <groupId>javax.sql</groupId> 
    <artifactId>jdbc-stdext</artifactId> 
    <version>2.0</version> 
    </dependency> 

    <dependency> 
    <groupId>javax.transaction</groupId> 
    <artifactId>jta</artifactId> 
    <version>1.0.1B</version> 
    </dependency> 

<dependency> 
    <groupId>org.primefaces</groupId> 
    <artifactId>primefaces</artifactId> 
    <version>3.4.1</version> 
</dependency> 

    <dependency> 
    <groupId>org.primefaces.themes</groupId> 
    <artifactId>all-themes</artifactId> 
    <version>1.0.9</version> 
    </dependency> 

    <dependency> 
    <groupId>commons-fileupload</groupId> 
<artifactId>commons-fileupload</artifactId> 
<version>1.2.3-SNAPSHOT</version> 
    </dependency> 

<dependency> 
<groupId>commons-io</groupId> 
<artifactId>commons-io</artifactId> 
<version>2.5-SNAPSHOT</version> 
</dependency> 
<dependency> 
<groupId>rome</groupId> 
<artifactId>rome</artifactId> 
<version>1.0</version> 
</dependency> 
<dependency> 
<groupId>org.apache.poi</groupId> 
<artifactId>poi</artifactId> 
<version>3.7</version> 
</dependency> 
<dependency> 
<groupId>com.lowagie</groupId> 
<artifactId>itext</artifactId> 
<version>2.0.7</version> 
</dependency> 
    <dependency> 
     <groupId>javax</groupId> 
     <artifactId>javaee-api</artifactId> 
     <version>6.0</version> 
     <type>jar</type> 
    </dependency> 
    <dependency> 
     <groupId>javax</groupId> 
     <artifactId>javaee-web-api</artifactId> 
     <version>6.0</version> 
     <type>jar</type> 
    </dependency> 

</dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3.2</version> 
       <configuration> 
        <source>1.6</source> 
       <target>1.6</target> 
       <compilerArguments> 
        <endorseddirs>${endorsed.dir}</endorseddirs> 
       </compilerArguments> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.1.1</version> 
      <configuration> 
       <failOnMissingWebXml>false</failOnMissingWebXml> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.1</version> 
      <executions> 
       <execution> 
        <phase>validate</phase> 
        <goals> 
         <goal>copy</goal> 
        </goals> 
        <configuration> 
         <outputDirectory>${endorsed.dir}</outputDirectory> 
         <silent>true</silent> 
         <artifactItems> 
          <artifactItem> 
           <groupId>javax</groupId> 
           <artifactId>javaee-endorsed-api</artifactId> 
           <version>6.0</version> 
           <type>jar</type> 
          </artifactItem> 
         </artifactItems> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
    </build> 

这里是我的web.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="3.0" 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_3_0.xsd"> 


<context-param> 
    <param-name>javax.faces.PROJECT_STAGE</param-name> 
    <param-value>Development</param-value> 
</context-param> 
<servlet> 
    <servlet-name>Faces Servlet</servlet-name> 
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>/faces/*</url-pattern> 
</servlet-mapping> 

<servlet> 
    <servlet-name> 
     Resource Servlet 
    </servlet-name> 
    <servlet-class> 
     org.primefaces.resource.ResourceServlet 
    </servlet-class> 
</servlet> 

<session-config> 
    <session-timeout> 
     30 
    </session-timeout> 
</session-config> 

<welcome-file-list> 
    <welcome-file>faces/index.xhtml</welcome-file> 
</welcome-file-list> 

<context-param> 
    <param-name>primefaces.THEME</param-name> 
    <param-value>bootstrap</param-value> 
</context-param> 

<filter>  
    <filter-name>PrimeFaces FileUpload Filter</filter-name>  
    <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class> 
</filter> 

<filter-mapping>  
    <filter-name>PrimeFaces FileUpload Filter</filter-name> 
    <servlet-name>Faces Servlet</servlet-name> 
</filter-mapping> 

另一个问题是,我安装JBoss 5.1,并成功地在NetBeans中运行分离,但是当我选择运行该项目时,选项:JBoss不会出现在我的面前。

+0

请,我需要这个快速回答 – 2013-04-11 01:15:40

回答

1

因此,这里是你的“快”的答案;-)

我们是2岁以上的和JBoss AS 5是由JBoss应用服务器7 obsolted和WildFly 8 所以我认为今天的读者希望迁移到这一点。

有两个工具,其与迁移帮助到JBoss AS 7/8 WildFly/EAP 6:

1)JBoss SwanLoom - 自动化迁移工具旨在服务器配置迁移。

2)JBoss WindUp - 报告工具的目的是应用迁移 - 部署描述符等

最后,有一个新的网站,致力于到JBoss迁移:http://www.jboss.org/migration/,在那里你可以找到所有的迁移指南进行迁移手动。

关于pom.xml,你将不得不将所有已经包含在JBoss AS中的代码踢出去。 API可能会保留,但只能作为编译时间依赖性(不应该在.war中结束)。

根据您希望迁移的程度,您可能还想完全删除Spring并将其替换为JBoss AS提供的服务,并使用CDI注释连接您的应用程序的某些部分。

关于JBoss应用服务器在NetBeans中,有内置的支持AS 5岁,因为6.x的,至少,自7.3.1,它也应该支持AS 7