Fornax-Platform View a printable version of the current page. Export Page as PDF
  4. Archetype Tutorial (CSC)
 
 Browse Space
General


Projects


Latest News
Latest News
(The 15 most recent blogposts in space Fornax-Platform.)


Global Reports
Find all pages that arent linked from anywhere.
Find all undefined pages.
Feed for new pages.
Added by Patrik Nordwall, last edited by Patrik Nordwall on Feb 16, 2010  (view change) show comment

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Sculptor Archetype Tutorial

In this tutorial we will create a simple Java EE application from scratch using the Maven archetypes provided by Sculptor. It consists of the following projects:

  • helloworld-parent - Only a maven project for building the other parts.
  • helloworld - Business tier. EJB project containing the services and domain objects.
  • helloworld-web - Presentation tier. Web application with CRUD GUI.
  • helloworld-ear - EAR package of the deployable application.

We will start with a simple war without EJBs, deployed in Jetty. Later on it is converted to a full EAR deployed in JBoss.

Table of Contents:

Setup maven projects

We start with creating a script that calls the 4 maven archetypes to generate the project structures and maven build files. It also does an inital build and generation of Eclipse project with the maven eclipse plugin. Of course you can execute these commands one by one from the command prompt, but the script is useful when doing this several times.

Copy the following script to sculptor-archetypes.cmd, located in the root of your Eclipse workspace. Adjust paths to your environment.

Windows script:

set MVN_HOME=C:\devtools\Maven-2.0.8
set JAVA_HOME=C:\devtools\jdk1.6.0_03
set path=%MVN_HOME%\bin;%JAVA_HOME%\bin
set PACKAGE=%1
set SYS_NAME=%2

call mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-parent -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ -DgroupId=%PACKAGE% -DartifactId=%SYS_NAME%-parent -Dpackage=%PACKAGE% -Dversion=1.0-SNAPSHOT

call mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ -DgroupId=%PACKAGE% -DartifactId=%SYS_NAME% -Dpackage=%PACKAGE% -Dversion=1.0-SNAPSHOT

call mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-jsf -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ -DgroupId=%PACKAGE% -DartifactId=%SYS_NAME%-web -Dpackage=%PACKAGE% -Dversion=1.0-SNAPSHOT

pause

cd %SYS_NAME%-parent

call mvn install

pause

call mvn -DdownloadSources=false eclipse:eclipse

cd ..

Unix bash script:

#!/bin/bash
if [ -z $1 ] || [ -z $2 ]; then
   echo -e "Usage: $0 PACKAGEID ARTIFACTID\n\tPACKAGEID - name of Java package, for example org.helloworld"
   echo -e "\tARTIFACTID - project base name, for example helloworld"
   exit 1
fi

PACKAGE=$1
SYS_NAME=$2

mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-parent -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ -DgroupId=$PACKAGE -DartifactId=$SYS_NAME-parent -Dpackage=$PACKAGE -Dversion=1.0-SNAPSHOT

mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ -DgroupId=$PACKAGE -DartifactId=$SYS_NAME -Dpackage=$PACKAGE -Dversion=1.0-SNAPSHOT

mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-jsf -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ -DgroupId=$PACKAGE -DartifactId=$SYS_NAME-web -Dpackage=$PACKAGE -Dversion=1.0-SNAPSHOT

sleep 1

cd $SYS_NAME-parent
mvn install
sleep 1

mvn -DdownloadSources=false eclipse:eclipse
cd ..

Run this script by defining the package name as the first parameter and the application id (artifact id of business tier) as the second parameter.

sculptor-archetypes org.helloworld helloworld
Maven 2 Plugin for Eclipse
The above instruction uses eclipse:eclipse to generate Eclipse .project and .classpath files. This is a simple and fully functional approach in most cases. An alternative to eclipse:eclipse is to use the Maven 2 Plugin for Eclipse. If you prefer that plugin there is no problem with using that approach instead.

