1. java
  2. android
  3. c#
  4. .net
  5. javascript
  6. php
  7. jquery
  8. html
  9. sql

Vraptor 4, java 8 e glassfish 4.1 - Erro ao reimplantar Parameters aren't present for gravar. You must compile your code with -parameters argument.

Boa tarder pessoal

Estou com problemas em rodar o vraptor 4 como java 8, o glassfish 4.1 e o netbeans 8.0.2. Quando iniciei o projeto eu vi que era necessário adicionar a biblioteca vraptor-java8 e fazer o build com o parametro -parameters. Se eu fizer o build e iniciar o projeto, funciona normalmente, mas se eu alterar uma classe com o servidor ativo, no processo de reimplantar, da o erro:

Caused by: java.lang.AssertionError: Parameters aren't present for gravar. You must compile your code with -parameters argument.
    at br.com.caelum.vraptor.http.JavaParameterNameProvider.checkIfNameIsPresent(JavaParameterNameProvider.java:70)
    at br.com.caelum.vraptor.http.JavaParameterNameProvider.parametersFor(JavaParameterNameProvider.java:55)
    at br.com.caelum.vraptor.http.JavaParameterNameProvider$Proxy$_$$_WeldClientProxy.parametersFor(Unknown Source)
    at br.com.caelum.vraptor.http.route.DefaultTypeFinder.getParameterTypes(DefaultTypeFinder.java:57)
    at br.com.caelum.vraptor.http.route.DefaultTypeFinder$Proxy$_$$_WeldClientProxy.getParameterTypes(Unknown Source)
    at br.com.caelum.vraptor.http.route.DefaultRouteBuilder.addParametersInfo(DefaultRouteBuilder.java:196)
    at br.com.caelum.vraptor.http.route.DefaultRouteBuilder.is(DefaultRouteBuilder.java:185)
    at br.com.caelum.vraptor.http.route.PathAnnotationRoutesParser.registerRulesFor(PathAnnotationRoutesParser.java:117)
    at br.com.caelum.vraptor.http.route.PathAnnotationRoutesParser.rulesFor(PathAnnotationRoutesParser.java:91)
    at br.com.caelum.vraptor.http.route.PathAnnotationRoutesParser$Proxy$_$$_WeldClientProxy.rulesFor(Unknown Source)
    at br.com.caelum.vraptor.ioc.ControllerHandler.handle(ControllerHandler.java:66)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90)

No meu pom.xml eu adicionei o -parameters como pode ser visto abaixo:

<?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>br.com.tebosoftware</groupId>
    <artifactId>TeboERP</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>TeboERP</name>

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

    <dependencies>
        <dependency>
            <groupId>br.com.caelum</groupId>
            <artifactId>vraptor</artifactId>
            <version>4.1.4</version>
        </dependency>
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <version>2.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.20.0-GA</version>
        </dependency>
        <dependency>
            <groupId>br.com.caelum.vraptor</groupId>
            <artifactId>vraptor-java8</artifactId>
            <version>4.0.0.Final</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.4.8</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.3.11.Final</version>
        </dependency>
        <dependency>
            <groupId>br.com.caelum.vraptor</groupId>
            <artifactId>vraptor-simple-validator</artifactId>
            <version>4.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>    
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</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>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

Alguém sabe resolver este problema?

grato

  1. Você vai ver essas setas em qualquer página de pergunta. Com elas, você pode dizer se uma pergunta ou uma resposta foram relevantes ou não.
  2. Edite sua pergunta ou resposta caso queira alterar ou adicionar detalhes.
  3. Caso haja alguma dúvida sobre a pergunta, adicione um comentário. O espaço de respostas deve ser utilizado apenas para responder a pergunta.
  4. Se o autor da pergunta marcar uma resposta como solucionada, esta marca aparecerá.
  5. Clique aqui para mais detalhes sobre o funcionamento do GUJ!

0 resposta

Não é a resposta que estava procurando? Procure outras perguntas com as tags vraptor java8 glassfish netbeans ou faça a sua própria pergunta.