1

Glassfish 4.0 の最新のプロモート ビルドを使用して、特に単純なテスト ケースを実行しようとしています。META-INF/beans.xml を、WEB-INF/lib の独自の jar を含むすべての可能な順列に配置しようとしました

私が得る最高のものは、その後にリストされているレイアウト+ソースを含む次のエラーです:

WARNING: Error while trying to load Bean Class WEB-INF.classes.com.example.cdibug.Test : java.lang.ClassNotFoundException: WEB-INF.classes.com.example.cdibug.Test
WARNING: Error while trying to load Bean Class WEB-INF.classes.com.example.cdibug.Foo : java.lang.ClassNotFoundException: WEB-INF.classes.com.example.cdibug.Foo
WARNING: Error while trying to load Bean Class WEB-INF.classes.com.example.cdibug.App : java.lang.ClassNotFoundException: WEB-INF.classes.com.example.cdibug.App
INFO: Registering the Jersey servlet application, named com.example.cdibug.App, at the servlet mapping /rest/*, with the Application class of the same name.
INFO: Loading application [cdibug] at [/cdibug]
INFO: cdibug was successfully deployed in 106 milliseconds.

レイアウト:

$ jar tvf cdibug.war 
     0 Tue May 07 23:19:48 HST 2013 META-INF/
    68 Tue May 07 23:19:48 HST 2013 META-INF/MANIFEST.MF
     0 Tue May 07 23:14:20 HST 2013 META-INF/beans.xml
     0 Tue May 07 23:19:32 HST 2013 WEB-INF/
     0 Tue May 07 23:18:58 HST 2013 WEB-INF/classes/
     0 Tue May 07 22:51:54 HST 2013 WEB-INF/classes/com/
     0 Tue May 07 22:51:54 HST 2013 WEB-INF/classes/com/example/
     0 Tue May 07 23:09:34 HST 2013 WEB-INF/classes/com/example/cdibug/
   174 Tue May 07 22:54:28 HST 2013 WEB-INF/classes/com/example/cdibug/Test.java
   171 Tue May 07 22:54:04 HST 2013 WEB-INF/classes/com/example/cdibug/App.java
   309 Tue May 07 22:56:30 HST 2013 WEB-INF/classes/com/example/cdibug/Foo.java
   398 Tue May 07 23:06:00 HST 2013 WEB-INF/classes/com/example/cdibug/Test.class
   304 Tue May 07 23:06:00 HST 2013 WEB-INF/classes/com/example/cdibug/App.class
   634 Tue May 07 23:06:00 HST 2013 WEB-INF/classes/com/example/cdibug/Foo.class
$

のソースbeans.xml:

$ cat META-INF/beans.xml # EMPTY 0 bytes

のソースApp.java:

$ cat WEB-INF/classes/com/example/cdibug/App.java 
package com.example.cdibug;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("/rest")
public class App extends Application {
}

のソースTest.java:

$ cat WEB-INF/classes/com/example/cdibug/Test.java 
package com.example.cdibug;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/test")
public class Test {
  @GET
  public String greet () {
    return "hello";
  }
}

のソースFoo.java:

$ cat WEB-INF/classes/com/example/cdibug/Foo.java 
package com.example.cdibug;

import java.util.logging.Logger;

import javax.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class Foo {
  public Foo () {
    System.out.println("stdout: Foo()");
    System.err.println("stderr: Foo()");
    Logger.getGlobal().info("global_log: Foo()");
  }
}
4

1 に答える 1