Import into Eclipse

Open Eclipse and import the 3 projects.

Complete Business Tier

Open model.btdesign located in src/main/resources of the helloworld project.
Add something like this to the design file.

model.btdesign
Application Universe {
    basePackage=org.helloworld

    Module milkyway {
        Entity Planet {
            scaffold
            String name key;
            String message;
            Integer diameter nullable;
            Integer population nullable;
            - Set<@Moon> moons opposite planet;

        }
        Entity Moon {
            not aggregateRoot // belongs to Planet Aggregate
            String name key;
            Integer diameter nullable;
            - @Planet planet opposite moons;
        }
    }
}

Note the scaffold feature of Planet. It will result in automatically generated CRUD operations in the PlanetRepository and PlanetService.

You also need to adjust model.guidesign in web project, because you have renamed the application.

model.btdesign
import 'platform:/resource/helloworld/src/main/resources/model.btdesign'
gui UniverseWeb for Universe {

}

Build

1. Build the application with mvn -Dmaven.test.skip=true clean install from the helloworld-parent project. We skip the JUnit tests in this tutorial, see Hello World Tutorial for more information about the JUnit tests.

2. Refresh the 3 projects in Eclipse.

Fornax Maven Launcher
You can checkout/import the Fornax Maven Launcher into the workspace to be able to run maven inside Eclipse. See Installation Guide.

Run in Jetty

Deploy the application and start Jetty with mvn jetty:run from the helloworld-web project. Note that no installation is needed. Jetty is launched from maven.

Open http://localhost:8080/helloworld-web in your browser.

Try the CRUD GUI and create some favourite Planets and Moons.

The features of the generated web application is explained in CRUD GUI Tutorial.

By default an in memory database, hsqldb, is bundled with the the application. Of course, when you restart the application or server all data added will be lost.

Jetty is an excellent development server, and you can stop here if you don't need to run in JBoss. You can also convert to JBoss later if you like.

Install JBoss AS

Install JBoss AS 4.2.x.GA.

JBoss AS has an old version of Hibernate. You must replace some Hibernate jar files in server/default/lib.
Remove the original files:

  • hibernate3.jar
  • hibernate-entitymanager.jar
  • hibernate-annotations.jar

Add these files, which you find in your maven repository:

  • hibernate-annotations-3.4.0.GA.jar
  • hibernate-commons-annotations-3.1.0.GA.jar
  • hibernate-core-3.3.1.GA.jar
  • hibernate-entitymanager-3.4.0.GA.jar
  • hibernate-validator-3.1.0.GA
  • slf4j-api-1.5.6.jar
  • slf4j-log4j12-1.5.6.jar
  • ehcache-1.5.0.jar
  • backport-util-concurrent-3.1.jar

There is a strange hot deployment problem due to conflicting classloading of Ehcache and ear classloader. Therefore you need to copy ehcache jar to server/default/lib. backport-util-concurrent is used by ehcache.

Deploy to JBoss

Adjust the following property in sculptor-generator.properties in helloworld project.

deployment.applicationServer=JBoss

Rebuild with mvn -Dmaven.test.skip=true clean install from the helloworld-parent project.

Deploy the war file to JBoss. Copy it to server/default/deploy/

Start JBoss and open http://localhost:8080/helloworld-web in your browser.

Use MySQL Database

1. Adjust the following property in sculptor-generator.properties in helloworld project.

db.product=mysql

2. Rebuild with mvn clean install from helloworld-parent project.

3. Create the database schema named universe in your MySQL database. You can use MySQL Administrator to do that.

4. Run helloworld/src/generated/resources/dbschema/Universe_ddl.sql to create the tables. You can use MySQL Query Browser or your favorite database plugin to do that.

5. Add a mbean datasource in JBoss (server/default/deploy/universe-mysql-ds.xml). Use a valid user-name and password.

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>jdbc/UniverseDS</jndi-name>
    <connection-url>jdbc:mysql://localhost/universe</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password>root</password>
  </local-tx-datasource>
