Help

Switch Workspace

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

The Weld team recently collaborated with users just like yourself to create a set of Maven archetypes for Java EE 6 and standalone CDI (in a Servlet environment). Now it's even easier and faster to get started using CDI (with Weld as the provider).

What are Maven archetypes?

Maven archetypes are templates that allow you to get started writing your application much more quickly by generating a barebones, deployable Maven 2 project. The Weld archetypes can create either a Java EE 6 project that targets a Java EE 6 application server (e.g., JBoss AS 6.0 and GlassFish V3) or a JSF 2.0 and CDI application that runs on Servlet containers (e.g., Tomcat 6 and Jetty 6). You can select the view layer of your choice, though at the moment, JSF 2 is the only preconfigured option. In the future we will have archetypes for Wicket and other technologies that integrate with CDI that are requested by the community.

Now you can create a brand new project with a single command and dive right into writing your application rather than messing around with mundane setup tasks!

Keep in mind that Maven 2 archetypes can theoretically generate projects which don't themselves use Maven. We'll be exploring that option in the future.

What do I need to do?

The only prerequisites are to have Java 6 (Java SDK 1.6) or better and Maven 2.0.10 or better installed.

Current Release: 1.0.1.Beta1

Version 1.0.1.Beta1 of the Java EE 6 archetype and version 1.0.0-BETA1 of the Servlet archetype are available in the Maven Central Repository. They appear in Maven's default archetype catalog as well.

The archetypes are currently functional, useful, and a great way to increase your productivity. In fact, they are probably the fastest way to get started with CDI. The Weld team and volunteers from the community, such as yourself, are working closely together to add more features. The core functionality of the archetypes is completed. At this point, we are asking for your feedback. Do they provide too little? Too much? What other features do you want?

Create a CDI and JSF 2.0 project from the command line

Choose your target environment by answering one of the questions below and follow the instructions provided to create your project.

WARNING

The groupId (or package) you choose for your project must be a valid Java package name.

Want to create a Java EE 6 application? Use jboss-javaee6-webapp

The script below creates a Java EE 6 WAR project and builds it. The generated POM includes a plugin to publish to a JBoss AS instance if you've set JBOSS_HOME in your OS. (See these instructions for how to setup Maven to use your JBoss AS 6 installation)

# Create empty project with default values
mvn archetype:generate -DinteractiveMode=n -DarchetypeArtifactId=jboss-javaee6-webapp -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.1.Beta1 -DgroupId=com.mycompany -DartifactId=myproject

# Alternatively, you can use interactive mode. Select the jboss-javaee6-webapp archetype
mvn archetype:generate

# Change to the new project directory
cd myproject

# Build project 
mvn package
 
# The generated POM includes a plugin to publish to a JBoss instance if you've set JBOSS_HOME or jboss.home in a settings.xml profile.
mvn jboss:hard-deploy

Want to create a CDI application for a Servlet container? Use weld-jsf-servlet-minimal

The next two steps create a project that targets a Servlet container and launches it in Jetty. The example can also be deployed to a running Tomcat 6 instance or run in an embedded Tomcat instance that is started with Maven.

The groupId (or package) you choose for your project must be a valid Java package name!
# Create empty project with default values
mvn archetype:generate -DinteractiveMode=n -DarchetypeArtifactId=weld-jsf-servlet-minimal -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.0-BETA1 -DgroupId=com.mycompany -DartifactId=myproject

# Alternatively, you can use interactive mode. Select the weld-jsf-servlet-minimal archetype
mvn archetype:generate

# Change to the new project directory
cd myproject

# Build project to confirm it runs. Launch via Jetty
mvn jetty:run

As you've now noticed by your console output, Maven has downloaded and configured a Jetty Servlet container and launched your application. You can now view it at http://localhost:9090/myprojectname/index.jsf.

Create a CDI and JSF 2.0 project using m2eclipse

m2eclipse is the Eclipse plugin for Maven 2. It allows you to create, import and manage Maven 2 projects. In this case, we are interested in creating a Maven 2 project.

