无法编译的源代码

时间:2016-12-19 20:21:27

标签: java netbeans payara

当我在payara中部署我的应用程序时,它给了我这个错误可以帮助我附上代码,让我知道如何解决它

Caused by: java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>
at gt.gob.mp.siamp.rrhh.business.ejb.ws.config.RestWsConfig.addRestResourceClasses(RestWsConfig.java:30)
at gt.gob.mp.siamp.rrhh.business.ejb.ws.config.RestWsConfig.getClasses(RestWsConfig.java:23)
at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig$3.run(ResourceConfig.java:1234)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
@ApplicationPath("/rest")
public class RestWsConfig extends Application {

    private static final Logger log = Logger.getLogger(RestWsConfig.class);

    @Override
    public Set<Class<?>> getClasses() {

        try {
            log.debug("Loading rest config");
            Set<Class<?>> resources = new java.util.HashSet<>();
            addJsonProvider(resources);
            addRestResourceClasses(resources);
            return resources;
        } catch (Exception ex) {
            return null;
        }
    }

    private void addRestResourceClasses(Set<Class<?>> resources) {
        //resources.add(gt.gob.mp.siamp.mailer.business.ejb.ws.MailerWs.class);
        resources.add(gt.gob.mp.siamp.rrhh.ejb.cto.IContratosService.class);
        log.debug("rest resources added");
    }

    private void addJsonProvider(Set<Class<?>> resources) {
        try {
            //Class jsonProvider = Class.forName("org.glassfish.jersey.jackson.JacksonFeature");
            Class jsonProvider = Class.forName("org.glassfish.jersey.moxy.json.MoxyJsonFeature");
            // Class jsonProvider = Class.forName("org.glassfish.jersey.jettison.JettisonFeature");
            resources.add(jsonProvider);
            log.debug("JSon provider added");
        } catch (ClassNotFoundException ex) {
            log.error(ex);
        }
    }
}

0 个答案:

没有答案