</datasources>

6. Copy mysql-connector jar to JBoss lib directory (server/default/lib/)
It is likely that the jar is in your maven repository:

repository\mysql\mysql-connector-java\3.1.14\mysql-connector-java-3.1.14.jar
In Sculptor version 1.6.0 the generated jndi name of the data source is wrong. Therefore you must do some manual adjustments as described in the forum.

7. Redeploy and test again.

Deployment as EAR with EJBs instead of WAR

Sculptor also supports deployment as EAR in a container with support for EJB.

When using EAR deployment the design differences compared to WAR are:

  • Services are exposed as EJBs when deployed as EAR, POJOs when deployed as WAR.
  • Transaction management is done with JTA by the application server when deployed as EAR, by Spring when deployed as WAR.
  • Consumers are not supported when deployed as WAR.

1. Create ear project with the following archetype.

mvn archetype:generate -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-ear -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ -DgroupId=org.helloworld -DartifactId=helloworld-ear

2. Create eclipse project:

mvn \-DdownloadSources=false eclipse:eclipse

3. Import ear project in Eclipse

4. Add ear module in pom.xml in helloworld-parent project

  <modules>
    <module>../helloworld</module>
    <module>../helloworld-web</module>
    <!-- Add ear module when deployed as ear -->
    <module>../helloworld-ear</module>
  </modules>

5. Adjust the following property in sculptor-generator.properties in helloworld project.

deployment.type=ear

6. Add <packaging>ejb</packaging> before the build element in pom.xml in helloworld project.

7. Adjust a few dependencies in pom.xml in helloworld and helloworld-web project. Search for the following comments and follow the instructions:

  • Add dependency to JMS when consumers are used
  • Add dependency to EJB
  • Add scope provided when deployed as ear
  • Remove dependency to javax.transaction
  • Add scope provided when deployed in jboss

8. Rebuild with mvn -Dmaven.test.skip=true clean install from the helloworld-parent project

The resulting EAR file is located in helloworld-ear/target/helloworld-ear.ear.

9. Remove previous war file from JBoss.

10. Deploy the ear file to JBoss. Copy it to server/default/deploy/

Hot Deploy

A short roundtrip is essential to achieve an efficient development environment. You need to be able to do quick hot deployment from your IDE. The generated projects contain Ant build files named antbuild-ear.xml and antbuild-war.xml. You can run these from inside Eclipse, right click and select Run As > Ant Build. But first you must define the location of your JBoss installation. Define the following Ant runtime property:

jboss.home=C:\devtools\JBoss-4.2.2.GA

This setting is found in Eclipse: Window > Preferences > Ant > Runtime > Properties

Use antbuild-ear.xml if you are deploying ear file, and antbuild-war.xml if you are deploying war file.

Run the default target deploy-copy from the parent project. It will unzip the ear/war file to JBoss deploy directory. It will also copy your current class and configuration files from the target directory. This means that when you have done some changes you don't need to do a full mvn install. Eclipse has compiled classes to the target directory and deploy-copy will copy them to JBoss and do a hot redeploy, by touching some files.

When you have done changes to model.btdesign you can do a quick generation by using mvn -Dfornax.generator.force.execution=true -o -npu generate-sources and thereafter run deploy-copy.

Debugging

You can start JBoss AS in Eclipse and debug your application as usual. Right click in the Server view of the Java EE perspective and follow the instructions in the wizard to add a JBoss 4.2 server.

Adding Dependencies

When you need to add dependencies to other jar files you do that by adding them to the maven pom files and thereafter run mvn eclipse:eclipse again. You must always run mvn eclipse:eclipse from the parent project.