To get started, add the m2eclipse update site to Eclipse and install the m2eclipse plugin and required dependencies. Once that is installed, you'll be ready to create a new CDI and JSF 2.0 project using Eclipse.

Begin by selecting New > Project... from the File menu. Now, follow the screens (left to right, top to bottom) below to create a minimal Java EE 6 project using the jboss-javaee6-webapp.

NOTE

Replace references to weld-jsf-jee-minimal with jboss-javaee6-webapp in the screenshots below.
The groupId (or package) you choose for your project must be a valid Java package name!

The resulting project with have the following structure.

You can now build the project just like a normal Maven 2 project, either from the command line or using the m2eclipse plugin controls.

Create a CDI and JSF 2.0 project using NetBeans

NetBeans 6.8 includes support for Maven 2 out of the box. It allows you to create, open and manage Maven 2 projects just like regular projects. Once again, we are interested in creating a Maven 2 project.

So you are all set to create a new CDI and JSF 2.0 project using NetBeans if you have NetBeans 6.8 (with the bundled GlassFish V3) installed!

Begin by selecting New Project... from the File menu. Now, follow the screens below to create a minimal Java EE 6 project using the weld-jee-minimal archetype.

The groupId (or package) you choose for your project must be a valid Java package name!

Here is what the resulting project will look like:

Now, there is one small tweak that you have to make. Open pom.xml and remove the <dependency> for org.glassfish.web:el-impl since GlassFish already provides an EL implementation (the correct one).

Now, you can simply right click and run the application on GlassFish V3. GlassFish will start automatically if it isn't already running.

Happy developing!

What's Next?

We're not done and we need your help. Archetypes are created to meet the needs of the users that actually write applications on a daily basis. The Weld archetypes were actually suggested and started by a user while he was learning how use Weld. In order to fit your needs and help users, it needs your contributions.

You can help by providing feedback and suggestions, code submissions, or helping to improve the documentation.

We want Weld and CDI to be successful and we cannot be successful if using our product is a frustrating or confusing experience. You can help us make Weld fit your needs. The Weld team went to great lengths to make Weld easy to configure. Now the community can help them make it easy to understand and accessible to users, both novice and advanced.

Features coming soon:

  • EL 2.2
  • A wicket archetype
  • EAR Support
  • Unit test examples
  • JPA boilerplate
  • Your suggestions!

17 comments:
 
26. Nov 2009, 19:07 America/New_York | Link
Uwe
Got the following error message. Dont know how to fix.

Missing:
----------
1) net.java.dev.jna:jna:jar:3.0.5

...

  Path to dependency:
        1) org.codehaus.mojo:buildnumber-maven-plugin:maven-plugin:1.0-beta-3
        2) com.google.code.maven-scm-provider-svnjava:maven-scm-provider-svnjava:jar:1.4
        3) net.java.dev.jna:jna:jar:3.0.5

----------
1 required artifact is missing.

