Weld SVN: r5343 - in archetypes/tags/1.0.0-BETA1/jsf: jee-minimal/src/main/resources/archetype-resources and 1 other directories.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 17:07:34 -0500 (Thu, 17 Dec 2009)
New Revision: 5343
Modified:
archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt
archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt
archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt
Log:
update readme files
Modified: archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt 2009-12-17 21:58:38 UTC (rev 5342)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt 2009-12-17 22:07:34 UTC (rev 5343)
@@ -1,14 +1,16 @@
${artifactId}
+ Source archetype: weld-jsf-jee
+
What is it?
===========
This is your project! It's a sample, deployable Maven 2 project to help you
get your foot in the door developing with Java EE 6. This project is setup to
allow you to create a compliant Java EE 6 application using JSF 2.0, CDI 1.0,
- EJB 3.1 and JPA 2.0) that can run on a certified application server (Full or
- Web Profile). It includes a persistence unit and some sample persistence and
- transaction code to help you get your feet wet with database access in
+ EJB 3.1 and JPA 2.0) that can run on a certified application server (Complete
+ or Web Profile). It includes a persistence unit and some sample persistence
+ and transaction code to help you get your feet wet with database access in
enterprise Java.
System requirements
@@ -30,17 +32,6 @@
Deploying the application
=========================
- You can deploy the application without moving any files around using the
- embedded GlassFish application server.
-
- To run the application using embedded GlassFish, execute this command:
-
- mvn package embedded-glassfish:run
-
- The application will be running at the following URL:
-
- http://localhost:7070/${artifactId}
-
To deploy the application to JBoss AS (standalone), first make sure that the
JBOSS_HOME environment variable points to a JBoss AS 6.0 installation.
Alternatively, you can set the location of JBoss AS using the following
@@ -74,9 +65,36 @@
http://localhost:8080/${artifactId}
- If you want to deploy to GlassFish (standalone), you can upload the
- target/${artifactId}.war archive using the web-based administration console.
+ If you want to deploy to GlassFish (standalone), you first need to change
+ the name of the DataSource used by the persistence unit! Open this file:
+ src/main/resources/META-INF/persistence.xml
+
+ Change the value of <jta-data-source> to the following:
+
+ <jta-data-source>jdbc/__default</jta-data-source>
+
+ This configuration uses the built-in default Derby DataSource in GlassFish.
+ Optionally, you can use an alternative DataSource of your choice.
+
+ Now, execute the command:
+
+ mvn package
+
+ You can now deploy the target/${artifactId}.war archive and launch the
+ application the through GlassFish administration console.
+
+ Alternatively, you can deploy the application without moving any files around
+ using the embedded GlassFish application server.
+
+ To run the application using embedded GlassFish, execute this command:
+
+ mvn package embedded-glassfish:run
+
+ The application will be running at the following URL:
+
+ http://localhost:7070/${artifactId}
+
Importing the project into an IDE
=================================
Modified: archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 21:58:38 UTC (rev 5342)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 22:07:34 UTC (rev 5343)
@@ -1,5 +1,7 @@
${artifactId}
+ Source archetype: weld-jsf-jee-minimal
+
What is it?
===========
Modified: archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 21:58:38 UTC (rev 5342)
+++ archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 22:07:34 UTC (rev 5343)
@@ -1,5 +1,7 @@
${artifactId}
+ Source archetype: weld-jsf-servlet-minimal
+
What is it?
===========
14 years, 11 months
Weld SVN: r5342 - in archetypes/trunk/jsf: jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF and 2 other directories.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 16:58:38 -0500 (Thu, 17 Dec 2009)
New Revision: 5342
Added:
archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml
archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml
Removed:
archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
Log:
move beans.xml to WEB-INF to be compliant with JSR-299 packaging rules
Deleted: archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
===================================================================
--- archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml 2009-12-17 21:57:40 UTC (rev 5341)
+++ archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml 2009-12-17 21:58:38 UTC (rev 5342)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
- <alternatives/>
- <decorators/>
- <interceptors/>
-</beans>
Copied: archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (from rev 5317, archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml)
===================================================================
--- archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml 2009-12-17 21:58:38 UTC (rev 5342)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+ <alternatives/>
+ <decorators/>
+ <interceptors/>
+</beans>
Deleted: archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
===================================================================
--- archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml 2009-12-17 21:57:40 UTC (rev 5341)
+++ archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml 2009-12-17 21:58:38 UTC (rev 5342)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- The contents of this file is permitted to be empty.
- The schema definition is provided for your convenience.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
-</beans>
Copied: archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (from rev 5317, archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml)
===================================================================
--- archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml 2009-12-17 21:58:38 UTC (rev 5342)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The contents of this file is permitted to be empty.
+ The schema definition is provided for your convenience.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
14 years, 11 months
Weld SVN: r5341 - in archetypes/tags/1.0.0-BETA1/jsf: jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF and 2 other directories.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 16:57:40 -0500 (Thu, 17 Dec 2009)
New Revision: 5341
Added:
archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml
archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml
Removed:
archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/
archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
Log:
move beans.xml to WEB-INF to be compliant with JSR-299 packaging rules
Deleted: archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml 2009-12-17 21:55:11 UTC (rev 5340)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml 2009-12-17 21:57:40 UTC (rev 5341)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
- <alternatives/>
- <decorators/>
- <interceptors/>
-</beans>
Copied: archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (from rev 5326, archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml)
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml 2009-12-17 21:57:40 UTC (rev 5341)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+ <alternatives/>
+ <decorators/>
+ <interceptors/>
+</beans>
Copied: archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (from rev 5326, archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/resources/META-INF/beans.xml)
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml (rev 0)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/beans.xml 2009-12-17 21:57:40 UTC (rev 5341)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ The contents of this file is permitted to be empty.
+ The schema definition is provided for your convenience.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+</beans>
14 years, 11 months
Weld SVN: r5340 - in archetypes/trunk/jsf: jee-minimal/src/main/resources/archetype-resources and 1 other directory.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 16:55:11 -0500 (Thu, 17 Dec 2009)
New Revision: 5340
Modified:
archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml
archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml
Log:
project.buildDirectory should be project.build.directory
Modified: archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml 2009-12-17 21:54:20 UTC (rev 5339)
+++ archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/pom.xml 2009-12-17 21:55:11 UTC (rev 5340)
@@ -156,7 +156,7 @@
<jbossHome>${expr_start}jboss.home${expr_end}</jbossHome>
<serverName>${expr_start}jboss.domain${expr_end}</serverName>
<fileNames>
- <fileName>${expr_start}project.buildDirectory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
+ <fileName>${expr_start}project.build.directory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
</fileNames>
</configuration>
</plugin>
Modified: archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml
===================================================================
--- archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml 2009-12-17 21:54:20 UTC (rev 5339)
+++ archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml 2009-12-17 21:55:11 UTC (rev 5340)
@@ -151,7 +151,7 @@
<jbossHome>${expr_start}jboss.home${expr_end}</jbossHome>
<serverName>${expr_start}jboss.domain${expr_end}</serverName>
<fileNames>
- <fileName>${expr_start}project.buildDirectory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
+ <fileName>${expr_start}project.build.directory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
</fileNames>
</configuration>
</plugin>
@@ -161,7 +161,7 @@
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.0</version>
<configuration>
- <app>${expr_start}project.buildDirectory${expr_end}/${expr_start}build.finalName${expr_end}.war</app>
+ <app>${expr_start}project.build.directory${expr_end}/${expr_start}build.finalName${expr_end}.war</app>
<port>7070</port>
<containerType>web</containerType>
</configuration>
14 years, 11 months
Weld SVN: r5339 - in archetypes/tags/1.0.0-BETA1/jsf: jee-minimal/src/main/resources/archetype-resources and 1 other directory.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 16:54:20 -0500 (Thu, 17 Dec 2009)
New Revision: 5339
Modified:
archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml
archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/pom.xml
Log:
project.buildDirectory should be project.build.directory
Modified: archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/pom.xml
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/pom.xml 2009-12-17 20:01:27 UTC (rev 5338)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/pom.xml 2009-12-17 21:54:20 UTC (rev 5339)
@@ -156,7 +156,7 @@
<jbossHome>${expr_start}jboss.home${expr_end}</jbossHome>
<serverName>${expr_start}jboss.domain${expr_end}</serverName>
<fileNames>
- <fileName>${expr_start}project.buildDirectory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
+ <fileName>${expr_start}project.build.directory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
</fileNames>
</configuration>
</plugin>
Modified: archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml 2009-12-17 20:01:27 UTC (rev 5338)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/pom.xml 2009-12-17 21:54:20 UTC (rev 5339)
@@ -151,7 +151,7 @@
<jbossHome>${expr_start}jboss.home${expr_end}</jbossHome>
<serverName>${expr_start}jboss.domain${expr_end}</serverName>
<fileNames>
- <fileName>${expr_start}project.buildDirectory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
+ <fileName>${expr_start}project.build.directory${expr_end}/${expr_start}build.finalName${expr_end}.war</fileName>
</fileNames>
</configuration>
</plugin>
@@ -161,7 +161,7 @@
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.0</version>
<configuration>
- <app>${expr_start}project.buildDirectory${expr_end}/${expr_start}build.finalName${expr_end}.war</app>
+ <app>${expr_start}project.build.directory${expr_end}/${expr_start}build.finalName${expr_end}.war</app>
<port>7070</port>
<containerType>web</containerType>
</configuration>
14 years, 11 months
Weld SVN: r5338 - in archetypes/tags/1.0.0-BETA1/jsf: jee-minimal/src/main/resources/archetype-resources and 1 other directories.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 15:01:27 -0500 (Thu, 17 Dec 2009)
New Revision: 5338
Modified:
archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt
archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt
archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt
Log:
add note about reliance on JBoss Maven repository
Modified: archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:02 UTC (rev 5337)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:27 UTC (rev 5338)
@@ -23,6 +23,10 @@
you will need to set one up. Alternatively, you can use a Maven command to run
the application in place on an embedded version of GlassFish.
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see https://jira.jboss.org/jira/browse/WELD-222)
+
Deploying the application
=========================
Modified: archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:02 UTC (rev 5337)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:27 UTC (rev 5338)
@@ -22,6 +22,10 @@
you will need to set one up. Alternatively, you can use a Maven command to run
the application in place on an embedded version of GlassFish.
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see https://jira.jboss.org/jira/browse/WELD-222)
+
Deploying the application
=========================
Modified: archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:02 UTC (rev 5337)
+++ archetypes/tags/1.0.0-BETA1/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:27 UTC (rev 5338)
@@ -22,6 +22,10 @@
If you want to deploy the application to a standalone Servlet Container, then
you will need to set one up.
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see https://jira.jboss.org/jira/browse/WELD-222)
+
Deploying the application
=========================
14 years, 11 months
Weld SVN: r5337 - in archetypes/trunk/jsf: jee-minimal/src/main/resources/archetype-resources and 1 other directories.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 15:01:02 -0500 (Thu, 17 Dec 2009)
New Revision: 5337
Modified:
archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt
archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/readme.txt
archetypes/trunk/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt
Log:
add note about reliance on JBoss Maven repository
Modified: archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/readme.txt 2009-12-17 19:42:04 UTC (rev 5336)
+++ archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:02 UTC (rev 5337)
@@ -23,6 +23,10 @@
you will need to set one up. Alternatively, you can use a Maven command to run
the application in place on an embedded version of GlassFish.
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see https://jira.jboss.org/jira/browse/WELD-222)
+
Deploying the application
=========================
Modified: archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 19:42:04 UTC (rev 5336)
+++ archetypes/trunk/jsf/jee-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:02 UTC (rev 5337)
@@ -22,6 +22,10 @@
you will need to set one up. Alternatively, you can use a Maven command to run
the application in place on an embedded version of GlassFish.
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see https://jira.jboss.org/jira/browse/WELD-222)
+
Deploying the application
=========================
Modified: archetypes/trunk/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt
===================================================================
--- archetypes/trunk/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 19:42:04 UTC (rev 5336)
+++ archetypes/trunk/jsf/servlet-minimal/src/main/resources/archetype-resources/readme.txt 2009-12-17 20:01:02 UTC (rev 5337)
@@ -22,6 +22,10 @@
If you want to deploy the application to a standalone Servlet Container, then
you will need to set one up.
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see https://jira.jboss.org/jira/browse/WELD-222)
+
Deploying the application
=========================
14 years, 11 months
Weld SVN: r5336 - in core/trunk/impl/src/main/java/org/jboss/weld: context and 1 other directories.
by weld-commits@lists.jboss.org
Author: dallen6
Date: 2009-12-17 14:42:04 -0500 (Thu, 17 Dec 2009)
New Revision: 5336
Added:
core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java
core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java
core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java
core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java
core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java
core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java
core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java
core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java
core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java
core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java
core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java
Log:
Refactoring of exceptions to remove static references and use common localized message class
Modified: core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,9 +17,6 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* Provides message localization service for the
* {@link javax.enterprise.inject.AmbiguousResolutionException}.
@@ -28,10 +25,9 @@
*/
public class AmbiguousResolutionException extends javax.enterprise.inject.AmbiguousResolutionException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given cause.
@@ -40,7 +36,8 @@
*/
public AmbiguousResolutionException(Throwable throwable)
{
- super(throwable.getLocalizedMessage(), throwable);
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
}
/**
@@ -53,6 +50,18 @@
*/
public <E extends Enum<?>> AmbiguousResolutionException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,23 +17,18 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* A version of {@link javax.enterprise.inject.CreationException} that supports
* message localization.
*
* @author David Allen
- *
*/
public class CreationException extends javax.enterprise.inject.CreationException
{
- private static final long serialVersionUID = 5167626747306493463L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given localized message key and optional
@@ -45,7 +40,7 @@
*/
public <E extends Enum<?>> CreationException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
/**
@@ -59,6 +54,19 @@
*/
public <E extends Enum<?>> CreationException(E key, Throwable throwable, Object... args)
{
- super(messageConveyer.getMessage(key, args), throwable);
+ super(throwable);
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -27,11 +27,6 @@
{
private static final long serialVersionUID = 8014646336322875707L;
- public DeploymentException()
- {
- super();
- }
-
/**
* Creates a new exception with the given localized message key and optional
* arguments for the message.
Modified: core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,9 +17,6 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* This exception is used when the specification calls for an
* {@link java.lang.IllegalArgumentException}.
@@ -29,10 +26,9 @@
public class ForbiddenArgumentException extends IllegalArgumentException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given cause.
@@ -41,7 +37,8 @@
*/
public ForbiddenArgumentException(Throwable throwable)
{
- super(throwable.getLocalizedMessage(), throwable);
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
}
/**
@@ -54,6 +51,18 @@
*/
public <E extends Enum<?>> ForbiddenArgumentException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,9 +17,6 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* This exception is used when the specification calls for an
* {@link java.lang.IllegalStateException}.
@@ -28,10 +25,9 @@
*/
public class ForbiddenStateException extends IllegalStateException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given localized message key and optional
@@ -43,9 +39,9 @@
*/
public <E extends Enum<?>> ForbiddenStateException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
-
+
/**
* Creates a new exception with the given cause.
*
@@ -55,4 +51,16 @@
{
super(cause.getLocalizedMessage(), cause);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,23 +17,18 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* An {@link javax.enterprise.inject.IllegalProductException} with support for
* localized messages in Weld.
*
* @author David Allen
- *
*/
public class IllegalProductException extends javax.enterprise.inject.IllegalProductException
{
- private static final long serialVersionUID = -8200417008899252835L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given localized message key and optional
@@ -45,6 +40,18 @@
*/
public <E extends Enum<?>> IllegalProductException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,9 +17,6 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* Provides message localization service for the
* {@link javax.enterprise.inject.InjectionException}.
@@ -28,10 +25,9 @@
*/
public class InjectionException extends javax.enterprise.inject.InjectionException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given cause.
@@ -40,20 +36,22 @@
*/
public InjectionException(Throwable throwable)
{
- super(throwable.getLocalizedMessage(), throwable);
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
}
/**
* Creates a new exception with an arbitrary message and the cause of the
- * exception. It is not recommended to use this constructor since the
- * message cannot be localized.
+ * exception. It is not recommended to use this constructor since the message
+ * cannot be localized.
*
* @param message The error message
* @param throwable The cause of the exception or wrapped throwable
*/
public InjectionException(String message, Throwable throwable)
{
- super(message, throwable);
+ super(throwable);
+ this.message = new WeldExceptionMessage(message);
}
/**
@@ -66,6 +64,18 @@
*/
public <E extends Enum<?>> InjectionException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,23 +17,18 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* An extended version of {@link java.io.InvalidObjectException} that supports
* localization.
*
* @author David Allen
- *
*/
public class InvalidObjectException extends java.io.InvalidObjectException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given localized message key and optional
@@ -45,7 +40,20 @@
*/
public <E extends Enum<?>> InvalidObjectException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ super(null);
+ message = new WeldExceptionMessage(key, args);
}
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,26 +17,23 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* An exception used for unsupported operations or invocations of operations
* that are invalid in certain contexts.
*
* @author David Allen
- *
*/
public class InvalidOperationException extends UnsupportedOperationException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
- * Default constructor mostly for serialization purposes.
+ * Creates a new exception with no message. Here the stacktrace serves as the
+ * main information since it has the method which was invoked causing this
+ * exception.
*/
public InvalidOperationException()
{
@@ -53,6 +50,18 @@
*/
public <E extends Enum<?>> InvalidOperationException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,9 +17,6 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* Provides message localization service for the
* {@link javax.enterprise.inject.UnproxyableResolutionException}.
@@ -28,10 +25,9 @@
*/
public class UnproxyableResolutionException extends javax.enterprise.inject.UnproxyableResolutionException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given cause.
@@ -40,7 +36,8 @@
*/
public UnproxyableResolutionException(Throwable throwable)
{
- super(throwable.getLocalizedMessage(), throwable);
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
}
/**
@@ -53,7 +50,19 @@
*/
public <E extends Enum<?>> UnproxyableResolutionException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,22 +17,17 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* Provides message localization service for the
* {@link javax.enterprise.inject.UnsatisfiedResolutionException}.
*
* @author David Allen
- *
*/
public class UnsatisfiedResolutionException extends javax.enterprise.inject.UnsatisfiedResolutionException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
/**
* Creates a new exception with the given cause.
@@ -41,7 +36,8 @@
*/
public UnsatisfiedResolutionException(Throwable throwable)
{
- super(throwable.getLocalizedMessage(), throwable);
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
}
/**
@@ -54,7 +50,19 @@
*/
public <E extends Enum<?>> UnsatisfiedResolutionException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,12 +17,8 @@
package org.jboss.weld;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-
import java.util.List;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* A general run-time exception used by the JSR-299 reference implementation Weld.
*
@@ -30,30 +26,19 @@
*/
public class WeldException extends RuntimeException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
-
- private String message = null;
-
+ private WeldExceptionMessage message;
+
/**
- * Default constructor mostly for serialization purposes.
- */
- protected WeldException()
- {
- super();
- }
-
- /**
* Creates a new exception with the given cause.
*
* @param throwable The cause of the exception
*/
public WeldException(Throwable throwable)
{
- super(throwable.getLocalizedMessage(), throwable);
- this.message = throwable.getLocalizedMessage();
+ super(throwable);
+ this.message = new WeldExceptionMessage(throwable.getLocalizedMessage());
}
/**
@@ -66,8 +51,7 @@
*/
public <E extends Enum<?>> WeldException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
- this.message = messageConveyer.getMessage(key, args);
+ this.message = new WeldExceptionMessage(key, args);
}
/**
@@ -81,8 +65,8 @@
*/
public <E extends Enum<?>> WeldException(E key, Throwable throwable, Object... args)
{
- super(messageConveyer.getMessage(key, args), throwable);
- this.message = messageConveyer.getMessage(key, args);
+ super(throwable);
+ this.message = new WeldExceptionMessage(key, args);
}
/**
@@ -105,14 +89,9 @@
}
errorMessage.append(throwable.getLocalizedMessage());
}
- setMessage(errorMessage.toString());
+ this.message = new WeldExceptionMessage(errorMessage.toString());
}
- protected void setMessage(String message)
- {
- this.message = message;
- }
-
@Override
public String getLocalizedMessage()
{
@@ -122,7 +101,7 @@
@Override
public String getMessage()
{
- return message;
+ return message.getAsString();
}
}
Added: core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld;
+
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * The message for exceptions generated by Weld. Each exception contains one
+ * message object which will handle the generation of the string message at the
+ * time the message is needed. This includes localization of the message based
+ * on the settings in the JVM where the {@link java.lang.Throwable#getMessage()}
+ * or {@link java.lang.Throwable#getLocalizedMessage()} methods are invoked.
+ * </p>
+ *
+ * @author David Allen
+ */
+public class WeldExceptionMessage implements Serializable
+{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * The string version of the message. This is only used when the original
+ * message from a wrapped exception is being used. Since it is already
+ * localized, it will simply be stored here and used as the message.
+ */
+ private String message;
+
+ private Enum<?> messageKey;
+ private Object messageArguments[];
+
+ /**
+ * <p>
+ * Creates a new exception message initialized to a static message. Use this
+ * only for messages generated by third-party software, i.e., those which do
+ * not use enumerated message keys.
+ * </p>
+ *
+ * @param message the static message
+ */
+ public WeldExceptionMessage(String message)
+ {
+ // This will not be further localized
+ this.message = message;
+ }
+
+ /**
+ * <p>
+ * Creates a new exception message based on an enumerated message key. This
+ * message will not be localized until it is actually logged or other
+ * software invokes the {@link #getMessage()} method.
+ * </p>
+ *
+ * @param <E> the message key enumeration
+ * @param key the message key from the above enumeration
+ * @param args optional arguments for the message
+ */
+ public <E extends Enum<?>> WeldExceptionMessage(E key, Object... args)
+ {
+ this.messageKey = key;
+ this.messageArguments = args;
+ }
+
+ /**
+ * Generates the localized message for the exception.
+ *
+ * @return exception message as a string
+ */
+ public String getAsString()
+ {
+ String result = message;
+ if (result == null)
+ {
+ try
+ {
+ result = loggerFactory().getMessageConveyor().getMessage(messageKey, messageArguments);
+ }
+ catch (Exception e)
+ {
+ // We want the using exception to be processed, but also include
+ // this one in its message
+ result = "Exception message for key " + messageKey + " not found due to " + e.getLocalizedMessage();
+ }
+ if (result == null)
+ {
+ result = "Exception message for key " + messageKey + " not found";
+ }
+ }
+ return result;
+ }
+}
Property changes on: core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,22 +17,20 @@
package org.jboss.weld.context;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-import ch.qos.cal10n.IMessageConveyor;
+import org.jboss.weld.WeldExceptionMessage;
/**
- * A localized message version of the {@link javax.enterprise.context.ContextNotActiveException}.
+ * A localized message version of the
+ * {@link javax.enterprise.context.ContextNotActiveException}.
*
* @author David Allen
- *
*/
public class ContextNotActiveException extends javax.enterprise.context.ContextNotActiveException
{
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
public ContextNotActiveException(Throwable throwable)
{
@@ -41,6 +39,18 @@
public <E extends Enum<?>> ContextNotActiveException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java 2009-12-17 18:42:33 UTC (rev 5335)
+++ core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java 2009-12-17 19:42:04 UTC (rev 5336)
@@ -17,34 +17,43 @@
package org.jboss.weld.xml;
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-
import javax.enterprise.inject.InjectionException;
-import ch.qos.cal10n.IMessageConveyor;
+import org.jboss.weld.WeldExceptionMessage;
/**
* Used for exceptions from the Weld XML parser and provides localization
* support.
*
* @author David Allen
- *
*/
public class WeldXmlException extends InjectionException
{
- private static final long serialVersionUID = -6716110761385845182L;
+ private static final long serialVersionUID = 2L;
- // Exception messages
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
+ private WeldExceptionMessage message;
public WeldXmlException(Throwable throwable)
{
- super(throwable.getLocalizedMessage(), throwable);
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
}
public <E extends Enum<?>> WeldXmlException(E key, Object... args)
{
- super(messageConveyer.getMessage(key, args));
+ message = new WeldExceptionMessage(key, args);
}
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
}
14 years, 11 months
Weld SVN: r5335 - archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 13:42:33 -0500 (Thu, 17 Dec 2009)
New Revision: 5335
Modified:
archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml
Log:
add EclipseLink properties for generating DDL and logging
Modified: archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml
===================================================================
--- archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml 2009-12-17 18:42:20 UTC (rev 5334)
+++ archetypes/trunk/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml 2009-12-17 18:42:33 UTC (rev 5335)
@@ -6,6 +6,12 @@
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="widgets">
+ <!-- You can force a non-default JPA provider using one of these declarations -->
+ <!--
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+ -->
+
<!-- Use this data source name for JBoss AS -->
<jta-data-source>java:/DefaultDS</jta-data-source>
<!-- Use this data source name for Glassfish -->
@@ -13,10 +19,16 @@
<jta-data-source>jdbc/__default</jta-data-source>
-->
<properties>
+ <!-- Properties for Hibernate (default provider for JBoss AS) -->
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.flush_before_completion" value="true"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+
+ <!-- Properties for EclipseLink (default provider for GlassFish) -->
+ <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
+ <property name="eclipselink.logging.level" value="FINE"/>
+
</properties>
</persistence-unit>
</persistence>
14 years, 11 months
Weld SVN: r5334 - archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-12-17 13:42:20 -0500 (Thu, 17 Dec 2009)
New Revision: 5334
Modified:
archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml
Log:
add EclipseLink properties for generating DDL and logging
Modified: archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml
===================================================================
--- archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml 2009-12-17 18:23:30 UTC (rev 5333)
+++ archetypes/tags/1.0.0-BETA1/jsf/jee/src/main/resources/archetype-resources/src/main/resources/META-INF/persistence.xml 2009-12-17 18:42:20 UTC (rev 5334)
@@ -6,6 +6,12 @@
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="widgets">
+ <!-- You can force a non-default JPA provider using one of these declarations -->
+ <!--
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+ -->
+
<!-- Use this data source name for JBoss AS -->
<jta-data-source>java:/DefaultDS</jta-data-source>
<!-- Use this data source name for Glassfish -->
@@ -13,10 +19,16 @@
<jta-data-source>jdbc/__default</jta-data-source>
-->
<properties>
+ <!-- Properties for Hibernate (default provider for JBoss AS) -->
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.flush_before_completion" value="true"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+
+ <!-- Properties for EclipseLink (default provider for GlassFish) -->
+ <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
+ <property name="eclipselink.logging.level" value="FINE"/>
+
</properties>
</persistence-unit>
</persistence>
14 years, 11 months