Note that eclipse:eclipse also supports Eclipse project dependencies, as opposed to dependencies via jar files in the repository. In the above application the web project will have a project dependency to the business tier project. You can add other project dependencies by adding modules in the pom of the parent project and thereafter run mvn eclipse:eclipse again.

<module>../another-project</module>

Source

The complete source code for this tutorial is available in Subversion.

Web Access (read only):

Anonymous Access (read only):

the linux pendant to your windows-script (sculptor-archetypes.cmd) looks like this:

 #!/bin/sh

if [ -z $1 ] || [ -z $2 ]; then
    echo usage: $0 PACKAGEID ARTIFACTID
    exit 1
fi

PACKAGE=$1
SYS_NAME=$2

mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
-DarchetypeGroupId=org.fornax.cartridges \
-DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-parent \
-DarchetypeVersion=1.3.1 \
-DremoteRepositories=http://www.fornax-platform.org/m2/repository \
-DgroupId=$PACKAGE \
-DartifactId=$SYS_NAME-parent \
& \
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
-DarchetypeGroupId=org.fornax.cartridges \
-DarchetypeArtifactId=fornax-cartridges-sculptor-archetype \
-DarchetypeVersion=1.3.1 \
-DremoteRepositories=http://www.fornax-platform.org/m2/repository \
-DgroupId=$PACKAGE -DartifactId=$SYS_NAME \
& \
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
-DarchetypeGroupId=org.fornax.cartridges \
-DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-web \
-DarchetypeVersion=1.3.1 \
-DremoteRepositories=http://www.fornax-platform.org/m2/repository \
-DgroupId=$PACKAGE -DartifactId=$SYS_NAME-web \
& \
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
-DarchetypeGroupId=org.fornax.cartridges \
-DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-ear \
-DarchetypeVersion=1.3.1 \
-DremoteRepositories=http://www.fornax-platform.org/m2/repository \
-DgroupId=$PACKAGE \
-DartifactId=$SYS_NAME-ear \
& \
sleep 1
cd $SYS_NAME-parent
mvn install
sleep 1
mvn -DdownloadSources=false eclipse:eclipse
cd ..
exit 0

Posted by Anonymous at Jun 11, 2008 16:41 | Reply To This

unless I missed something my db-script, that gets generated, does not create the database. I had to do it manually.

Posted by Anonymous at Jun 11, 2008 17:19 | Reply To This

Correct, you have to run the sql script manually.

we probably missunderstud each other. I am aware that I have to run the script manually. I mean that the script does not create the database (it only contains drop & create table statements). The script therefore failed complaining that the database does not exist yet. Am I right?

Posted by Anonymous at Jun 12, 2008 00:06 | Reply To This

Yes, that should of course be described better. I have improved the setup db section.
Note that I changed the connection url. The application is named Universe and therefore I think the database schema should be named universe.

Another issue I had was that the deployment in Jboss failed. The log showed a failing query:

 SELECT * FROM INFORMATION_SCHEMA.SYSTEM_TABLES

I fixed that (? currently failing with a different error related to spring beans) by adding type mapping to the universe-mysql-ds.xml:

<local-tx-datasource>
  <jndi-name>jdbc/UniverseDS</jndi-name>
  <connection-url>jdbc:mysql://localhost/helloworld</connection-url>
  <driver-class>com.mysql.jdbc.Driver</driver-class>
  <user-name>root</user-name>
  <password>root</password>
  <idle-timeout-minutes>15</idle-timeout-minutes>
    <metadata>
      <type-mapping>mySQL</type-mapping>
    </metadata>
</local-tx-datasource>

Posted by Anonymous at Jun 12, 2008 00:18 | Reply To This

Hi,

I've got a problem downloading resorces:
Downloading: http://www.fornax-platform.org/m2/repository/org/fornax/fornax-parent/2-SNAPSHOT/fornax-parent-2-SNAPSHOT.pom
Downloading: http://www.fornax-platform.org/m2/repository/org/fornax/fornax-parent/2-SNAPSHOT/fornax-parent-2-SNAPSHOT.pom
Downloading: http://download.java.net/maven/1/org.fornax/poms/fornax-parent-2-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.fornax
ArtifactId: fornax-parent
Version: 2-SNAPSHOT