for artifact:
  org.codehaus.mojo:buildnumber-maven-plugin:maven-plugin:1.0-beta-3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  codehaus.org (http://snapshots.repository.codehaus.org),
  repository.jboss.org (http://repository.jboss.org/maven2),
  twdata-m2-repository.googlecode.com (http://twdata-m2-repository.googlecode.com/svn),
  oss.sonatype.org/jboss-snapshots (http://oss.sonatype.org/content/repositories/jboss-snapshots)
 
30. Nov 2009, 00:33 America/New_York | Link

I have never seen that error. Please try again and if the error continues, please run mvn --version and post the values.

01. Dec 2009, 10:15 America/New_York | Link
Svetoslav Batchovski

Trying to build and install the archetype end with following error:

mvn -e clean install -f weld-archetype/pom.xml
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Reactor build order: 
[INFO]   Weld Archetypes
[INFO]   Servlet/JSF Archetype for Weld
[INFO]   Weld JEE6 Minimal Archteype
[INFO]   Weld JEE6 Archetype
[INFO] ------------------------------------------------------------------------
[INFO] Building Weld Archetypes
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [enforcer:enforce {execution: enforce}]
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Detected Maven Version: 2.2.1 is not in the allowed range [2.0.10,2.0.10].
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
        at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:218)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Tue Dec 01 10:12:43 CET 2009
[INFO] Final Memory: 16M/76M
06. Dec 2009, 11:32 America/New_York | Link
pritam

I don't think any of the archetypes are present in http://repo2.maven.org/maven2/org/jboss/weld/ nor the other maven 2 repos. It would be nice to see a working repo,

09. Dec 2009, 07:39 America/New_York | Link

At the moment you need to use Maven 2.0.10 to build the archetypes. This restriction will be corrected in the next release of Weld.

Once the archetype is installed in the Maven repository, you can use any version of Maven you want to generate the project.

 

Dan Allen | mojavelinux.com | Author of Seam in Action

10. Dec 2009, 04:26 America/New_York | Link

We are getting there ;)

 

Dan Allen | mojavelinux.com | Author of Seam in Action

 
20. Dec 2009, 11:13 America/New_York | Link
vanyatka
[WARNING] Specified archetype not found.
Downloading: http://repo1.maven.org/maven2/org/jboss/weld/archetypes/weld-jsf-servlet-minimal/1.0/weld-jsf-servlet-minimal-1.0.jar
[INFO] Unable to find resource 'org.jboss.weld.archetypes:weld-jsf-servlet-minimal:jar:1.0' in repository central (http://repo1.maven.org/maven2)
20. Dec 2009, 13:46 America/New_York | Link
Kristof Vanbecelaere

I still see JPA 1.0 as dependency, right?

Also, I am quite interested in seeing test infrastructure appear.

 
20. Dec 2009, 22:21 America/New_York | Link
batora

After reading the article (and the one at: http://in.relation.to/Bloggers/GetRunningOnCDIJSF2InAJiffyUsingMavenArchetypes), I did the following:

1. Add Remote catalog called Weld in Eclipse with location http://anonsvn.jboss.org/repos/weld/archetypes/tags/1.0.0-BETA1 2. Create new maven project 3. Select Weld catalog 3. I see the three options available - jee, jee-minimal and servlet-minimal 4. I pick one of them and click Finish 5. At this step I have the following error:

Unable to create project from archetype org.jboss.weld.archetypes:weld-jsf-jee:1.0.0-BETA1 null The desired archetype does not exist (org.jboss.weld.archetypes:weld-jsf-jee:1.0.0-BETA1)

I am using Eclipse 3.4.2 and Maven 2.2.1.

Any ideas about the failure reason?

22. Dec 2009, 14:12 America/New_York | Link

Hi.

I'm testing this way of Weld start, and the project using weld-jsf-jee-minimal was perfect. But, when I try to use the weld-jsf-jee (persistence unit included), I got a error (at deploy moment). I'm using Netbeans 6.8 and Glassfish v3 bundled.

The trace...

SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'java:/DefaultDS' in SerialContext  Root exception is javax.naming.NamingException: Invocation exception: Got null ComponentInvocation 
        at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:111)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:130)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:96)
        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)
Caused by: javax.naming.NamingException: Lookup failed for 'java:/DefaultDS' in SerialContext  [Root exception is javax.naming.NamingException: Invocation exception: Got null ComponentInvocation ]
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.sun.enterprise.connectors.service.ConnectorResourceAdminServiceImpl.lookup(ConnectorResourceAdminServiceImpl.java:203)
        at com.sun.enterprise.connectors.ConnectorRuntime.lookupPMResource(ConnectorRuntime.java:417)
        at org.glassfish.persistence.jpa.JPADeployer$ProviderContainerContractInfoImpl.lookupDataSource(JPADeployer.java:228)
        at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:108)
        ... 32 more
Caused by: javax.naming.NamingException: Invocation exception: Got null ComponentInvocation 
        at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.getComponentId(GlassfishNamingManagerImpl.java:773)
        at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:655)
        at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:156)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:428)
        ... 38 more

Thanks, Carvo.

22. Dec 2009, 15:04 America/New_York | Link
Carvo

Excuse my haste, I did not see the comments in the persistence.xml.

