2015-04-03 104 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

相关问题