Posted by Anonymous at Oct 26, 2008 18:30 | Reply To This

Hmm, fornax-parent-2-SNAPSHOT is something old that should not be used any more. Version 3.1 of fornax-parent is the one to use. What version of Sculptor are using?

stupid me, I copied the unix from the above script without thinking. thanks a lot.

Posted by Anonymous at Oct 27, 2008 00:23 | Reply To This

I had the following problem: org.hibernate.InvalidMappingException: Could not parse mapping document from input streamdue to: org.dom4j.DocumentException coming from dom4j-1.6.1 . This seems to be a known problem of dom4j , I could only solve it by using dom4j-1.5.2 in JBoss. Any other solutions known?

Posted by Anonymous at Oct 30, 2008 10:59 | Reply To This

Sorry for the delay, but now I have found the reason for this problem. It is not the version of dom4j. It is a transitive dependency which caused dom4j to be included in lib dir of war, which cause some kind of classloading problem. Solution see: CSC-271.

hi,

 i could deploy the ear that i have generated in JBOSS could some one explain me how to deploy the same 

ear in websphere when i tried to deploy it had thrown many expections, as a  chainreaction expections keeps

coming after solving manyexpection i couldn't make out

Posted by Anonymous at Jan 07, 2009 10:35 | Reply To This

hi all,

i am getting the following error does anyone have any idea on this

49349 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component sculptorguidsl-checker of type org.openarchitectureware.check.CheckComponent:

        EvaluationException : Couldn't find type or property 'guiForApplication'

        org::fornax::cartridges::sculptor::gui::dsl::GenChecks.chk[361,17] on line 12 'guiForApplication'

49349 ERROR WorkflowRunner     - Workflow interrupted. Reason: EvaluationException : Couldn't find type or property 'guiForApplication'
        org::fornax::cartridges::sculptor::gui::dsl::GenChecks.chk[361,17] on line 12 'guiForApplication'

49349 ERROR WorkflowRunner     - Error during linking phase : Couldn't find operation 'setGuiForApplication(Void)' for sculptorguidsl::DslGuiApplication. on line 1 in model.guidesign
49349 ERROR WorkflowRunner     - ERROR in Component sculptorguidsl-checker of type org.openarchitectureware.check.CheckComponent 

       Couldn't find type or property 'guiForApplication' [guiForApplication]in workflow: CheckComponent(sculptorguidsl-checker): expression guidslModel.eAll
Contents.union(

Unknown macro: {guidslModel}

) check file(s): org::fornax::cartridges::sculptor::
gui::dsl::GenChecks org::fornax::cartridges::sculptor::gui::dsl::Checks
49349 ERROR WorkflowRunner     - ERROR in Component sculptorguidsl-checker of ty
pe org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'guiForApplication' [guiForApplication.!=
(null)]  in workflow: CheckComponent(sculptorguidsl-checker): expression guidslM
odel.eAllContents.union(

) check file(s): org::fornax::cartridges::s
culptor::gui::dsl::GenChecks org::fornax::cartridges::sculptor::gui::dsl::Checks
49365 ERROR WorkflowRunner     - ERROR in Component sculptorguidsl-checker of ty
pe org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'guiForApplication' [if this.parsedString
("guiForApplication").!=(null) then guiForApplication.!=(null) else true]  in wo
rkflow: CheckComponent(sculptorguidsl-checker): expression guidslModel.eAllConte
nts.union(

Unknown macro: {guidslModel}

) check file(s): org::fornax::cartridges::sculptor::gui::
dsl::GenChecks org::fornax::cartridges::sculptor::gui::dsl::Checks
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------

