2015-04-03 108 views
6

我有一個由春季啓動應用程序不Glassfish上部署4.1

<?xml version="1.0" encoding="UTF-8"?> 
<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>xxx.alexius</groupId> 
    <artifactId>myapp</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>war</packaging> 

    <name>my app</name> 
<description>Core Application Platform</description> 
<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.2.2.RELEASE</version> 
    <relativePath/> <!-- lookup parent from repository --> 
</parent> 
<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <java.version>1.7</java.version> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-mongodb</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-mobile</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-security</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-social-facebook</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-social-twitter</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-thymeleaf</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.postgresql</groupId> 
     <artifactId>postgresql</artifactId> 
     <version>9.4-1201-jdbc41</version> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.2</version> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
       <compilerArgument>-Xlint:all</compilerArgument> 
       <showWarnings>true</showWarnings> 
       <showDeprecation>true</showDeprecation> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

當我部署此到Tomcat一切工作正常,但當下面的pom.xml的香草春天啓動的應用程序我嘗試在GlassFish 4.1服務器上部署此工具我收到以下錯誤

SEVERE: Class [ liquibase/integration/spring/SpringLiquibase ] not found. Error while loading [ class org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration ] 
SEVERE: Exception while deploying the app [platform] 
SEVERE: Exception during lifecycle processing 
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy 

有什麼想法出錯?它是Spring還是Glassfish錯誤?

+0

是http://mvnrepository.com/artifact/org.liquibase/liquibase-核心/ 3.2.2在你的類路徑? – px5x2 2015-04-03 11:48:59

+0

那麼它不是它的我的朋友,所以可能不是,但春季啓動應該有其所需的所有依賴項。項目的其餘部分只是一個空的項目,沒有額外的代碼。只需要部署它沒有功能,所以我可以開始工作。 – 2015-04-03 11:56:26

+0

執行mvn dependency:tree來查看liquibase是否在你的類路徑中。 – px5x2 2015-04-03 11:57:45

回答

7

看起來這Glassfish的一個錯誤:GLASSFISH-21265

你可以嘗試繞過,通過在你的web.xml添加metadata-complete="true"這樣的:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="3.1" 
     metadata-complete="true" 
     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"> 
</web-app> 

將元數據的完整=「真「表示 /WEB-INF/lib中的JAR文件不需要掃描Servlet 3.0特定的 批註,但webapp自己的類仍將被掃描。

參見:

+0

我可以驗證這個作品。謝謝! – Bane 2015-11-19 19:04:21

相關問題