[webbeans-commits] Webbeans SVN: r3762 - in examples/trunk/jsf/numberguess: jetty and 4 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Sep 23 11:10:06 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-09-23 11:10:06 -0400 (Wed, 23 Sep 2009)
New Revision: 3762

Added:
   examples/trunk/jsf/numberguess/jetty/
   examples/trunk/jsf/numberguess/jetty/java/
   examples/trunk/jsf/numberguess/jetty/java/Start.java
Modified:
   examples/trunk/jsf/numberguess/pom.xml
   examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-env.xml
   examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml
   examples/trunk/jsf/numberguess/src/main/webapp-tomcat/META-INF/context.xml
   examples/trunk/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml
Log:
various fixes for jetty (not working)

Added: examples/trunk/jsf/numberguess/jetty/java/Start.java
===================================================================
--- examples/trunk/jsf/numberguess/jetty/java/Start.java	                        (rev 0)
+++ examples/trunk/jsf/numberguess/jetty/java/Start.java	2009-09-23 15:10:06 UTC (rev 3762)
@@ -0,0 +1,45 @@
+
+
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.bio.SocketConnector;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+public class Start {
+
+	public static void main(String[] args) throws Exception {
+		Server server = new Server();
+		SocketConnector connector = new SocketConnector();
+		connector.setPort(8080);
+		server.setConnectors(new Connector[] { connector });
+
+		WebAppContext bb = new WebAppContext();
+		bb.setServer(server);
+		bb.setContextPath("/");
+		bb.setWar("src/main/webapp");
+		bb.setDescriptor("src/main/webapp-jetty/WEB-INF/web.xml");
+		
+		// Disable for now
+//		Resource jettyEnv = Resource.newResource("src/main/webapp-jetty/WEB-INF/jetty-env.xml");
+//      if (jettyEnv.exists() && !jettyEnv.isDirectory())
+//      {
+//         XmlConfiguration configuration = new XmlConfiguration(jettyEnv.getURL());
+//         configuration.configure(bb);
+//      }
+		
+		server.addHandler(bb);
+
+		try {
+			System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
+			server.start();
+			while (System.in.available() == 0) {
+				Thread.sleep(500);
+			}
+			server.stop();
+			server.join();
+		} catch (Exception e) {
+			e.printStackTrace();
+			System.exit(100);
+		}
+	}
+}


Property changes on: examples/trunk/jsf/numberguess/jetty/java/Start.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + text/plain

Modified: examples/trunk/jsf/numberguess/pom.xml
===================================================================
--- examples/trunk/jsf/numberguess/pom.xml	2009-09-23 11:19:41 UTC (rev 3761)
+++ examples/trunk/jsf/numberguess/pom.xml	2009-09-23 15:10:06 UTC (rev 3762)
@@ -148,6 +148,7 @@
             </plugins>
          </build>
       </profile>
+      
       <profile>
          <id>jetty</id>
          <dependencies>
@@ -192,6 +193,77 @@
             </plugins>
          </build>
       </profile>
+      
+      <profile>
+         <id>jetty-ide</id>
+         <dependencies>
+         
+            <dependency>
+               <groupId>javax.annotation</groupId>
+               <artifactId>jsr250-api</artifactId>
+            </dependency>
+
+            <dependency>
+               <groupId>javax.faces</groupId>
+               <artifactId>jsf-api</artifactId>
+            </dependency>
+            
+            <dependency>
+               <groupId>javax.faces</groupId>
+               <artifactId>jsf-impl</artifactId>
+               <scope>runtime</scope>
+            </dependency>
+            
+            <dependency>
+               <groupId>org.jboss.webbeans.servlet</groupId>
+               <artifactId>webbeans-servlet</artifactId>
+               <scope>runtime</scope>
+            </dependency>
+            
+            <!--  JETTY DEPENDENCIES FOR IN IDE TESTING  -->
+
+            <dependency>
+               <groupId>org.mortbay.jetty</groupId>
+               <artifactId>jetty</artifactId>
+               <scope>test</scope>
+            </dependency>
+            
+            <dependency>
+               <groupId>org.mortbay.jetty</groupId>
+               <artifactId>jetty-plus</artifactId>
+               <scope>test</scope>
+            </dependency>
+            
+            <dependency>
+               <groupId>org.slf4j</groupId>
+               <artifactId>slf4j-log4j12</artifactId>
+               <scope>test</scope>
+            </dependency>
+            
+            <dependency>
+               <groupId>log4j</groupId>
+               <artifactId>log4j</artifactId>
+               <scope>test</scope>
+            </dependency>
+            
+         </dependencies>
+         <build>
+            <plugins>
+               <plugin>
+                  <groupId>org.apache.maven.plugins</groupId>
+                  <artifactId>maven-war-plugin</artifactId>
+                  <configuration>
+                     <webResources>
+                        <resource>
+                           <directory>src/main/webapp-jetty</directory>
+                           <filtering>false</filtering>
+                        </resource>
+                     </webResources>
+                  </configuration>
+               </plugin>
+            </plugins>
+         </build>
+      </profile>
    </profiles>
    
    <build>