Posted by Anonymous at Jan 13, 2009 07:52 | Reply To This

If you set the application name to Universe ("Complete Business Tier") in the Helloword project's model file, you'll have to change the reference to it the Helloword-Web's model-file before you can build. I guess you forgot to mention that, or did I miss something?

/J

Posted by Anonymous at Feb 19, 2009 14:36 | Reply To This

The artifactIds of the spring webflow dependencies has changed. Since 2.0.6 they are renamed from org.springframework.webflow to spring-webflow. The same is true for -binding, -faces and -js. I had to modify the generated pom.xml in the web package. Now it generates the .classpath for all three packages.

Tib

Posted by Anonymous at May 15, 2009 10:27 | Reply To This

Hi,

we are trying to deploy our project into jboss 4.2.2 GA,and using Oracle database 10g.
my dataset is :

MyAppConnectionFactory-ds.xml

<datasources>
<local-tx-datasource>
<jndi-name>jdbc/MyAppConnectionFactory</jndi-name>
<connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>oracle</user-name>
<password>testapp</password>
</local-tx-datasource>
</datasources>

and my jboss-web.xml is :

<?xml version="1.0" encoding="UTF-8" ?>
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/MyAppConnectionFactory</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/MyAppConnectionFactory</jndi-name>
</resource-ref>
</jboss-web>

my web.xml is:

<?xml version="1.0" encoding="UTF-8" ?>

  • <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>rien-web</display-name>
  • <!-- Serves static resource content from .jar files such as spring-faces.jar
    -->
  • <servlet>
    <servlet-name>Resources Servlet</servlet-name>
    <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
  • <!-- Map all /resources requests to the Resource Servlet for handling
    -->
  • <servlet-mapping>
    <servlet-name>Resources Servlet</servlet-name>
    <url-pattern>/resources/*</url-pattern>
    </servlet-mapping>
  • <!-- The front controller of this Spring Web application, responsible for handling all application requests
    -->
  • <servlet>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  • <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value />
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
  • <!-- Map all /spring requests to the Dispatcher Servlet for handling
    -->
  • <servlet-mapping>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    <url-pattern>/spring/*</url-pattern>
    </servlet-mapping>
  • <!-- Just here so the JSF implementation can initialize, not used at runtime
    -->
  • <servlet>
    <servlet-name>Standard Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
  • <!-- Just here so the JSF implementation can initialize
    -->
  • <servlet-mapping>
    <servlet-name>Standard Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
  • <context-param>
    <param-name>facelets.LIBRARIES</param-name>
    <param-value>/WEB-INF/generated/config/application.taglib.xml</param-value>
    </context-param>
  • <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/generated/config/faces-config.xml</param-value>
    </context-param>
  • <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
  • <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
  • <!-- <context-param>
    <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
    <param-value>true</param-value>
    </context-param>
    -->
  • <context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>true</param-value>
    </context-param>
  • <!-- Causes Facelets to refresh templates during development
    -->
  • <context-param>
    <param-name>facelets.REFRESH_PERIOD</param-name>
    <param-value>1</param-value>
    </context-param>
  • <!-- Neede to prevent JBoss from using its own bundled JSF impl
    -->
  • <context-param>
    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
    <param-value>true</param-value>
    </context-param>
  • <!-- context-param>
    <param-name>org.apache.myfaces.ERROR_HANDLER</param-name>
    <param-value>my.project.ErrorHandler</param-value>
    </context-param>
    <context-param>
    <param-name>org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER</param-name>
    <param-value>true</param-value>
    </context-param
    -->
  • <!-- spring config params and listeners
    -->
  • <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/generated/config/applicationContext.xml</param-value>
    </context-param>
  • <!-- listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener
    -->
  • <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
  • <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
  • <!-- load a shared business tier parent application context
    -->
  • <context-param>
    <param-name>locatorFactorySelector</param-name>
    <param-value>beanRefContext.xml</param-value>
    </context-param>
  • <context-param>
    <param-name>parentContextKey</param-name>
    <param-value>ma.hps.rien</param-value>
    </context-param>
  • <filter>
    <filter-name>serviceContextFilter</filter-name>
    <filter-class>org.fornax.cartridges.sculptor.framework.errorhandling.ServiceContextServletFilter</filter-class>
    </filter>
  • <filter-mapping>
    <filter-name>serviceContextFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
  • <filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
  • <init-param>
    <param-name>maxFileSize</param-name>
    <param-value>20m</param-value>
    </init-param>
    </filter>
  • <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    </filter-mapping>
  • <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
  • <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    </filter-mapping>
  • <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.xhtml</url-pattern>
    </filter-mapping>
  • <error-page>
    <error-code>500</error-code>
    <location>/error.xhtml</location>
    </error-page>
  • <welcome-file-list>
  • <!-- We need a redirect because of MyFaces filter
    -->
  • <!-- <welcome-file>index.xhtml</welcome-file>
    -->
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    </web-app>

wehen running JBoss i get this error:

2009-10-14 18:11:16,191 DEBUG [org.jboss.web.tomcat.service.JBossWeb] Problem in init
org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/jboss-web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: resource-ref jdbc/MyAppConnectionFactory found in jboss-web.xml but not in web.xml)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:768)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356)
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.deployment.SubDeployerInterceptorSupport.init(SubDeployerInterceptorSupport.java:119)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.init(SubDeployerInterceptorSupport.java:172)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:87)
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.init(Unknown Source)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
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:263)
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)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jboss.deployment.DeploymentException: resource-ref jdbc/MyAppConnectionFactory found in jboss-web.xml but not in web.xml
at org.jboss.metadata.WebMetaData.importJBossWebXml(WebMetaData.java:1030)
at org.jboss.metadata.WebMetaData.importXml(WebMetaData.java:770)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:763)
... 87 more
2009-10-14 18:11:16,191 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/C:/jboss-4.2.2.GA/server/default/deploy/yes-web.war
2009-10-14 18:11:16,191 ERROR [org.jboss.deployment.MainDeployer] Could not initialise deployment: file:/C:/jboss-4.2.2.GA/server/default/deploy/yes-web.war
org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/jboss-web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: resource-ref jdbc/MyAppConnectionFactory found in jboss-web.xml but not in web.xml)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:768)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356)
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.deployment.SubDeployerInterceptorSupport.init(SubDeployerInterceptorSupport.java:119)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.init(SubDeployerInterceptorSupport.java:172)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:87)
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.init(Unknown Source)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
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:263)
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)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jboss.deployment.DeploymentException: resource-ref jdbc/MyAppConnectionFactory found in jboss-web.xml but not in web.xml
at org.jboss.metadata.WebMetaData.importJBossWebXml(WebMetaData.java:1030)
at org.jboss.metadata.WebMetaData.importXml(WebMetaData.java:770)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:763)
... 87 more
2009-10-14 18:11:16,207 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@772fa671

Unknown macro: { url=file}

org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/jboss-web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: resource-ref jdbc/MyAppConnectionFactory found in jboss-web.xml but not in web.xml)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:768)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356)
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.deployment.SubDeployerInterceptorSupport.init(SubDeployerInterceptorSupport.java:119)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.init(SubDeployerInterceptorSupport.java:172)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:87)
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.init(Unknown Source)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:872)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
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:263)
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)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jboss.deployment.DeploymentException: resource-ref jdbc/MyAppConnectionFactory found in jboss-web.xml but not in web.xml
at org.jboss.metadata.WebMetaData.importJBossWebXml(WebMetaData.java:1030)
at org.jboss.metadata.WebMetaData.importXml(WebMetaData.java:770)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:763)
... 87 more

thanks for help me.

Posted by Anonymous at Oct 14, 2009 20:21 | Reply To This