By the way, after the change to use Glassfish, the view home.xhtml did not found 'widget'. Excuse my little knowledge, but I did not find any setting(config) to 'register' the name 'widget'. How is this done?

Thanks again, Carvo

ps. the console trace:

SEVERE: Error Rendering View   /home.xhtml
javax.el.ELException: /home.xhtml: The class 'java.lang.String' does not have the property 'id'.
        at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:81)
        at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:75)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:285)
        at com.sun.faces.renderkit.html_basic.TableRenderer.renderRow(TableRenderer.java:380)
        at com.sun.faces.renderkit.html_basic.TableRenderer.encodeChildren(TableRenderer.java:161)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
        at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
        at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)
22. Dec 2009, 15:23 America/New_York | Link
Carvo

It's me again, but do not be nervous.

I found the problem, I just notice that in home.xhtml missed the brackets in line 49, into the VALUE propertie.

So if someone want to use this archetype, just make this correction.

Carvo.

 
20. Jan 2010, 11:57 America/New_York | Link

Hi everyone, I've just fixed a small error in the documentation; instead of

mvn archetype:generate -DinteractiveMode=n -DarchetypeArtifactId=weld-jsf-jee-minimal -DarchetypeGroupId=org.jboss.weld.archetypes -Dversion=1.0.0-BETA1 -DgroupId=com.mycompany -DartifactId=myproject

the correct syntax is

mvn archetype:generate -DinteractiveMode=n -DarchetypeArtifactId=weld-jsf-jee-minimal -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.0-BETA1 -DgroupId=com.mycompany -DartifactId=myproject

This is IMO the easiest way to download and generate the project with Maven archetypes.

HTH Maurizio

 
06. Apr 2010, 20:32 America/New_York | Link
Axiopisty
I just followed the instruction on this tutorial (using the NetBeans IDE steps). After the project was created I found this in pom.xml

      <!-- Needed on JBoss AS as EL is out of date -->
      <dependency>
         <groupId>org.glassfish.web</groupId>
         <artifactId>el-impl</artifactId>
         <scope>runtime</scope>
         <!-- FIXME this version should be in the Weld API BOM -->
         <version>2.1.2-b04</version>
         <exclusions>
            <exclusion>
               <groupId>javax.el</groupId>
               <artifactId>el-api</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
   </dependencies>

Why is the FIXME comment there? What is the Weld API BOM?
 
10. May 2010, 12:12 America/New_York | Link
surfspider | surfspider.AT.gmx.ch

Hi

I tried 'weld-jsf-servlet-minimal' archetype. It does work with glassfish v3 but not with jboss 4.2.2 and jboss 6.0.0-M3. I have also uncommented WeldLifecycleListener in context.xml.

jboss 4.2.2 brings following exception

g.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: res the jboss-web/resource-env-ref.) at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:384) at org.jboss.web.WebModule.startModule(WebModule.java:83) at org.jboss.web.WebModule.startService(WebModule.java:61) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy44.start(Unknown Source) at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238) at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87) at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.j at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy45.start(Unknown Source) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy9.deploy(Unknown Source) at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy4.start(Unknown Source) at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210) at $Proxy5.deploy(Unknown Source) at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482) at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362) at org.jboss.Main.boot(Main.java:200) at org.jboss.Main$1.run(Main.java:508)

 
06. Jul 2010, 09:09 America/New_York | Link

Tried out using the weld maven archetype today (BETA1). Sadly it didn't work in JBoss 6.0.0 M3 (Invoking sendRedirect() in a JSP causes WELD-001303 as described in https://jira.jboss.org/browse/WELD-448), but it is working fine in the last build I got from Hudson: http://hudson.jboss.org/hudson/job/JBoss-AS-6.0.x/

 
23. Aug 2010, 06:10 America/New_York | Link

I am using the archetype:

weld-jsf-jee (Weld archetype for creating a Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence unit included))

and found out, that there is no weld-archetype for jee applications packaged as EAR (e.g., integrating application.xml). A Java EE 6 application should be packaged as an EAR.

Would be nice to enhance this archetype to provide an EAR-Package, dont you think so?