@@ -216,6 +288,9 @@
                      <includes>
                         <include>WEB-INF/classes/**</include>
                         <include>WEB-INF/lib/**</include>
+                        <include>META-INF/context.xml</include>
+                        <include>WEB-INF/web.xml</include>
+                        <include>WEB-INF/jetty-env.xml</include>
                      </includes>
                      <followSymlinks>false</followSymlinks>
                   </fileset>

Modified: examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-env.xml
===================================================================
--- examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-env.xml	2009-09-23 11:19:41 UTC (rev 3761)
+++ examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/jetty-env.xml	2009-09-23 15:10:06 UTC (rev 3762)
@@ -4,10 +4,10 @@
 <Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
    <New id="appManager" class="org.mortbay.jetty.plus.naming.Resource">
       <Arg><Ref id="webAppCtx"/></Arg> 
-      <Arg>app/Manager</Arg>
+      <Arg>BeanManager</Arg>
       <Arg>
          <New class="javax.naming.Reference">
-            <Arg>javax.inject.manager.Manager</Arg> 
+            <Arg>javax.enterprise.inject.spi.BeanManager</Arg> 
             <Arg>org.jboss.webbeans.resources.ManagerObjectFactory</Arg>
             <Arg/>
          </New>

Modified: examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml
===================================================================
--- examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml	2009-09-23 11:19:41 UTC (rev 3761)
+++ examples/trunk/jsf/numberguess/src/main/webapp-jetty/WEB-INF/web.xml	2009-09-23 15:10:06 UTC (rev 3762)
@@ -31,9 +31,9 @@
    </session-config>
 
    <resource-env-ref>
-      <description>Object factory for the JCDI Manager</description>
-      <resource-env-ref-name>app/Manager</resource-env-ref-name>
-      <resource-env-ref-type>javax.inject.manager.Manager</resource-env-ref-type>
+      <description>Object factory for the CDI Bean Manager</description>
+      <resource-env-ref-name>BeanManager</resource-env-ref-name>
+      <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
    </resource-env-ref>
 
 </web-app>

Modified: examples/trunk/jsf/numberguess/src/main/webapp-tomcat/META-INF/context.xml
===================================================================
--- examples/trunk/jsf/numberguess/src/main/webapp-tomcat/META-INF/context.xml	2009-09-23 11:19:41 UTC (rev 3761)
+++ examples/trunk/jsf/numberguess/src/main/webapp-tomcat/META-INF/context.xml	2009-09-23 15:10:06 UTC (rev 3762)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Context>
    <Manager pathname=""/> <!-- disables storage of sessions across restarts -->
-   <Resource name="app/Manager"
+   <Resource name="BeanManager"
       auth="Container"
-      type="javax.inject.manager.Manager"
+      type="javax.enterprise.inject.spi.BeanManager"
       factory="org.jboss.webbeans.resources.ManagerObjectFactory"/>
    <!-- Uncomment to enable injection into Servlet -->
    <!-- <Listener className="org.jboss.webbeans.environment.tomcat.WebBeansLifecycleListener"/> -->

Modified: examples/trunk/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml
===================================================================
--- examples/trunk/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml	2009-09-23 11:19:41 UTC (rev 3761)
+++ examples/trunk/jsf/numberguess/src/main/webapp-tomcat/WEB-INF/web.xml	2009-09-23 15:10:06 UTC (rev 3762)
@@ -31,9 +31,9 @@
    </session-config>
 
    <resource-env-ref>
-      <description>Object factory for the JCDI Manager</description>
-      <resource-env-ref-name>app/Manager</resource-env-ref-name>
-      <resource-env-ref-type>javax.inject.manager.Manager</resource-env-ref-type>
+      <description>Object factory for the CDI Bean Manager</description>
+      <resource-env-ref-name>BeanManager</resource-env-ref-name>
+      <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
    </resource-env-ref>
 
 </web-app>




More information about the weld-commits mailing list