Seam SVN: r11346 - in branches/enterprise/JBPAPP_5_0: build and 4 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-05 08:24:08 -0400 (Wed, 05 Aug 2009)
New Revision: 11346
Removed:
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Guice.xml
branches/enterprise/JBPAPP_5_0/examples/guice/
branches/enterprise/JBPAPP_5_0/src/ioc/org/jboss/seam/ioc/guice/
Modified:
branches/enterprise/JBPAPP_5_0/build.xml
branches/enterprise/JBPAPP_5_0/build/ioc.pom.xml
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/master.xml
branches/enterprise/JBPAPP_5_0/examples/build.xml
branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml
Log:
JBPAPP-2359 - removed guice integration and example from seam
Modified: branches/enterprise/JBPAPP_5_0/build/ioc.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/ioc.pom.xml 2009-08-05 11:20:33 UTC (rev 11345)
+++ branches/enterprise/JBPAPP_5_0/build/ioc.pom.xml 2009-08-05 12:24:08 UTC (rev 11346)
@@ -54,40 +54,6 @@
</dependency>
<dependency>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice</artifactId>
- <optional>true</optional>
- </dependency>
-
- <!-- Microcontainer stuff isn't done -->
-
- <!-- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-system</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <optional>true</optional>
- </dependency>
-
- -->
-
- <dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<optional>true</optional>
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2009-08-05 11:20:33 UTC (rev 11345)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2009-08-05 12:24:08 UTC (rev 11346)
@@ -787,12 +787,6 @@
</exclusion>
</exclusions>
</dependency>
-
- <dependency>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice</artifactId>
- <version>1.0</version>
- </dependency>
<dependency>
<groupId>cglib</groupId>
Modified: branches/enterprise/JBPAPP_5_0/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build.xml 2009-08-05 11:20:33 UTC (rev 11345)
+++ branches/enterprise/JBPAPP_5_0/build.xml 2009-08-05 12:24:08 UTC (rev 11346)
@@ -365,7 +365,6 @@
<cleanexample name="seamdiscs" />
<cleanexample name="seambay" />
<cleanexample name="nestedbooking" />
- <cleanexample name="guice" />
</target>
<target name="undeployexamples" description="Undeploy all examples">
@@ -394,7 +393,6 @@
<undeployexample name="seamdiscs" />
<undeployexample name="seambay" />
<undeployexample name="nestedbooking" />
- <undeployexample name="guice" />
</target>
<target name="testexamples" description="Run the example tests">
@@ -419,7 +417,6 @@
<testexample name="hibernate" />
<testexample name="jpa" />
<testexample name="quartz" />
- <testexample name="guice" />
</target>
<!-- ########################## 'ALL' TARGETS ##########################-->
@@ -456,8 +453,6 @@
<ant dir="examples/seamspace" target="validateConfiguration" inheritall="false" />
<ant dir="examples/todo" target="validateConfiguration" inheritall="false" />
<ant dir="examples/ui" target="validateConfiguration" inheritall="false" />
- <ant dir="examples/guice" target="validateConfiguration" inheritall="false" />
-
</target>
@@ -551,7 +546,6 @@
<include name="todo/**/*" />
<include name="numberguess/**/*" />
<include name="groovybooking/**/*" />
- <include name="guice/**/*" />
<include name="seamdiscs/**/*" />
<include name="quartz/**/*" />
<include name="drools/**/*" />
Deleted: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Guice.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Guice.xml 2009-08-05 11:20:33 UTC (rev 11345)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/Guice.xml 2009-08-05 12:24:08 UTC (rev 11346)
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
-
-<chapter id="guice">
-
- <title>Guice integration</title>
-
- <para>
- Google Guice is a library that provides lightweight dependency injection through type-safe
- resolution. The Guice integration (part of the Seam IoC module) allows use of Guice injection
- for all Seam components annotated with the <literal>@Guice</literal> annotation. In addition
- to the regular bijection that Seam performs (which becomes optional), Seam also delegates
- to known Guice injectors to satisify the dependencies of the component. Guice may be useful to
- tie non-Seam parts of large or legacy applications together with Seam.
- </para>
-
- <note>
- The Guice integration is bundled in the jboss-seam-ioc library. This dependency is required
- for all integration techniques covered in this chapter. You will also need the Guice JAR file
- on the classpath.
- </note>
-
- <section>
- <title>Creating a hybrid Seam-Guice component</title>
-
- <para>
- The goal is to create a hybrid Seam-Guice component. The rule for how to do this is very
- simple. If you want to use Guice injection in your Seam component, annotate it with the
- <literal>@Guice</literal> annotation (after importing the type
- <literal>org.jboss.seam.ioc.guice.Guice</literal>).
- </para>
-
- <programlisting role="JAVA">@Name("myGuicyComponent")
-@Guice public class MyGuicyComponent
-{
- @Inject MyObject myObject;
- @Inject @Special MyObject mySpecialObject;
- ...
-}</programlisting>
-
- <para>
- This Guice injection will happen on every method call, just like with bijection. Guice
- injects based on type and binding. To satisify the dependencies in the previous example,
- you might have bound the following implementations in a Guice module, where
- <literal>@Special</literal> is an annotation you define in your application.
- </para>
-
- <programlisting role="JAVA">public class MyGuicyModule implements Module
-{
- public void configure(Binder binder)
- {
- binder.bind(MyObject.class)
- .toInstance(new MyObject("regular"));
-
- binder.bind(MyObject.class).annotatedWith(Special.class)
- .toInstance(new MyObject("special"));
- }
-}</programlisting>
-
- <para>
- Great, but which Guice injector will be used to inject the dependencies? Well, you need
- to perform some setup first.
- </para>
-
- </section>
-
- <section>
-
- <title>Configuring an injector</title>
-
- <para>
- You tell Seam which Guice injector to use by hooking it into the injection property
- of the Guice initization component in the Seam component descriptor (components.xml):
- </para>
-
- <programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:guice="http://jboss.org/products/seam/guice"
- xsi:schemaLocation="
- http://jboss.com/products/seam/guice
- http://jboss.com/products/seam/guice-2.2.xsd
- http://jboss.com/products/seam/components
- http://jboss.com/products/seam/components-2.2.xsd">
-
- <guice:init injector="#{myGuiceInjector}"/>
-
-</components>]]></programlisting>
-
- <para>
- <literal>myGuiceInjector</literal> must resolve to a Seam component that implements the
- Guice <literal>Injector</literal> interface.
- </para>
-
- <para>
- Having to create an injector is boiler-plate code, though. What you really want to be able
- to do is simply hook up Seam to your Guice modules. Fortunately, there is a built-in Seam
- component that implements the <literal>Injector</literal> interface to do exactly that. You
- can configure it in the Seam component descriptor with this additional stanza.
- </para>
-
- <programlisting role="XML"><![CDATA[<guice:injector name="myGuiceInjector">
- <guice:modules>
- <value>com.example.guice.GuiceModule1</value>
- <value>com.example.guice.GuiceModule2</value>
- </guice:modules>
-</guice:injector>]]></programlisting>
-
- <para>
- Of course you can also use an injector that is already used in other, possibly non-Seam
- part of you application. That's one of the main motivations for creating this integration.
- Since the injector is defined with EL expression, you can obtain it in whatever way you
- like. For instance, you may use the Seam factory component pattern to provide injector.
- </para>
-
- <programlisting role="JAVA">@Name("myGuiceInjectorFactory")
-public InjectorFactory
-{
- @Factory(name = "myGuiceInjector", scope = APPLICATION, create = true)
- public Injector getInjector()
- {
- // Your code that returns injector
- }
-}</programlisting>
-
- </section>
-
- <section>
- <title>Using multiple injectors</title>
-
- <para>
- By default, an injector configured in the Seam component descriptor is used. If you really
- need to use multiple injectors (AFAIK, you should use multiple modules instead), you can
- specify different injector for every Seam component in the <literal>@Guice</literal>
- annotation.
- </para>
-
- <programlisting role="JAVA">@Name("myGuicyComponent")
-@Guice("myGuiceInjector")
-public class MyGuicyComponent
-{
- @Inject MyObject myObject;
- ...
-}</programlisting>
-
- </section>
-
- <para>
- That's all there is to it! Check out the guice example in the Seam distribution to see the
- Seam Guice integration in action!
- </para>
-
-</chapter>
Modified: branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/master.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/master.xml 2009-08-05 11:20:33 UTC (rev 11345)
+++ branches/enterprise/JBPAPP_5_0/doc/Seam_Reference_Guide/en-US/master.xml 2009-08-05 12:24:08 UTC (rev 11346)
@@ -29,7 +29,6 @@
<xi:include href="Remoting.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Gwt.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Spring.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Guice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Hsearch.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Annotations.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: branches/enterprise/JBPAPP_5_0/examples/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/build.xml 2009-08-05 11:20:33 UTC (rev 11345)
+++ branches/enterprise/JBPAPP_5_0/examples/build.xml 2009-08-05 12:24:08 UTC (rev 11346)
@@ -188,12 +188,6 @@
<include name="jboss-seam-remoting.jar" if="seam.remoting.lib" />
</fileset>
- <!-- Seam IoC Guice, with required dependencies -->
- <fileset id="seam.ioc-guice.jar" dir="${lib.dir}">
- <include name="jboss-seam-ioc.jar" if="seam.ioc-guice.lib" />
- <include name="guice.jar" if="seam.ioc-guice.lib" />
- </fileset>
-
<!-- jboss-el -->
<fileset id="jboss-el.jar" dir="${lib.dir}">
<include name="jboss-el.jar" />
@@ -680,7 +674,6 @@
<fileset refid="jcaptcha.jar" />
<fileset refid="antlr.jar" />
<fileset refid="seam.remoting.jar" />
- <fileset refid="seam.ioc-guice.jar" />
<fileset refid="el-ri.jar" />
<fileset refid="trinidad-api.jar" />
<fileset refid="metawidget-backend.jar" />
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml 2009-08-05 11:20:33 UTC (rev 11345)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/ivy/ivy-build.xml 2009-08-05 12:24:08 UTC (rev 11346)
@@ -12,7 +12,7 @@
<property name="seam.version" value="2.1.2"/>
<property name="jsf.version" value="1.2_12"/>
<property name="richfaces.version" value="3.3.1.GA"/>
- <property name="jboss-embedded.version" value="beta3.SP8"/>
+ <property name="jboss-embedded.version" value="beta3.SP9"/>
<target name="init-ivy">
<available property="ivy.installed" value="true" file="${ivy.jar.file}" type="file"/>
15 years, 4 months
Seam SVN: r11345 - branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seambay.
by seam-commits@lists.jboss.org
Author: kpiwko(a)redhat.com
Date: 2009-08-05 07:20:33 -0400 (Wed, 05 Aug 2009)
New Revision: 11345
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seambay/build.xml
Log:
Fixes JBPAPP-2373
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seambay/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seambay/build.xml 2009-08-05 10:08:10 UTC (rev 11344)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seambay/build.xml 2009-08-05 11:20:33 UTC (rev 11345)
@@ -22,7 +22,7 @@
-->
<project name="seambay.ftest.build" basedir="." default="build">
<property name="example.name" value="seambay" />
- <property name="jboss4.context.path" value="/seam-bay" />
+ <property name="jboss5.context.path" value="/seam-bay" />
<property name="jboss-embedded.context.path" value="/jboss-seam-bay" />
<property name="tomcat6.context.path" value="/jboss-seam-bay" />
15 years, 4 months
Seam SVN: r11343 - branches/community/Seam_2_2/src/pdf/org/jboss/seam/pdf/ui.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-08-04 20:20:12 -0400 (Tue, 04 Aug 2009)
New Revision: 11343
Modified:
branches/community/Seam_2_2/src/pdf/org/jboss/seam/pdf/ui/UIFont.java
Log:
JBSEAM-2369
Modified: branches/community/Seam_2_2/src/pdf/org/jboss/seam/pdf/ui/UIFont.java
===================================================================
--- branches/community/Seam_2_2/src/pdf/org/jboss/seam/pdf/ui/UIFont.java 2009-08-04 18:37:16 UTC (rev 11342)
+++ branches/community/Seam_2_2/src/pdf/org/jboss/seam/pdf/ui/UIFont.java 2009-08-05 00:20:12 UTC (rev 11343)
@@ -6,7 +6,7 @@
public class UIFont extends ITextComponent
{
- public static final String COMPONENT_TYPE = "org.jboss.seam.pdf.ui.UIParagraph";
+ public static final String COMPONENT_TYPE = "org.jboss.seam.pdf.ui.UIFont";
Font font;
@@ -15,6 +15,7 @@
int size = Font.UNDEFINED;
String style;
String color;
+ boolean embedded = false;
public String getName()
{
@@ -70,6 +71,14 @@
{
this.color = color;
}
+
+ public boolean getEmbedded() {
+ return (Boolean) valueBinding("embedded", embedded);
+ }
+
+ public void setEmbedded(boolean embedded) {
+ this.embedded = embedded;
+ }
@Override
public Font getFont()
@@ -92,22 +101,17 @@
@Override
public void createITextObject(FacesContext context)
{
- if (encoding == null)
- {
+ if (encoding == null) {
font = FontFactory.getFont(getName(), getSize());
+ } else {
+ font = FontFactory.getFont(getName(), getEncoding(), getEmbedded(), getSize());
}
- else
- {
- font = FontFactory.getFont(getName(), getEncoding(), getSize());
- }
-
- if (getStyle() != null)
- {
+
+ if (getStyle() != null) {
font.setStyle(getStyle());
}
-
- if (getColor() != null)
- {
+
+ if (getColor() != null) {
font.setColor(ITextUtils.colorValue(getColor()));
}
}
15 years, 4 months
Seam SVN: r11342 - branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-08-04 14:37:16 -0400 (Tue, 04 Aug 2009)
New Revision: 11342
Added:
branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java
Modified:
branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java
Log:
JBSEAM-2082
Modified: branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java
===================================================================
--- branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java 2009-08-04 14:57:20 UTC (rev 11341)
+++ branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java 2009-08-04 18:37:16 UTC (rev 11342)
@@ -18,8 +18,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Context;
-import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
@@ -33,9 +31,6 @@
@Install(value = false, precedence=BUILT_IN)
public class SubscriptionRegistry
{
- public static final String CONTEXT_USER_TOKENS =
- "org.jboss.seam.remoting.messaging.SubscriptionRegistry.userTokens";
-
private static final LogProvider log = Logging.getLogProvider(SubscriptionRegistry.class);
private String connectionProvider;
@@ -131,30 +126,35 @@
}
}
- /**
- *
- * @return Set
- */
- public Set getUserTokens()
+ public UserTokens getUserTokens()
{
- Context session = Contexts.getSessionContext();
- if (session.get(CONTEXT_USER_TOKENS) == null)
- {
- synchronized(session)
- {
- if (session.get(CONTEXT_USER_TOKENS) == null)
- session.set(CONTEXT_USER_TOKENS, new HashSet<String> ());
- }
- }
- return (Set) session.get(CONTEXT_USER_TOKENS);
+ return (UserTokens) Component.getInstance(UserTokens.class);
}
public RemoteSubscriber getSubscription(String token)
{
- if (!getUserTokens().contains(token))
- throw new IllegalArgumentException(
- "Invalid token argument - token not found in Session Context.");
-
+ if (!getUserTokens().contains(token)) {
+ throw new IllegalArgumentException("Invalid token argument - token not found in Session Context.");
+ }
+
return subscriptions.get(token);
}
+
+ public Set<String> getAllTokens() {
+ return subscriptions.keySet();
+ }
+
+ public void cleanupTokens(Set<String> tokens)
+ {
+ for (String token: tokens) {
+ RemoteSubscriber subscriber = subscriptions.remove(token);
+ if (subscriber!=null) {
+ try {
+ subscriber.unsubscribe();
+ } catch (Exception e) {
+ log.debug("problem cleaning up subcription", e);
+ }
+ }
+ }
+ }
}
Added: branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java
===================================================================
--- branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java (rev 0)
+++ branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java 2009-08-04 18:37:16 UTC (rev 11342)
@@ -0,0 +1,33 @@
+package org.jboss.seam.remoting.messaging;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("org.jboss.seam.remoting.messaging.SubscriptionRegistry.userTokens")
+(a)Scope(ScopeType.SESSION)
+public class UserTokens
+{
+ Set<String> tokens = new HashSet<String>();
+
+ public void add(String token) {
+ tokens.add(token);
+ }
+
+ public boolean contains(String token) {
+ return tokens.contains(token);
+ }
+
+ public void remove(String token) {
+ tokens.remove(token);
+ }
+
+ @Destroy
+ public void cleanUp() {
+ SubscriptionRegistry.instance().cleanupTokens(tokens);
+ }
+}
15 years, 4 months
Seam SVN: r11341 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-04 10:57:20 -0400 (Tue, 04 Aug 2009)
New Revision: 11341
Modified:
branches/enterprise/JBPAPP_5_0/build/common.build.xml
Log:
JBPAPP-2356
Modified: branches/enterprise/JBPAPP_5_0/build/common.build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/common.build.xml 2009-08-04 13:51:49 UTC (rev 11340)
+++ branches/enterprise/JBPAPP_5_0/build/common.build.xml 2009-08-04 14:57:20 UTC (rev 11341)
@@ -23,7 +23,7 @@
<property name="maven.settings.xml" location="${build.dir}/settings.xml" />
- <property name="embedded.version" value="beta3.SP8" />
+ <property name="embedded.version" value="beta3.SP9" />
<import file="${build.dir}/utilities.build.xml" />
15 years, 4 months
Seam SVN: r11340 - in branches/enterprise/JBPAPP_5_0/seam-gen: ide-project-files/eclipse and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-04 09:51:49 -0400 (Tue, 04 Aug 2009)
New Revision: 11340
Modified:
branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build-war.xml
branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build.xml
branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/eclipse/.classpath
branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/idea/module.iml
branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/netbeans/project.xml
Log:
JBPAPP-2357
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build-war.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build-war.xml 2009-08-04 13:44:52 UTC (rev 11339)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build-war.xml 2009-08-04 13:51:49 UTC (rev 11340)
@@ -28,7 +28,7 @@
<property name="deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy" />
<property name="war.deploy.dir" value="${deploy.dir}/${project.name}.war" />
<property name="packaged.archive" value="${dist.dir}/${project.name}.war"/>
- <property name="testng.jar" value="${basedir}/lib/testng.jar" />
+ <property name="testng.jar" value="${basedir}/lib/testng-jdk15.jar" />
<property name="javac.debug" value="true" />
<property name="javac.deprecation" value="false" />
<property name="debug" value="false" />
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build.xml 2009-08-04 13:44:52 UTC (rev 11339)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/build-scripts/build.xml 2009-08-04 13:51:49 UTC (rev 11340)
@@ -29,7 +29,7 @@
<property name="jar.deploy.dir" value="${ear.deploy.dir}/${project.name}.jar"/>
<property name="war.deploy.dir" value="${ear.deploy.dir}/${project.name}.war"/>
<property name="packaged.archive" value="${dist.dir}/${project.name}.ear"/>
- <property name="testng.jar" value="${basedir}/lib/testng.jar"/>
+ <property name="testng.jar" value="${basedir}/lib/testng-jdk15.jar"/>
<property name="javac.debug" value="true"/>
<property name="javac.deprecation" value="false"/>
<property name="debug" value="false"/>
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/eclipse/.classpath
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/eclipse/.classpath 2009-08-04 13:44:52 UTC (rev 11339)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/eclipse/.classpath 2009-08-04 13:51:49 UTC (rev 11340)
@@ -20,7 +20,7 @@
<classpathentry kind="lib" path="lib/jsf-facelets.jar"/>
<classpathentry kind="lib" path="lib/jsf-api.jar"/>
<classpathentry kind="lib" path="lib/servlet-api.jar"/>
- <classpathentry kind="lib" path="lib/testng.jar"/>
+ <classpathentry kind="lib" path="lib/testng-jdk15.jar"/>
<classpathentry kind="lib" path="lib/jboss-el.jar"/>
<classpathentry kind="lib" path="lib/el-api.jar"/>
<classpathentry kind="lib" path="lib/mvel2.jar"/>
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/idea/module.iml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/idea/module.iml 2009-08-04 13:44:52 UTC (rev 11339)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/idea/module.iml 2009-08-04 13:51:49 UTC (rev 11340)
@@ -209,7 +209,7 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/lib/testng.jar!/" />
+ <root url="jar://$MODULE_DIR$/lib/testng-jdk15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/netbeans/project.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/netbeans/project.xml 2009-08-04 13:44:52 UTC (rev 11339)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/ide-project-files/netbeans/project.xml 2009-08-04 13:51:49 UTC (rev 11340)
@@ -107,7 +107,7 @@
<compilation-unit>
<package-root>src/test</package-root>
<unit-tests/>
- <classpath mode="compile">bootstrap:lib/hibernate-validator.jar:lib/hibernate-core.jar:lib/hibernate-annotations.jar:lib/hibernate-commons-annotations.jar:lib/hibernate-entitymanager.jar:lib/jboss-seam.jar:lib/jboss-seam-debug.jar:lib/jboss-cache.jar:lib/jbpm-jpdl.jar:lib/antlr.jar:lib/jgroups.jar:lib/jsf-facelets.jar:lib/jstl.jar:lib/jsf-api.jar:lib/servlet-api.jar:lib/testng.jar:lib/jboss-el.jar:lib/el-api.jar:lib/mvel2.jar:lib/drools-api.jar:lib/drools-core.jar:lib/drools-compiler.jar:lib/janino.jar:lib/antlr-runtime.jar:lib/mail.jar:lib/persistence-api.jar:lib/ejb-api.jar:lib/jsr250-api.jar:lib/jta.jar:lib/core.jar:lib/jboss-embedded-api.jar:lib/hibernate-search.jar:lib/richfaces-api.jar:lib/@driverJar@:lib/lucene-core.jar</classpath>
+ <classpath mode="compile">bootstrap:lib/hibernate-validator.jar:lib/hibernate-core.jar:lib/hibernate-annotations.jar:lib/hibernate-commons-annotations.jar:lib/hibernate-entitymanager.jar:lib/jboss-seam.jar:lib/jboss-seam-debug.jar:lib/jboss-cache.jar:lib/jbpm-jpdl.jar:lib/antlr.jar:lib/jgroups.jar:lib/jsf-facelets.jar:lib/jstl.jar:lib/jsf-api.jar:lib/servlet-api.jar:lib/testng-jdk15.jar:lib/jboss-el.jar:lib/el-api.jar:lib/mvel2.jar:lib/drools-api.jar:lib/drools-core.jar:lib/drools-compiler.jar:lib/janino.jar:lib/antlr-runtime.jar:lib/mail.jar:lib/persistence-api.jar:lib/ejb-api.jar:lib/jsr250-api.jar:lib/jta.jar:lib/core.jar:lib/jboss-embedded-api.jar:lib/hibernate-search.jar:lib/richfaces-api.jar:lib/@driverJar@:lib/lucene-core.jar</classpath>
<source-level>1.5</source-level>
</compilation-unit>
</java-data>
15 years, 4 months
Seam SVN: r11339 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-04 09:44:52 -0400 (Tue, 04 Aug 2009)
New Revision: 11339
Modified:
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
Log:
JBPAPP-2356
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2009-08-04 12:50:20 UTC (rev 11338)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2009-08-04 13:44:52 UTC (rev 11339)
@@ -762,7 +762,7 @@
<dependency>
<groupId>org.jboss.seam.embedded</groupId>
<artifactId>jboss-embedded-api</artifactId>
- <version>beta3.SP8</version>
+ <version>beta3.SP9</version>
</dependency>
<dependency>
15 years, 4 months
Seam SVN: r11337 - branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-04 08:39:01 -0400 (Tue, 04 Aug 2009)
New Revision: 11337
Modified:
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/form.xhtml
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/list.xhtml.ftl
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/login.xhtml
branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/view.xhtml.ftl
Log:
JBPAPP-2218
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/form.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/form.xhtml 2009-08-03 20:59:44 UTC (rev 11336)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/form.xhtml 2009-08-04 12:39:01 UTC (rev 11337)
@@ -10,8 +10,6 @@
template="layout/template.xhtml">
<ui:define name="body">
-
- <h:messages globalOnly="true" styleClass="message"/>
<h:form id="@componentName@Form">
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/list.xhtml.ftl
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/list.xhtml.ftl 2009-08-03 20:59:44 UTC (rev 11336)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/list.xhtml.ftl 2009-08-04 12:39:01 UTC (rev 11337)
@@ -18,9 +18,7 @@
template="layout/template.xhtml">
<ui:define name="body">
-
- <![CDATA[<h:messages globalOnly="true" styleClass="message" id="globalMessages"/>]]>
-
+
<h:form id="${componentName}Search" styleClass="edit">
<rich:simpleTogglePanel label="${entityName} Search Filter" switchType="ajax">
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/login.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/login.xhtml 2009-08-03 20:59:44 UTC (rev 11336)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/login.xhtml 2009-08-04 12:39:01 UTC (rev 11337)
@@ -9,9 +9,7 @@
template="layout/template.xhtml">
<ui:define name="body">
-
-<!-- <h:messages styleClass="message"/>-->
-
+
<h:form id="loginForm">
<rich:panel>
Modified: branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/view.xhtml.ftl
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/view.xhtml.ftl 2009-08-03 20:59:44 UTC (rev 11336)
+++ branches/enterprise/JBPAPP_4_3_FP01/seam-gen/view/view.xhtml.ftl 2009-08-04 12:39:01 UTC (rev 11337)
@@ -17,8 +17,6 @@
<ui:define name="body">
- <![CDATA[<h:messages globalOnly="true" styleClass="message" id="globalMessages"/>]]>
-
<rich:panel>
<f:facet name="header">${label(entityName)} Details</f:facet>
<#foreach property in pojo.allPropertiesIterator>
15 years, 4 months
Seam SVN: r11336 - in branches/community/Seam_2_2: examples/jee5 and 8 other directories.
by seam-commits@lists.jboss.org
Author: denis.forveille
Date: 2009-08-03 16:59:44 -0400 (Mon, 03 Aug 2009)
New Revision: 11336
Added:
branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/seam.properties
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml
branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java
Modified:
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml
branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml
branches/community/Seam_2_2/examples/jee5/readme.txt
Log:
WebSpehre v7 jee5/booking sample rework + WebSphere v7 documentation chapter rework
JBSEAM-4324
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml 2009-08-03 13:45:14 UTC (rev 11335)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -64,6 +64,10 @@
<surname>Orshalick</surname>
</author>
<author>
+ <firstname>Denis</firstname>
+ <surname>Forveille</surname>
+ </author>
+ <author>
<firstname>Marek</firstname>
<surname>Novotny</surname>
</author>
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml 2009-08-03 13:45:14 UTC (rev 11335)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -1,782 +1,638 @@
<chapter id="websphere">
- <title>Seam on IBM's Websphere AS</title>
+ <title>Seam on IBM's WebSphere AS v7</title>
+
+ <section>
+ <title>WebSphere AS environment and version recommendation</title>
+
+ <para>
+ WebSphere Application Server v7 is IBM's application server offering.
+ This release is fully Java EE 5 certified.
+ </para>
+
+ <para>
+ WebSphere AS being a commercial product, we will not discuss the
+ details of its installation. At best, we will instruct you to follow the directions
+ provided by your particular installation type and license.
+ </para>
+
+ <para>
+ First, we will go over some basic considerations on how to run Seam applications under WebSphere AS v7.
+ We will go over the details of these steps using the JEE5 booking example.
+ We will also deploy the JPA (non-EJB3) example application.
+ </para>
+
+ <para>
+ All of the examples and information in this chapter are based on
+ WebSphere AS v7. A trial version can be downloaded here :
+ <ulink url="http://www.ibm.com/developerworks/downloads/ws/was"> WebSphere Application Server V7</ulink>
+ </para>
+ <para>
+ WebSphere v7.0.0.3 is the minimal recommended version of WebSphere v7 to use
+ with Seam. Earlier versions of WebSphere have bugs in the EJB container that will
+ cause various exceptions to occur at runtime.
+ </para>
+
+ <para>
+ The following sections in this chapter assume that WebSphere is correctly installed and is
+ functional, and a profile has been successfully created.
+ </para>
+
+ <para>
+ This chapter explain how to compile, deploy and run some sample applications in WebSphere. These sample applications require
+ a database. WebSphere comes by default with a set of sample applications called "Default Application". This set of sample applications
+ use a Derby database running on the Derby instance installed with WebSphere. In order to keep this simple we'll use this Derby database created
+ for the "Default Applications". However, to run the sample application with the Derby database "as-is", a patched Hibernate
+ dialect must be used (The patch changes the default "auto" key generation strategy) as explained in <xref linkend="glassfish" />.
+ If you want to use another database, it's just a matter of creating a connection pool in WebSphere pointing to this database,
+ declare the correct Hibernate dialect and set the correct JNDI name in <literal>persistence.xml</literal>.
+ </para>
+ </section>
- <para>Websphere AS V7 is IBM's application server offering. This release is
- fully Java EE 5 certified.</para>
-
- <para>First we will go over some basic information about the Websphere AS
- environment that we used for these examples. We will
- go over the details of those steps with the JEE5 booking example. We will also deploy
- the JPA example application. </para>
-
+
<section>
- <title>Websphere AS environment and deployment information</title>
+ <title>Configuring the WebSphere Web Container</title>
+ <para>
+ This step is mandatory in order to have Seam applications run with WebSphere v7.
+ Two extra properties must be added to the Web Container. Please refer to the IBM WebSphere Information Center for further explanations on those properties.
+ </para>
+ <para>
+ To add the extra properties:
+ <itemizedlist>
+ <listitem>
+ Open the WebSphere administration console
+ </listitem>
+ <listitem>
+ Select the <literal>Servers/Server Types/WebSphere Application Servers</literal> in the left navigation menu
+ </listitem>
+ <listitem>
+ Click on the server name (<literal>server1</literal>)
+ </listitem>
+ <listitem>
+ On the right navigation menu, select <literal>Web Container Settings/Web container</literal>)
+ </listitem>
+ <listitem>
+ On the right navigation menu, select <literal>custom properties</literal>) and add the following properties:
+ <itemizedlist>
+ <listitem>
+ <literal>prependSlashToResource = true</literal>
+ </listitem>
+ <listitem>
+ <literal>com.ibm.ws.webcontainer.invokefilterscompatibility = true</literal>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ Save and restart the server
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="websphere-jndi-section">
+ <title>Seam and the WebSphere JNDI name space</title>
+ <para>
+ In order to use component injection, Seam needs to know how to lookup for session beans bound to the JNDI name space.
+ Seam provides two mechanisms to configure the way it will search for such resources:
+ <itemizedlist>
+ <listitem>
+ The global <literal>jndi-pattern</literal> switch on the <literal><core:init></literal>. in <literal>components.xml</literal>.
+ The switch can use a special placeholder "<literal>#{ejbName}</literal>" that resolves to the unqualified name of the EJB
+ </listitem>
+ <listitem>
+ <para>
+ The <literal>@JndiName</literal> annotation
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <xref linkend="config.integration.ejb.container"/> gives detailed explanations on how those mechanisms work.
+ </para>
- <para>Websphere AS is a commercial product and so we will not discuss the
- details of its installation other than to say follow the directions
- provided by your particular installation type and license. This
- section will detail the exact server versions used, installation tips,
- and some custom properties that are needed for all of the
- examples.</para>
-
+ <para>
+ By default, WebSphere will bind the session bean in
+ its local JNDI name space under a "short" binding name that adheres to the following pattern
+ <literal>ejblocal:<package.qualified.local.interface.name></literal>.
+ </para>
+ <para>
+ For a detailed description on how WebSphere v7 organizes and binds EJBs in its JNDI name spaces, please refer to the WebSphere Information Center.
+ </para>
+ <para>
+ As explained before, Seam needs to lookup for session bean as they appear in JNDI.
+ Basically, there are three strategies, in order of complexity:
+ <itemizedlist>
+ <listitem>
+ Specify which JNDI name Seam must use for each session bean using the <literal>@JndiName</literal> annotation in the java source file
+ </listitem>
+ <listitem>
+ Override the default session bean names generated by WebSphere to conform to the <literal>jndi-pattern</literal> attribute
+ </listitem>
+ <listitem>
+ Use EJB references
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <section id="was.strategy1">
+ <title>Strategy 1: Specify which JNDI name Seam must use for each Session Bean</title>
+ <para>
+ This strategy is the simplest and fastest one regarding development. It uses the WebSphere v7 default binding mechanism. To use this strategy:
+ <itemizedlist>
+ <listitem>
+ Add a <literal>@JndiName("ejblocal:<package.qualified.local.interface.name>)</literal> annotation to each session bean that is a Seam component.
+ </listitem>
+ <listitem>
+ <para>
+ In <literal>components.xml</literal>, add the following line:
+ <programlisting role="XML"><![CDATA[<core:init jndi-name="java:comp/env/#{ejbName}" />]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para >
+ Add a file named <literal>WEB-INF/classes/seam-jndi.properties</literal> in the web module with the following content:
+ <programlisting>com.ibm.websphere.naming.hostname.normalizer=com.ibm.ws.naming.util.DefaultHostnameNormalizer
+java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
+com.ibm.websphere.naming.name.syntax=jndi
+com.ibm.websphere.naming.namespace.connection=lazy
+com.ibm.ws.naming.ldap.ldapinitctxfactory=com.sun.jndi.ldap.LdapCtxFactory
+com.ibm.websphere.naming.jndicache.cacheobject=populated
+com.ibm.websphere.naming.namespaceroot=defaultroot
+com.ibm.ws.naming.wsn.factory.initial=com.ibm.ws.naming.util.WsnInitCtxFactory
+com.ibm.websphere.naming.jndicache.maxcachelife=0
+com.ibm.websphere.naming.jndicache.maxentrylife=0
+com.ibm.websphere.naming.jndicache.cachename=providerURL
+java.naming.provider.url=corbaloc:rir:/NameServiceServerRoot
+java.naming.factory.url.pkgs=com.ibm.ws.runtime:com.ibm.ws.naming</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ At the end of <literal>web.xml</literal>, add the following lines:
+ <programlisting role="XML"><![CDATA[<ejb-local-ref>
+ <ejb-ref-name>EjbSynchronizations</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <local-home></local-home>
+ <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
+ </ejb-local-ref>]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ That's all folks! No need to update any file during the development, nor to define any EJB to EJB or web to EJB reference!
+ </para>
+ <para>
+ Compared to the other strategies, this strategy has the advantage not to have to manage any EJBs reference and also not to have to maintain extra files.
+ The only drawback is one extra line in the java source code with the <literal>@JndiName</literal> annotation
+ </para>
+ </section>
+
<section>
- <title>Installation versions</title>
- <para>All of the examples and information in this chapter are based on
- the version V7 of Websphere AS at the time of this writing.
- <itemizedlist>
- <listitem>
- <para><ulink
- url="http://www.ibm.com/developerworks/downloads/ws/was">
- Websphere Application Server V7</ulink></para>
- </listitem>
- </itemizedlist> </para>
-
- <para>After installing Websphere AS, create server profile with Profile Management Tool, if you
- didn't create profile in installation process.
- </para>
+ <title>Strategy 2: Override the default names generated by WebSphere</title>
+ There is no simple way to globally override the default naming strategy for session beans in WebSphere.
+ However, WebSphere provides a way to override the name of each bean.
+ <para>
+ To use this strategy:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Add a file named <literal>META-INF/ibm-ejb-jar-ext.xml</literal> in the EJB module and add an entry for each session bean like this:
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar-bnd
+ xmlns="http://websphere.ibm.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
+ http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd"
+ version="1.0">
+
+ <session name="AuthenticatorAction" simple-binding-name="AuthenticatorAction" />
+ <session name="BookingListAction" simple-binding-name="BookingListAction" />
+
+</ejb-jar-bnd>]]></programlisting>
+ WebSphere will then bind the <literal>AuthenticatorAction</literal> EJB to the <literal>ejblocal:AuthenticatorAction</literal> JNDI name
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ In <literal>components.xml</literal>, add the following line:
+ <programlisting role="XML"><![CDATA[<core:init jndi-name="ejblocal:#{ejbName}" />]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add a file named <literal>WEB-INF/classes/seam-jndi.properties</literal> as described in strategy 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ In <literal>web.xml</literal>, add the following lines (Note the different <literal>ejb-ref-name</literal> value):
+ <programlisting role="XML"><![CDATA[<ejb-local-ref>
+ <ejb-ref-name>ejblocal:EjbSynchronizations</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <local-home></local-home>
+ <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
+ </ejb-local-ref>]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Compared to the first strategy, this strategy requires to maintain an extra file
+ (<literal>META-INF/ibm-ejb-jar-ext.xml</literal>),
+ where a line must be added each time a new session bean is added to the application),
+ but still does not require to maintain EJB reference between beans.
+ </para>
</section>
-
- </section>
-
- <section id="jee5-websphere-section">
- <title> The <literal>jee5/booking</literal> example </title>
- <para> The <literal>jee5/booking</literal> example is based on the Hotel
- Booking example (which runs on JBoss AS). Out of the box it is designed
- to run on Glassfish, but with the steps below it can be deployed to
- Websphere. It is located in the
- <literal>$SEAM_DIST/examples/jee5/booking</literal> directory.
- </para>
-
- <section>
- <title>Configuration file changes</title>
-
- <para>Below are the configuration file changes that are need to the base
- example.</para>
-
- <variablelist>
- <varlistentry>
- <term>
- <literal>resources/WEB-INF/components.xml</literal>
- </term>
- <listitem>
- <para>We need to change the way that we look up EJBs for
- WAS. We need to remove the
- <literal>/local</literal> from the end of the
- <literal>jndi-pattern</literal> attribute. It should
- look like this: </para>
-
-
- <programlisting role="XML"><![CDATA[
-<core:init jndi-pattern="java:comp/env/jboss-seam-jee5/#{ejbName}" debug="true"/>
- ]]></programlisting>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <literal>resources/META-INF/ejb-jar.xml</literal>
- </term>
- <listitem>
- <para>We need to replace the /local string from <literal>ejb-ref-name</literal>.
- See at the following final code:</para>
-
- <programlisting role="XML"><![CDATA[
- <enterprise-beans>
- <!-- EJB reference required when one Seam EJB component references another Seam EJB component using @In -->
- <!-- Not required if you inject using @EJB, but then you lose state management and client-side interceptors (e.g., security) -->
- <session>
- <ejb-name>RegisterAction</ejb-name>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/AuthenticatorAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.Authenticator</local>
- </ejb-local-ref>
- </session>
- </enterprise-beans>]]></programlisting>
-
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term> <literal>resources/WEB-INF/web.xml</literal>
- </term>
- <listitem>
- <para>We have to make some changes to the EJB references
- in the <literal>web.xml</literal>. These changes are
- what will allow WAS to bind automatically the EJB3 references in
- the web module to the the actual EJB3 beans in the EAR
- module. Replace all of the /local strings in
- <literal>ejb-local-refs</literal> when the values
- below.</para>
-
-
- <programlisting role="XML"><![CDATA[
- <!-- JEE5 EJB3 names -->
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/AuthenticatorAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.Authenticator</local>
- </ejb-local-ref>
+ <section>
+ <title>Strategy 3: Use EJB references</title>
+ This strategy is based on the usage of EJB references, from EJB to EJB and from the web module to EJB. To use it:
+ <itemizedlist>
+ <listitem>
+ In <literal>components.xml</literal>, add the following line:
+ <programlisting role="XML"><![CDATA[<core:init jndi-name="java:comp/env/#{ejbName}" />]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Follow the instructions in <xref linkend="config.integration.ejb.container"/> to declare the references from web to EJB and from EJB to EJB
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ This is the most tedious strategy as each session bean referenced by another session bean (i.e. "injected") as to be declared in
+ <literal>ejb-jar.xml</literal> file.
+ Also, each new session bean has to be added to the list of referenced bean in <literal>web.xml</literal>
+ </para>
+
+ </section>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/BookingListAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.BookingList</local>
- </ejb-local-ref>
+ </section>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/RegisterAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.Register</local>
- </ejb-local-ref>
+ <section id="websphere-timeout-section">
+ <title>Configuring timeouts for Stateful Session Beans</title>
+ <para>
+ A timeout value has to be set for each stateful session bean used in the application because stateful bean must not expire in WebSphere while Seam
+ might still need thenm.
+ At the time of writing this document, WebSphere does not provide a way to configure a global timeout at neither the cluster,
+ server, application nor ejb-jar level. It has to be done for each stateful bean individually.
+ This is done by adding a file named <literal>META-INF/ibm-ejb-jar-ext.xml</literal> in the EJB module, and declare the timeout value for each bean:
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar-ext
+ xmlns="http://websphere.ibm.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
+ http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-ext_1_0.xsd"
+ version="1.0">
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/ChangePasswordAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.ChangePassword</local>
- </ejb-local-ref>
+ <session name="BookingListAction"><time-out value="605"/></session>
+ <session name="ChangePasswordAction"><time-out value="605"/></session>
+
+</ejb-jar-ext>]]></programlisting>
+ </para>
+ <para>
+ The <literal>time-out</literal> is expressed in seconds and must be higher than the Seam conversation expiration timeout
+ and a few minutes higher than the user's HTTP session timeout (The session expiration timeout can trigger a few minutes
+ after the number of minutes declared to expire s for the HTTP session expiration).
+ </para>
+ </section>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/HotelBookingAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.HotelBooking</local>
- </ejb-local-ref>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/HotelSearchingAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.HotelSearching</local>
- </ejb-local-ref>
+ <section id="jee5-websphere-section">
+ <title>The <literal>jee5/booking</literal> example</title>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/EjbSynchronizations</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
- </ejb-local-ref>]]></programlisting>
-
- <para>Note also that <literal>EjbSynchronizations</literal> is
- a built-in Seam EJB and not part of the Hotel Booking example. This
- means that if your application's <literal>components.xml</literal>
- specifies <literal>transaction:ejb-transaction</literal>,
- then you must include:</para>
- <programlisting role="XML"><![CDATA[
- <ejb-local-ref>
- <ejb-ref-name>myapp/EjbSynchronizations</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local-home></local-home>
- <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
- </ejb-local-ref>]]></programlisting>
- <para>in your web.xml. If you don't include it, you'll get the following error:</para>
- <programlisting>Name comp/env/myapp/EjbSynchronizations not found in context java:</programlisting>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>resources/META-INF/persistence.xml</literal>
- </term>
- <listitem>
- <para>For this example we will be using the default
- datasource that comes with WAS. To do this change the
- <literal>jta-data-source</literal> element:</para>
- <programlisting role="XML"><![CDATA[
-<jta-data-source>DefaultDatasource</jta-data-source>
- ]]></programlisting>
- <para>Then we need to adjust some of the hibernate
- properties. First comment out the Glassfish properties.
- Next you need to add/change the properties:</para>
-
-
- <programlisting role="XML"><![CDATA[
-<!--<property name="hibernate.transaction.flush_before_completion" value="true"/>-->
-<property name="hibernate.cache.provider_class"
- value="org.hibernate.cache.HashtableCacheProvider"/>
-<property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
-<property name="hibernate.transaction.manager_lookup_class"
- value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
- ]]></programlisting>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>hibernate.transaction.manager_lookup_class</literal>
- — Standard Hibernate transaction
- manager property for WAS 6.X and 7</para>
- </listitem>
- <listitem>
- <para>
- <literal>hibernate.transaction.flush_before_completion</literal>
- — This is commented out because we want
- the container to manage the transactions. Also
- if this is set to <literal>true</literal> an
- exception will be thrown by WAS when the
- EJBContext is looked up.
-
-
- <programlisting><![CDATA[com.ibm.wsspi.injectionengine.InjectionException:
- EJBContext may only be looked up by or injected into an EJB]]></programlisting></para>
- </listitem>
- <listitem>
- <para><literal>hibernate.dialect</literal>
- — From WAS 6.1.0.9 on the embedded DB was
- switched to the same Derby DB as is in
- Glassfish v2.</para>
- </listitem>
- </itemizedlist></para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>src/GlassfishDerbyDialect.java</literal>
- </term>
- <listitem>
- <para>You will need to get the
- <literal>GlassfishDerbyDialect.java</literal> and
- copy it into the <literal>/src</literal>
- directory. The java class exists in the JPA example source directory and can be
- copied using the command below assuming you are in
- <literal>jee5/booking</literal> directory:</para>
-
-
- <programlisting><![CDATA[
-cp ../../jpa/src/GlassfishDerbyDialect.java
- ./src]]></programlisting>
- <para>This class will be put into the
- <literal>jboss-seam-jee5.jar</literal> file. </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term> <literal>resources/import.sql</literal>
- </term>
- <listitem>
- <para>This file must also be copied from the JPA example
- because either the Derby DB or the dialect does not support
- changes to the <literal>ID</literal> column. The files
- are identical except for the column difference. Use the
- following command to make the copy
-
-
- <programlisting><![CDATA[
-cp ../../jpa/resources-websphere7/import.sql ./resources]]></programlisting>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
-
- </section>
-
+ <para>
+ The<literal>jee5/booking</literal>example is based on the Hotel Booking example (which runs on JBoss AS).
+ Out of the box, it is designed to run on Glassfish, but with the following steps, it can be deployed on
+ WebSphere. It is located in the <literal>$SEAM_DIST/examples/jee5/booking</literal> directory.
+ </para>
+
+ <para>
+ For running this example, we'll use the second JNDI mapping strategy ("Override the default names generated by WebSphere")
+ as we don't want to change the java code to add the <literal>@JndiName</literal> annotation as in the first strategy.
+ </para>
+
<section>
- <title>Building the <literal>jee5/booking</literal>
- example</title>
-
- <para>In order to get the changes we have made into our application we
- need to make some changes to the <literal>build.xml</literal>.
- There are also some additional jars that are required by our
- application in order to work with WAS. This section will cover
- what changes are needed to the <literal>build.xml</literal>.</para>
-
- <section>
- <title>Library dependency changes</title>
- <para>We remove the <literal>log4j.jar</literal>
- so that all of the log output from our application will
- be added to the WAS log. Additional steps are
- required to fully configure log4j and those are outside
- of the scope of this document.</para>
- </section>
-
- <section>
- <title>Updating the <literal>build.xml</literal> file</title>
-
- <para>Add the following entry to the bottom of the
- <literal>build.xml</literal> file. This overrides the
- default fileset that is used to populate the
- <literal>jboss-seam-jee5.jar</literal>.
- :
- </para>
-
-
- <programlisting role="XML"><![CDATA[
- <fileset id="jar.resources" dir="${resources.dir}">
- <include name="import.sql" />
- <include name="seam.properties" />
- <include name="META-INF/persistence.xml" />
- <include name="META-INF/ejb-jar.xml" />
- </fileset>]]></programlisting>
-
- <para>Now all that is left is to execute the <literal>ant
- archive</literal> task and the built application will be in
- the <literal>jee5/booking/dist</literal> directory.
- </para>
- </section>
-
+ <title>Building the <literal>jee5/booking</literal> example</title>
+
+ <para>
+ Building it only requires running the correct ant command: <programlisting>ant -f build-websphere7.xml</programlisting>
+ This will create container specific distribution and exploded archive directories with the <literal>websphere7</literal> label.
+ </para>
</section>
-
+
<section id="jee5-websphere-deploy">
- <title>Deploying the application to Websphere</title>
-
- <para>So now we have everything we need in place. All that is left is to
- deploy it - just a few steps more.</para>
- <para> For this we will use Websphere's administration console. As
- before there are some tricks and tips that must be followed.</para>
-
- <para>The steps below are for the WAS version stated above.
- The ports are default values, if you changed them substitute your values.
- <orderedlist>
- <listitem>
- <para>Log in to the administration console
-
-
- <programlisting><![CDATA[https://localhost:9043/admin]]></programlisting>
- or
- <programlisting><![CDATA[http://localhost:9060/admin]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>Access the <literal>Websphere enterprise
- applications</literal> menu option under the
- <literal>Applications --> Application Type</literal> left side menu. </para>
- </listitem>
- <listitem>
- <para>At the top of the <literal>Enterprise
- Applications</literal> table select
- <literal>Install</literal>. Below are installation
- wizard pages and what needs to done on each:
- <itemizedlist>
+ <title>Deploying the <literal>jee5/booking</literal> example</title>
+ <para>
+ The steps below are for the WAS version stated above.The ports are default values, if you changed them, you must substitute the values.
+ <orderedlist>
+ <listitem>
+ Log in to the administration console
+ <programlisting><![CDATA[http://localhost:9060/admin]]></programlisting>
+ Enter your userid annd/or your password if security is enabled for the console.
+ </listitem>
+
+ <listitem>
+ <para>
+ Go to the <literal>WebSphere enterprise applications</literal> menu option under the <literal>Applications --> Application Type</literal>
+ left side menu.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ At the top of the <literal>Enterprise Applications</literal> table select <literal>Install</literal>.
+ Below are installation wizard pages and what needs to done on each:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>Preparing for the application installation</literal>
+ <itemizedlist>
<listitem>
- <para><literal>Preparing for the application
- installation</literal>
- <itemizedlist>
- <listitem>
- <para>Browse to the
- <literal>examples/jee5/booking/dist/jboss-seam-jee5.ear</literal>
- file using the file upload widget.
- </para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Fast Path</literal>
- button.</para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Browse to the <literal>examples/jee5/booking/dist-websphere7/jboss-seam-jee5.ear</literal>
+ file using the file upload widget.
+ </para>
</listitem>
<listitem>
- <para><literal>Select installation
- options</literal>
- <itemizedlist>
- <listitem>
- <para>Select the <literal>Deploy
- enterprise beans</literal> and
- <literal>Allow EJB reference targets to resolve automatically</literal>
- check boxes. This is needed unless you
- used a Websphere AS tool to package the
- application. </para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
-
-
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Next</literal> button.
+ </para>
</listitem>
<listitem>
- <para><literal>Map modules to
- servers</literal>
- <itemizedlist>
- <listitem>
- <para>No changes needed here as we only
- have one server. Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Fast Path</literal> button.
+ </para>
</listitem>
<listitem>
- <para><literal>Summary</literal>
- <itemizedlist>
- <listitem>
- <para>No changes needed here. Select
- the <literal>Finish</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Next</literal> button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Select installation options</literal>
+ <itemizedlist>
<listitem>
- <para><literal>Installation</literal>
- <itemizedlist>
- <listitem>
- <para>Now you will see it installing and
- deploying your
- application.</para>
- </listitem>
- <listitem>
- <para>When it finishes select the
- <literal>Save</literal> link and
- you will be returned to the
- <literal>Enterprise
- Applications</literal>
- table.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Deploy enterprise beans and Allow EJB reference targets to resolve automatically</literal>
+ check boxes at the bottom of the page. This will let WebSphere use its simplified JNDI reference mapping.
+ </para>
</listitem>
- </itemizedlist> </para>
- </listitem>
- <listitem id="websphere-app-adj-after-install" xreflabel="installation adjustments for jee5 example">
- <para>Now that we have our application installed we need to
- make some adjustments to it before we can start it:</para>
- <itemizedlist>
<listitem>
- <para>Starting from the <literal>Enterprise
- Applications</literal> table select the
- <literal>Seam Booking</literal>
- link.</para>
+ <para>
+ Select the <literal>Next</literal> button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Map modules to servers</literal>
+ <itemizedlist>
<listitem>
- <para>Select the <literal>Manage
- Modules</literal> link.</para>
+ <para>
+ No changes needed here as we only have one server. Select the <literal>Next</literal>button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Map virtual hosts for Web modules</literal>
+ <itemizedlist>
<listitem>
- <para>Select the
- <literal>jboss-seam-jee5-booking.war</literal>
- link.</para>
+ <para>
+ No changes needed here as we only have one virtual host. Select the <literal>Next</literal>button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Summary</literal>
+ <itemizedlist>
<listitem>
- <para>Change the <literal>Class loader
- order</literal> combo box to
- <literal>Classes loaded with application
- class loader first (parent last)</literal>.</para>
+ <para>No changes needed here. Select the <literal>Finish</literal> button.</para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Installation</literal>
+ <itemizedlist>
<listitem>
- <para>Select <literal>Apply</literal> and then
- <literal>Save</literal> options.</para>
+ <para>Now you will see WebSphere installing and deploying your application.</para>
</listitem>
<listitem>
- <para>Return to the <literal>Seam Booking</literal> page.</para>
+ <para>
+ When done, select the <literal>Save</literal> link and you will be returned to the
+ <literal>Enterprise Applications</literal> table.
+ </para>
</listitem>
- <listitem>
- <para>On this page select the <literal>Class
- loading and update detection</literal>
- link.</para>
- </listitem>
- <listitem>
- <para>Select the radio button for
- <literal>Classes loaded with application
- class loader first</literal>.</para>
- </listitem>
- <listitem>
- <para>Select <literal>Apply</literal> and then
- <literal>Save</literal> options.</para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>To start the application return to the
- <literal>Enterprise Applications</literal> table and
- select our application in the list. Then choose the
- <literal>Start</literal> button at the top of the
- table.</para>
- </listitem>
- <listitem>
- <para>You can now access the application at
- <literal>http://localhost:9080/seam-jee5-booking/index.html</literal>
- .</para>
- </listitem>
- </orderedlist>
- <!-- <note>
- <title>A note about Websphere Stateful bean timeouts</title>
- <para>The default timeout period for a Websphere 6.1 Stateful
- EJB is 10 minutes. This means that you may see some EJB timeout
- exceptions after some idle time. It is possible to adjust the
- timeout of the Stateful EJBs on an individual basis, but
- that is beyond the scope of this document. See the Websphere
- documentation for details.
- </para>
- </note> -->
- </para>
- </section>
-
- </section>
-
- <section>
- <title> The <literal>jpa</literal> booking example </title>
- <para>Thankfully getting the <literal>jpa</literal> example to work is
- much easier than the <literal>jee5</literal> example. This is the
- Hotel Booking example implemented in Seam POJOs and using Hibernate JPA
- with JPA transactions. It does not use EJB3.</para>
-
- <para> The example already has a breakout of configurations and build
- scripts for many of the common containers including Websphere.</para>
-
- <para>First thing we are going to do is build and deploy that example. Then
- we'll go over some key changes that we needed.</para>
-
- <section>
- <title>Building the <literal>jpa</literal> example</title>
- <para> Building it only requires running the correct ant command:
- <programlisting>ant websphere7</programlisting>
- This will create container specific distribution and exploded
- archive directories with the <literal>websphere7</literal> label.</para>
- </section>
- <section>
- <title>Deploying the <literal>jpa</literal> example</title>
- <para>This is similar to the <literal>jee5</literal> example at
- <xref linkend="jee5-websphere-deploy"/>, but without so many steps.
- </para>
- <itemizedlist>
- <listitem>
- <para>From the <literal>Enterprise Applications</literal> table
- select the <literal>Install</literal> button.
- <itemizedlist>
- <listitem>
- <para><literal>Preparing for the application
- installation</literal>
- <itemizedlist>
- <listitem>
- <para>Browse to the
- <literal>examples/jpa/dist-websphere7/jboss-seam-jpa.war</literal>
- file using the file upload widget.
- </para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Fast Path</literal>
- button.</para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ </itemizedlist>
+ </para>
</listitem>
<listitem>
- <para>Select the <literal>Next</literal> button for the next
- three pages, no changes are needed.
- </para>
+ <para>
+ To start the application select our application in the list, then click on the <literal>Start</literal>
+ button at the top of the table.
+ </para>
</listitem>
- <listitem>
- <para><literal>Map context roots for Web modules</literal>
- <itemizedlist>
- <listitem>
- <para>In the <literal>Context root</literal> text box
- enter <literal>jboss-seam-jpa</literal>.
- </para>
- </listitem>
- <listitem>
- <para>Select the <literal>Next</literal> button.
- </para>
- </listitem>
- </itemizedlist></para>
- </listitem>
- <listitem>
- <para><literal>Summary</literal> page
- <itemizedlist>
- <listitem>
- <para>Review the settings if you wish and select
- the <literal>Finish</literal> button to install
- the application. When installation finished select the <literal>
- Save</literal> link and you will be returned to the
- <literal>Enterprise Applications</literal> table.
- </para>
- </listitem>
- </itemizedlist> </para>
- </listitem>
-
- </itemizedlist>
- </para>
+ </itemizedlist>
+ </para>
</listitem>
+
<listitem>
- <para>As with the <literal>jee5</literal> example there are some
- class loader changes needed before we start the application.
- Follow the instructions at <xref linkend="websphere-app-adj-after-install"/>
- but exchange <literal>jboss-seam-jpa_war</literal> for <literal>Seam Booking</literal>.
- </para>
+ <para>
+ You can now access the application at <literal>http://localhost:9080/seam-jee5-booking</literal>
+ </para>
</listitem>
- <listitem>
- <para>Finally start the application by selecting it in the
- <literal>Enterprise Applications</literal> table and clicking
- the <literal>Start</literal> button.
- </para>
- </listitem>
- <listitem>
- <para>You can now access the application at the
- <literal>http://localhost:9080/jboss-seam-jpa/index.html</literal>.
- </para>
- </listitem>
- </itemizedlist>
+ </orderedlist>
+ </para>
</section>
<section>
- <title>What's different for Websphere AS V7</title>
- <para>The differences between the JPA examples that deploys to JBoss
- 4.2 and Websphere AS V7 are mostly expected; library and
- configuration file changes. </para>
- <itemizedlist>
- <listitem>
- <para>Configuration file changes
- <itemizedlist>
- <listitem>
- <para>
- <literal>META-INF/persistence.xml</literal>
- — the main changes here are for the
- datasource JNDI path, switching to the Websphere
- transaction manager look up class, and
- changing the hibernate dialect to be
- <literal>GlassfishDerbyDialect</literal>
- .</para>
- </listitem>
- <listitem>
- <para>
- <literal>WEB-INF/components.xml</literal>
- — the change here is <literal>jndi-pattern</literal>
- without /local string.</para>
- </listitem>
- <listitem>
- <para>
- <literal>META-INF/ejb-jar.xml</literal>
- — the same change in <literal>ejb-ref-name</literal>,
- where is replace /local string in
- <literal>jboss-seam-jee5/AuthenticatorAction</literal>.</para>
- </listitem>
- <listitem>
- <para>
- <literal>src/GlassfishDerbyDialect.java
- </literal> — this class is needed for the
- hibernate dialect change to
- <literal>GlassfishDerbyDialect</literal>
- </para>
- </listitem>
- <listitem>
- <para><literal>import.sql</literal> —
- either for the dialect or Derby DB the
- <literal>ID</literal> column can not be
- populated by this file and was removed.
- </para>
- </listitem>
- </itemizedlist> </para>
- </listitem>
- <listitem>
- <para>Changes for dependent libraries</para>
- <para>The Websphere version requires several library packages because they are
- not included as they are with JBoss AS. These are primarily for
- hibernate and their dependencies. Below are
- listed only the additional jars needed above and beyond the JBoss
- <literal>JPA</literal> example.
- <itemizedlist>
- <listitem>
- <para> To use Hibernate as your JPA provider you need
- the following jars:
- <itemizedlist>
- <listitem>
- <simpara>
- <literal>hibernate.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>hibernate-annotations.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>hibernate-commons-annotations.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>hibernate-entitymanager.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>hibernate-validator.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>commons-collections.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>jboss-common-core.jar</literal>
- </simpara>
- </listitem>
- </itemizedlist> </para>
- </listitem>
- <listitem>
- <para>Various third party jars that Websphere needs:
- <itemizedlist>
- <listitem>
- <simpara> <literal>antlr.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara> <literal>cglib.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara> <literal>asm.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara> <literal>dom4j.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>javassist.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>concurrent.jar</literal>
- </simpara>
- </listitem>
- </itemizedlist> </para>
- </listitem>
- </itemizedlist> </para>
- </listitem>
- </itemizedlist>
-
+ <title>Deviation from the original base files</title>
+ Below are the differences between the base configuration files and the WebSphere specific files held in the <literal>resources-websphere7</literal> directory.
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>META-INF/ejb-jar.xml</literal>
+ — Removed all the EJB references
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>META-INF/ibm-ejb-jar-bnd.xml</literal>
+ — This WebSphere specific file has been added as we use the second JNDI mapping strategy.
+ It defines, for each session bean, the name WebSphere will use to bind it its JNDI name space
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>META-INF/ibm-ejb-jar-ext.xml</literal>
+ — This WebSphere specific file defines to WebSphere, the timeout value for each stateful bean
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>META-INF/persistence.xml</literal>
+ — The main changes here are for the datasource JNDI path,
+ switching to the WebSphere transaction manager lookup class,
+ turning off the <literal>hibernate.transaction.flush_before_completion</literal> toggle,
+ and forcing the Hibernate dialect to be <literal>GlassfishDerbyDialect</literal>
+ how as using the integrated Derby database
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>WEB-INF/components.xml</literal>
+ — the change here is <literal>jndi-pattern</literal>
+ to use <literal>ejblocal:#{ejbname}</literal> as using the second
+ JNDI matching strategy
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>WEB-INF/web.xml</literal>
+ — Remove all the <literal>ejb-local ref</literal> except the one for
+ <literal>EjbSynchronizations</literal> bean.
+ Changed the ref fo this bean to <literal>ejblocal:EjbSynchronizations</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>import.sql</literal>
+ — due to the cutomized hibernate Derby dialect, the <literal>ID</literal>
+ column can not be populated by this file and was removed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Also the build procedure has been changed to include the <literal>log4j.jar</literal> file
+ and exclude the <literal>concurrent.jar</literal> and <literal>jboss-common-core.jar</literal> files.
+ </para>
+
</section>
-
-
- </section>
-
+ </section>
+
+
+
+
<section>
- <title>Deploying an application created using
- <literal>seam-gen</literal> on Websphere V7</title>
+ <title>The <literal>jpa</literal> booking example</title>
+
+ <para>
+ This is the Hotel Booking example implemented in Seam POJOs and using Hibernate JPA
+ with JPA transactions. It does not use EJB3.
+ </para>
+
+ <para>
+ The example already has a breakout of configurations and build
+ scripts for many of the common containers including WebSphere.
+ </para>
+
+ <para>
+ First thing, we are going to do is build and deploy that example.
+ Then we'll go over some key changes that we needed.
+ </para>
+
+ <section>
+ <title>Building the <literal>jpa</literal> example</title>
+ <para>
+ Building it only requires running the correct ant command:
+ <programlisting>ant websphere7</programlisting>
+ This will create container specific distribution and exploded archive directories with the
+ <literal>websphere7</literal> label.
+ </para>
+ </section>
- <para><literal>seam-gen</literal> is a very useful tool for developers
- to quickly get an application up and running, and provides a foundation
- to add your own functionality. Out of box <literal>seam-gen</literal>
- will produce applications configured to run on JBoss AS. These
- instructions will show the steps needed to get it to run on Websphere.
- As stated above in <xref linkend="jee5-websphere-section"/> there
- are some tricky changes needed to get an EJB3 application running. This
- section will take you through the exact steps.</para>
-
+ <section>
+ <title>Deploying the <literal>jpa</literal> example</title>
+ <para>
+ Deploying <literal>jpa</literal> application is very similar to the <literal>jee5/booking</literal>
+ example at <xref linkend="jee5-websphere-deploy" />.
+ The main difference is, that this time, we will deploy a war file instead of an ear file,
+ and we'll have to manually specify the context root of the application.
+ </para>
+ <para>
+ Follow the same instructions as for the <literal>jee5/booking</literal> sample. Select the
+ <literal>examples/jpa/dist-websphere7/jboss-seam-jpa.war</literal> file on the first page and on the
+ <literal>Map context roots for Web modules</literal> page (after the <literal>Map virtual host for Web module</literal>),
+ enter the context root you want to use for your application in the <literal>Contect Root</literal> input field.
+ </para>
+
+ <para>
+ When started, you can now access the application at the <literal>http://localhost:9080/<context root></literal>.
+ </para>
+ </section>
+
<section>
- <title>Running <literal>seam-gen</literal> Setup</title>
- <para>The first step is setting up <literal>seam-gen</literal> to
- construct the base project. There are several choices made below,
- specifically the datasource and hibernate values that we will adjust
- once the project is created.</para>
-
-
- <programlisting><![CDATA[
+ <title>Deviation from the generic base files</title>
+ Below are the configuration file differences between the base configuration files and the files customized
+ for WebSphere held in the <literal>resources-websphere7</literal> directory.
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>META-INF/persistence.xml</literal>
+ — The main changes here are for the datasource JNDI path,
+ switching to the WebSphere transaction manager look up class,
+ turning off the <literal>hibernate.transaction.flush_before_completion</literal> toggle,
+ and forcing the Hibernate dialect to be <literal>GlassfishDerbyDialect</literal>
+ how as using the integrated Derby database
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>import.sql</literal>
+ — due to the cutomized hibernate Derby dialect, the <literal>ID</literal>
+ column can not be populated by this file and was removed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Also the build procedure have been changed to include the <literal>log4j.jar</literal> file
+ and exclude the <literal>concurrent.jar</literal> and <literal>jboss-common-core.jar</literal> files.
+ </para>
+
+ </section>
+ </section>
+
+
+ <section>
+ <title>Deploying an application created using <literal>seam-gen</literal> on WebSphere V7</title>
+
+ <para>
+ <literal>seam-gen</literal>
+ is a very useful tool for developers
+ to quickly get an application up and running, and provides a foundation
+ to add your own functionality. Out of box
+ <literal>seam-gen</literal>
+ will produce applications configured to run on JBoss AS. These
+ instructions will show the steps needed to get it to run on
+ WebSphere. This section will take you through the exact steps.
+ </para>
+
+ <section>
+ <title>Running <literal>seam-gen</literal> Setup </title>
+ <para>
+ The first step is setting up
+ <literal>seam-gen</literal>
+ to
+ construct the base project. There are several choices made below,
+ specifically the datasource and hibernate values that we will adjust
+ once the project is created.
+ </para>
+
+
+ <programlisting><![CDATA[
./seam setup
Buildfile: build.xml
@@ -848,39 +704,53 @@
BUILD SUCCESSFUL
Total time: 3 minutes 5 seconds]]></programlisting>
-
- <para> Type <literal>./seam new-project</literal> to create your
- project and <literal>cd
- /home/jbalunas/workspace/websphere_example</literal> to the
- newly created structure. </para>
-
- </section>
- <section>
- <title>Changes needed for deployment to Websphere</title>
- <para>We now need to make some changes to the generated project.</para>
- <section>
- <title>Configuration file changes</title>
- <variablelist>
- <varlistentry>
- <term>
- <literal>resources/META-INF/persistence-dev.xml</literal>
- </term>
- <listitem>
- <itemizedlist>
- <listitem>
- <para> Alter the
- <literal>jta-data-source</literal> to be
- <literal>DefaultDatasource</literal>. We are
- going to be using the integrated Websphere
- DB.</para>
- </listitem>
- <listitem>
- <para> Add or change the properties below.
- These are described in detail at <xref
- linkend="jee5-websphere-section"/>:
- </para>
-
- <programlisting role="XML"><![CDATA[
+
+ <para>
+ Type
+ <literal>./seam new-project</literal>
+ to create your
+ project and
+ <literal>cd
+ /home/jbalunas/workspace/websphere_example</literal>
+ to the
+ newly created structure.
+ </para>
+
+ </section>
+ <section>
+ <title>Changes needed for deployment to Websphere</title>
+ <para>We now need to make some changes to the generated project.
+ </para>
+ <section>
+ <title>Configuration file changes</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <literal>resources/META-INF/persistence-dev.xml
+ </literal>
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Alter the
+ <literal>jta-data-source</literal>
+ to be
+ <literal>DefaultDatasource</literal>
+ . We are
+ going to be using the integrated Websphere
+ DB.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add or change the properties below.
+ These are described in detail at
+ <xref linkend="jee5-websphere-section" />
+ :
+ </para>
+
+ <programlisting role="XML"><![CDATA[
<property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
@@ -889,108 +759,138 @@
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>]]></programlisting>
- </listitem>
- <listitem>
- <para> Remove the JBoss AS specific method of exposing
- the EntityManagerFactory: </para>
-
- <programlisting role="XML"><![CDATA[<property
+ </listitem>
+ <listitem>
+ <para> Remove the JBoss AS specific method of exposing
+ the EntityManagerFactory: </para>
+
+ <programlisting role="XML"><![CDATA[<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/websphere_exampleEntityManagerFactory">]]></programlisting>
- </listitem>
- <listitem>
- <para> You'll need to alter
- <literal>persistence-prod.xml</literal> as
- well if you want to deploy to Websphere using the
- prod profile. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>src/GlassfishDerbyDialect.java</literal>
- </term>
- <listitem>
- <para>As with other examples we need to include this java class for
- DB support. It can be copied from the
- <literal>jpa</literal> example into the
- <literal>websphere_example/src</literal>
- directory.
-
- <programlisting><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ You'll need to alter
+ <literal>persistence-prod.xml</literal>
+ as
+ well if you want to deploy to Websphere using the
+ prod profile.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>src/GlassfishDerbyDialect.java
+ </literal>
+ </term>
+ <listitem>
+ <para>
+ As with other examples we need to include this java class for
+ DB support. It can be copied from the
+ <literal>jpa</literal>
+ example into the
+ <literal>websphere_example/src</literal>
+ directory.
+
+ <programlisting><![CDATA[
cp $SEAM/examples/jpa/src/GlassfishDerbyDialect.java
./src]]></programlisting>
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>resources/META-INF/jboss-app.xml</literal>
- </term>
- <listitem>
- <para> You can delete this file as we aren't deploying to JBoss
- AS ( <literal>jboss-app.xml</literal> is used to enable
- classloading isolation in JBoss AS) </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term> <literal>resources/*-ds.xml</literal>
- </term>
- <listitem>
- <para> You can delete these file as we aren't deploying to
- JBoss AS (these files define datasources in JBoss AS, we
- are using Websphere's default datasource) </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>resources/WEB-INF/components.xml</literal>
- </term>
- <listitem>
- <itemizedlist>
- <listitem>
- <para> Enable container managed transaction
- integration - add the <literal>
- <transaction:ejb-transaction />
- </literal> component, and it's namespace
- declaration <literal>
- xmlns:transaction="http://jboss.com/products/seam/transaction"
- </literal> </para>
- </listitem>
- <listitem>
- <para> Alter the <literal>jndi-pattern</literal>
- to <literal>
- java:comp/env/websphere_example/#{ejbName}
- </literal> </para>
- </listitem>
- <listitem>
- <para>We do not need
- <literal>managed-persistence-context</literal>
- for this example and so can delete its
- entry.</para>
-
-
- <programlisting role="XML"><![CDATA[
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>resources/META-INF/jboss-app.xml
+ </literal>
+ </term>
+ <listitem>
+ <para>
+ You can delete this file as we aren't deploying to JBoss
+ AS (
+ <literal>jboss-app.xml</literal>
+ is used to enable
+ classloading isolation in JBoss AS)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>resources/*-ds.xml</literal>
+ </term>
+ <listitem>
+ <para> You can delete these file as we aren't deploying to
+ JBoss AS (these files define datasources in JBoss AS, we
+ are using Websphere's default datasource) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>resources/WEB-INF/components.xml
+ </literal>
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Enable container managed transaction
+ integration - add the
+ <literal>
+ <transaction:ejb-transaction /> </literal>
+ component, and it's namespace
+ declaration
+ <literal>
+ xmlns:transaction="http://jboss.com/products/seam/transaction"
+ </literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Alter the
+ <literal>jndi-pattern</literal>
+ to
+ <literal>
+ java:comp/env/websphere_example/#{ejbName}
+ </literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ We do not need
+ <literal>managed-persistence-context
+ </literal>
+ for this example and so can delete its
+ entry.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:/websphere_exampleEntityManagerFactory"/> ]]></programlisting>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term> <literal>resources/WEB-INF/web.xml</literal>
- </term>
- <listitem>
- <para>As with the <literal>jee5/booking</literal>
- example we need to add EJB references to the web.xml. These
- references require replacing /local string in
- <literal>ejb-ref-name</literal> to flag them for
- Websphere to perform the proper binding.</para>
-
-
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>resources/WEB-INF/web.xml
+ </literal>
+ </term>
+ <listitem>
+ <para>
+ As with the
+ <literal>jee5/booking</literal>
+ example we need to add EJB references to the web.xml. These
+ references require replacing /local string in
+ <literal>ejb-ref-name</literal>
+ to flag them for
+ Websphere to perform the proper binding.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<ejb-local-ref>
<ejb-ref-name>websphere_example/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
@@ -1002,105 +902,144 @@
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
</ejb-local-ref>]]></programlisting>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section>
- <title>Creating the <literal>AuthenticatorAction</literal>
- EJB</title>
- <para>We want to take the existing <literal>Authenticator</literal>
- Seam POJO component and create an EJB3 out of it. </para>
- <orderedlist>
- <listitem> <para>Change the generated Authenticator class</para>
- <itemizedlist>
- <listitem>
- <para>Rename the class to
- <literal>AuthenticatorAction</literal> </para>
- </listitem>
- <listitem>
- <para>Add the <literal>@Stateless</literal>
- annotation to the new
- <literal>AuthenticatorAction</literal> class.
- </para>
- </listitem>
- <listitem>
- <para>Create an interface called
- <literal>Authenticator</literal> which
- <literal>AuthenticatorAction</literal>
- implements (EJB3 requires session beans to have a
- local interface). Annotate the interface with
- <literal>@Local</literal> , and add a single method
- with same signature as the
- <literal>authenticate</literal> in
- <literal>AuthenticatorAction</literal> . </para>
- </listitem>
- </itemizedlist>
-
-
- <programlisting role="JAVA"><![CDATA[
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section>
+ <title>
+ Creating the
+ <literal>AuthenticatorAction</literal>
+ EJB
+ </title>
+ <para>
+ We want to take the existing
+ <literal>Authenticator</literal>
+ Seam POJO component and create an EJB3 out of it.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>Change the generated Authenticator class</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Rename the class to
+ <literal>AuthenticatorAction</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add the
+ <literal>@Stateless</literal>
+ annotation to the new
+ <literal>AuthenticatorAction</literal>
+ class.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Create an interface called
+ <literal>Authenticator</literal>
+ which
+ <literal>AuthenticatorAction</literal>
+ implements (EJB3 requires session beans to have a
+ local interface). Annotate the interface with
+ <literal>@Local</literal>
+ , and add a single method
+ with same signature as the
+ <literal>authenticate</literal>
+ in
+ <literal>AuthenticatorAction</literal>
+ .
+ </para>
+ </listitem>
+ </itemizedlist>
+
+
+ <programlisting role="JAVA"><![CDATA[
@Name("authenticator") @Stateless public class
AuthenticatorAction implements Authenticator {]]></programlisting>
-
-
- <programlisting role="JAVA"><![CDATA[
+
+
+ <programlisting role="JAVA"><![CDATA[
@Local public interface Authenticator {
public boolean authenticate();
}]]></programlisting>
- </listitem>
- <listitem>
- <para>We've already added its reference to the
- <literal>web.xml</literal> file so are good to go. </para>
- </listitem>
- </orderedlist>
- </section>
- <section>
- <title>Extra jar dependencies and other changes to the
- <literal>build.xml</literal></title>
- <para> This application has similar requirements as the
- <literal>jee5/booking</literal> example. </para>
-
- <itemizedlist>
- <listitem>
- <para>Change the default target to
- <literal>archive</literal> (we aren't going to cover
- automatic deployment to Websphere).
- </para>
-
-
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ We've already added its reference to the
+ <literal>web.xml</literal>
+ file so are good to go.
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
+ <section>
+ <title>
+ Extra jar dependencies and other changes to the
+ <literal>build.xml</literal>
+ </title>
+ <para>
+ This application has similar requirements as the
+ <literal>jee5/booking</literal>
+ example.
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Change the default target to
+ <literal>archive</literal>
+ (we aren't going to cover
+ automatic deployment to Websphere).
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<project name="websphere_example" default="archive" basedir=".">]]></programlisting>
-
- </listitem>
- <listitem>
- <para>Websphere looks for the drools
- <literal>/security.drl</literal> file in the root of the
- <literal>war</literal> file instead of the root of the
- <literal>websphere_example.jar</literal> so we need
- to have the <literal>build.xml</literal> move it to the
- correct location at build time. The following must be added at
- the top of the <literal> <target name="war"
- depends="compile" description="Build the distribution
- .war file"> </literal> target.
- </para>
-
- <programlisting role="XML"><![CDATA[
+
+ </listitem>
+ <listitem>
+ <para>
+ Websphere looks for the drools
+ <literal>/security.drl</literal>
+ file in the root of the
+ <literal>war</literal>
+ file instead of the root of the
+ <literal>websphere_example.jar</literal>
+ so we need
+ to have the
+ <literal>build.xml</literal>
+ move it to the
+ correct location at build time. The following must be added at
+ the top of the
+ <literal> <target name="war"
+ depends="compile" description="Build the distribution
+ .war file"> </literal>
+ target.
+ </para>
+
+ <programlisting role="XML"><![CDATA[
<copy todir="${war.dir}">
<fileset dir="${basedir}/resources" >
<include name="*.drl" />
</fileset>
</copy>]]></programlisting>
- </listitem>
- <listitem>
- <para>Now we need to get extra jars into the
- <literal>build.xml</literal>. Look for the
- <literal><fileset dir="${basedir}"></literal> section
- of the task below. Add the new includes at the bottom of
- the fileset.
- </para>
-
-
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ Now we need to get extra jars into the
+ <literal>build.xml</literal>
+ . Look for the
+ <literal><fileset dir="${basedir}"></literal>
+ section
+ of the task below. Add the new includes at the bottom of
+ the fileset.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<target name="ear" description="Build the EAR">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
@@ -1127,10 +1066,10 @@
</fileset>
</copy>
</target>]]></programlisting>
- <itemizedlist>
- <listitem>
- <para>Hibernate dependencies</para>
- <programlisting role="XML"><![CDATA[
+ <itemizedlist>
+ <listitem>
+ <para>Hibernate dependencies</para>
+ <programlisting role="XML"><![CDATA[
<!-- Hibernate and deps -->
<include name="lib/hibernate.jar"/>
<include name="lib/hibernate-commons-annotations.jar"/>
@@ -1138,10 +1077,10 @@
<include name="lib/hibernate-entitymanager.jar"/>
<include name="lib/hibernate-validator.jar"/>
<include name="lib/jboss-common-core.jar" />]]></programlisting>
- </listitem>
- <listitem>
- <para> Third party dependencies.</para>
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para> Third party dependencies.</para>
+ <programlisting role="XML"><![CDATA[
<!-- 3rd party and supporting jars -->
<!--<include name="lib/log4j.jar" />-->
<include name="lib/javassist.jar"/>
@@ -1152,20 +1091,25 @@
<include name="lib/antlr.jar" />
<include name="lib/commons-logging.jar" />
<include name="lib/commons-collections.jar" />]]></programlisting>
- </listitem>
- <listitem>
- <para><literal>jboss-seam.jar</literal> - this is needed in
- the <literal>ear</literal> base
- directory.</para>
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jboss-seam.jar</literal>
+ - this is needed in
+ the
+ <literal>ear</literal>
+ base
+ directory.
+ </para>
+ <programlisting role="XML"><![CDATA[
<!-- seam jar -->
<include name="lib/jboss-seam.jar" />]]></programlisting>
- </listitem>
- </itemizedlist>
+ </listitem>
+ </itemizedlist>
+
+ <para>You should end up with something like:</para>
+ <programlisting role="XML"><![CDATA[<fileset dir="${basedir}">
- <para>You should end up with something like:</para>
- <programlisting role="XML"><![CDATA[<fileset dir="${basedir}">
-
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
<include name="lib/drools-*.jar"/>
@@ -1196,41 +1140,56 @@
<!-- seam jar -->
<include name="lib/jboss-seam.jar" />
-</fileset>]]></programlisting>
-
- </listitem>
- </itemizedlist>
-
- </section>
- <section>
- <title> Building and deploying the seam-gen'd application to Websphere
+</fileset>]]></programlisting>
+
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ <section>
+ <title> Building and deploying the seam-gen'd application to
+ Websphere
</title>
-
- <itemizedlist>
- <listitem>
- <para> Build your application by calling
- <literal>ant</literal> in the base directory of your
- project (ex.
- <literal>/home/jbalunas/workspace/websphere_example</literal>
- ). The target of the build will be
- <literal>dist/websphere_example.ear</literal> . </para>
- </listitem>
-
- <listitem>
- <para>To deploy the application follow the instructions here :
- <xref linkend="jee5-websphere-deploy"/> but use references to
- this project <literal>websphere_example</literal> instead of
- <literal>jboss-seam-jee5</literal>.</para>
- </listitem>
- <listitem>
- <para> Checkout the app at:
- <literal>http://localhost:9080/websphere_example/index.html</literal>
- </para>
- </listitem>
- </itemizedlist>
-
- </section>
- </section>
- </section>
-
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Build your application by calling
+ <literal>ant</literal>
+ in the base directory of your
+ project (ex.
+ <literal>/home/jbalunas/workspace/websphere_example
+ </literal>
+ ). The target of the build will be
+ <literal>dist/websphere_example.ear
+ </literal>
+ .
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To deploy the application follow the instructions here :
+ <xref linkend="jee5-websphere-deploy" />
+ but use references to
+ this project
+ <literal>websphere_example</literal>
+ instead of
+ <literal>jboss-seam-jee5</literal>
+ .
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Checkout the app at:
+ <literal>http://localhost:9080/websphere_example/index.html
+ </literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ </section>
+ </section>
+
</chapter>
Added: branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+
+<project name="Booking WebSphere 7" default="clean.archive" basedir=".">
+
+ <!-- Public targets -->
+ <target name="clean.archive" depends="clean,archive" />
+
+ <!-- Naming -->
+ <property name="Name" value="Java EE 5 Booking Example"/>
+ <property name="example.name" value="jboss-seam-jee5-booking"/>
+
+ <!-- Define topology -->
+ <property name="resources.dir" value="resources-websphere7" />
+ <property name="dist.dir" value="dist-websphere7" />
+ <property name="exploded-archives.dir" value="exploded-archives-websphere7" />
+
+ <!-- Libraries to include in ear -->
+ <property name="seam.ui.lib" value="true" />
+ <property name="seam.debug.lib" value="true" />
+ <property name="facelets.lib" value="true" />
+ <property name="richfaces.lib" value="true" />
+ <property name="el-ri.lib" value="true" />
+
+ <!-- Common build file -->
+ <import file="../../build.xml" />
+
+ <!-- Extras files for WebSphere -->
+
+ <fileset id="ear.lib.extras" dir="${seam.dir}">
+ <!-- Seam deps -->
+ <include name="lib/javassist.jar" />
+
+ <!-- Misc -->
+ <include name="lib/commons-beanutils.jar" />
+ <include name="lib/commons-digester.jar" />
+ <include name="lib/commons-collections.jar" />
+
+ <!-- Hibernate and deps -->
+ <include name="lib/hibernate-core.jar" />
+ <include name="lib/hibernate-commons-annotations.jar" />
+ <include name="lib/hibernate-annotations.jar" />
+ <include name="lib/hibernate-entitymanager.jar" />
+ <include name="lib/hibernate-validator.jar" />
+
+ <include name="lib/antlr.jar" />
+ <include name="lib/dom4j.jar" />
+
+ <include name="lib/slf4j-api.jar" />
+ <include name="lib/slf4j-log4j12.jar" />
+
+ <include name="lib/log4j.jar" />
+ </fileset>
+
+ <fileset id="jar.extras" dir="${resources.dir}/JAR">
+ <include name="**/*.*" />
+ </fileset>
+
+ <fileset id="war.extras" dir="${resources.dir}">
+ <include name="WEB-INF/classes/**/*" />
+ </fileset>
+
+</project>
+
Modified: branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml 2009-08-03 13:45:14 UTC (rev 11335)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -55,6 +55,12 @@
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
+ <!-- Welcome File -->
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
<!-- JEE5 EJB3 names -->
<ejb-local-ref>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar 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/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+
+</ejb-jar>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar-bnd
+ xmlns="http://websphere.ibm.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd"
+ version="1.0">
+
+ <!--
+ This file is required for this sample because:
+ - by default WAS binds the EJB with the fully qualified name of the interface
+ - in component.xml. #{ejbname} resolves to the unqualified name of the implementation class,
+ not the name of the fully qualified interface (use by WebSphere to bind its bean by default)
+ - a (better?) alternative to this file is using the @JndiName seam annotation in each bean
+
+ When using thsi file, set "jndi-pattern" to "ejblocal:#{ejbName}" in components.xml
+ -->
+
+ <session name="AuthenticatorAction" simple-binding-name="AuthenticatorAction" />
+ <session name="BookingListAction" simple-binding-name="BookingListAction" />
+ <session name="ChangePasswordAction" simple-binding-name="ChangePasswordAction" />
+ <session name="HotelBookingAction" simple-binding-name="HotelBookingAction" />
+ <session name="HotelSearchingAction" simple-binding-name="HotelSearchingAction" />
+ <session name="RegisterAction" simple-binding-name="RegisterAction" />
+
+</ejb-jar-bnd>
\ No newline at end of file
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar-ext
+ xmlns="http://websphere.ibm.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-ext_1_0.xsd"
+ version="1.0">
+
+ <!-- Set the expiration timeout to :
+ 10 minutes : HTTP Session timeout set in web.xml
+ +5 minutes : it takes some time for WebSphere to trigger the session expiration
+ = 900 seconds
+ -->
+
+ <session name="BookingListAction"><time-out value="900"/></session>
+ <session name="ChangePasswordAction"><time-out value="900"/></session>
+ <session name="HotelBookingAction"><time-out value="900"/></session>
+ <session name="HotelSearchingAction"><time-out value="900"/></session>
+ <session name="RegisterAction"><time-out value="900"/></session>
+
+</ejb-jar-ext>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+
+ <persistence-unit name="bookingDatabase">
+
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+
+ <jta-data-source>DefaultDatasource</jta-data-source>
+
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
+
+ <!-- Use the "Patched" Hibernate Derby dialect that override the default id generator strategy -->
+ <property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
+ </properties>
+
+ </persistence-unit>
+
+</persistence>
\ No newline at end of file
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,22 @@
+insert into Customer (username, password, name) values ('gavin', 'foobar', 'Gavin King')
+insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User')
+insert into Hotel (price, name, address, city, state, zip, country) values (120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (160, 'Marriot Downtown', '55 Fourth Street', 'San Francisco', 'CA', '94103', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (200, 'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona', 'Catalunya', '08019', 'Spain')
+insert into Hotel (price, name, address, city, state, zip, country) values (210, 'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '', '63405', 'Israel')
+insert into Hotel (price, name, address, city, state, zip, country) values (240, 'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo', '', '105', 'Japan')
+insert into Hotel (price, name, address, city, state, zip, country) values (130, 'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel', '', '2000', 'Switzerland')
+insert into Hotel (price, name, address, city, state, zip, country) values (140, 'Conrad Treasury Place', 'William & George Streets', 'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (price, name, address, city, state, zip, country) values (230, 'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (price, name, address, city, state, zip, country) values (460, 'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA', '30326', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (220, 'Swissotel', '68 Market Street', 'Sydney', 'NSW', '2000', 'Australia')
+insert into Hotel (price, name, address, city, state, zip, country) values (250, 'Meli� White House', 'Albany Street', 'Regents Park London', '', 'NW13UP', 'Great Britain')
+insert into Hotel (price, name, address, city, state, zip, country) values (210, 'Hotel Allegro', '171 West Randolph Street', 'Chicago', 'IL', '60601', 'USA')
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p %X{username} [%-29c{2}] - %m%n"/>
+ </layout>
+ </appender>
+
+<!--
+ <category name="org.hibernate">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.seam">
+ <priority value="DEBUG"/>
+ </category>
+-->
+
+ <root>
+ <priority value="WARN"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/seam.properties
===================================================================
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application 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/application_5.xsd"
+ version="5">
+
+ <display-name>Seam Booking</display-name>
+
+ <module>
+ <web>
+ <web-uri>jboss-seam-jee5-booking.war</web-uri>
+ <context-root>/seam-jee5-booking</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>jboss-seam-jee5-booking.jar</ejb>
+ </module>
+ <module>
+ <ejb>jboss-seam.jar</ejb>
+ </module>
+</application>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:transaction="http://jboss.com/products/seam/transaction"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
+ http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.2.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">
+
+ <!-- works thanks to the values set in the "ibm-ejb-bnd.xml" file AND the ref set in "web.xml" -->
+ <core:init jndi-pattern="ejblocal:#{ejbName}" debug="true" />
+
+ <transaction:ejb-transaction/>
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500"
+ conversation-id-parameter="cid"/>
+
+ <security:identity authenticate-method="#{authenticator.authenticate}"/>
+
+</components>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+ 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/web-facesconfig_1_2.xsd">
+
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"
+
+ no-conversation-view-id="/main.xhtml"
+ login-view-id="/home.xhtml">
+
+ <page view-id="/register.xhtml">
+
+ <action if="#{validation.failed}"
+ execute="#{register.invalid}"/>
+
+ <navigation>
+ <rule if="#{register.registered}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/home.xhtml" action="#{identity.isLoggedIn}">
+
+ <navigation from-action="#{identity.isLoggedIn}">
+ <rule if-outcome="true">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation>
+ <rule if="#{identity.loggedIn}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/password.xhtml"
+ login-required="true">
+
+ <navigation>
+ <rule if="#{identity.loggedIn and changePassword.changed}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/main.xhtml"
+ login-required="true">
+
+ <navigation from-action="#{hotelBooking.selectHotel(hot)}">
+ <redirect view-id="/hotel.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{bookingList.cancel}">
+ <redirect/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/hotel.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>View hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.bookHotel}">
+ <redirect view-id="/book.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/book.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>Book hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.setBookingDetails}">
+ <rule if="#{hotelBooking.bookingValid}">
+ <redirect view-id="/confirm.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/confirm.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>Confirm booking: #{booking.description}</description>
+
+ <navigation from-action="#{hotelBooking.confirm}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="*">
+ <navigation from-action="#{identity.logout}">
+ <redirect view-id="/home.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{hotelBooking.cancel}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <exception class="org.jboss.seam.security.NotLoggedInException">
+ <redirect view-id="/home.xhtml">
+ <message severity="warn">You must be logged in to use this feature</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.faces.application.ViewExpiredException">
+ <redirect view-id="/home.xhtml">
+ <message severity="warn">Session expired, please log in again</message>
+ </redirect>
+ </exception>
+
+</pages>
Added: branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
+ 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/web-app_2_5.xsd">
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- JSF and Facelets -->
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Faces Servlet -->
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <!-- Welcome File -->
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <!-- JEE5 EJB3 names -->
+
+ <ejb-local-ref>
+
+ <!-- This matches the pattern set in components.xml -->
+
+ <ejb-ref-name>ejblocal:EjbSynchronizations</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
+ </ejb-local-ref>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java (rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java 2009-08-03 20:59:44 UTC (rev 11336)
@@ -0,0 +1,19 @@
+import org.hibernate.dialect.DerbyDialect;
+import org.hibernate.id.IdentityGenerator;
+
+
+public class GlassfishDerbyDialect extends DerbyDialect {
+
+ public GlassfishDerbyDialect() {
+
+ }
+
+ @Override
+ public Class getNativeIdentifierGeneratorClass() {
+
+ return IdentityGenerator.class;
+ }
+
+
+
+}
Modified: branches/community/Seam_2_2/examples/jee5/readme.txt
===================================================================
--- branches/community/Seam_2_2/examples/jee5/readme.txt 2009-08-03 13:45:14 UTC (rev 11335)
+++ branches/community/Seam_2_2/examples/jee5/readme.txt 2009-08-03 20:59:44 UTC (rev 11336)
@@ -137,9 +137,9 @@
- http://seamframework.org/Documentation
-WebSphere 6.1.0.13 with EJB3 feature pack
----------------------------
-The instructions for integration with Websphere are fairly verbose. Please
+WebSphere 7
+-----------
+The instructions for integration with WebSphere are fairly verbose. Please
refer to the Seam reference guide for additional information.
- http://seamframework.org/Documentation
15 years, 4 months
Seam SVN: r11335 - in branches/enterprise/JBPAPP_4_3_FP01/src: test/unit/org/jboss/seam/test/unit and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-03 09:45:14 -0400 (Mon, 03 Aug 2009)
New Revision: 11335
Modified:
branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/Call.java
branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java
branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java
branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/MarshalUtils.java
branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/remote.js
branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
Log:
JBPAPP-2272
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/Call.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/Call.java 2009-08-01 18:51:04 UTC (rev 11334)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/Call.java 2009-08-03 13:45:14 UTC (rev 11335)
@@ -10,7 +10,6 @@
import org.jboss.seam.Component;
import org.jboss.seam.annotations.remoting.WebRemote;
-import org.jboss.seam.core.Expressions;
import org.jboss.seam.remoting.wrapper.ConversionException;
import org.jboss.seam.remoting.wrapper.ConversionScore;
import org.jboss.seam.remoting.wrapper.Wrapper;
@@ -25,8 +24,10 @@
private String id;
private String componentName;
private String methodName;
- private String expression;
+ //private String expression;
+ private Throwable exception;
+
private List<Wrapper> params = new ArrayList<Wrapper> ();
private Object result;
@@ -50,18 +51,6 @@
}
/**
- *
- * @param id
- * @param expression
- */
- public Call(String id, String expression)
- {
- this.id = id;
- this.expression = expression;
- this.context = new CallContext();
- }
-
- /**
* Return the call context.
*
* @return CallContext
@@ -70,6 +59,19 @@
{
return context;
}
+
+
+ /**
+ * Returns the exception thrown by the invoked method. If no exception was thrown,
+ * will return null
+ *
+ * @return Throwable
+ */
+ public Throwable getException()
+ {
+ return exception;
+ }
+
/**
* Add a parameter to this call.
@@ -91,7 +93,18 @@
return result;
}
+
/**
+ * Required for unit tests
+ *
+ * @param result
+ */
+ public void setResult(Object result)
+ {
+ this.result = result;
+ }
+
+ /**
* Returns the id of this call.
*
* @return String
@@ -110,6 +123,16 @@
{
return constraints;
}
+
+ /**
+ * Required for unit tests
+ *
+ * @param constraints
+ */
+ public void setConstraints(List<String> constraints)
+ {
+ this.constraints = constraints;
+ }
/**
* Execute this call
@@ -123,10 +146,6 @@
{
processInvocation();
}
- else if (expression != null)
- {
- processExpression();
- }
}
private void processInvocation()
@@ -178,14 +197,16 @@
constraints = Arrays.asList(m.getAnnotation(WebRemote.class).exclude());
// Invoke!
- result = m.invoke(instance, convertParams(m.getGenericParameterTypes()));
+ try
+ {
+ result = m.invoke(instance, convertParams(m.getGenericParameterTypes()));
+ }
+ catch (Exception e)
+ {
+ this.exception = e.getCause();
+ }
}
- private void processExpression()
- {
- result = Expressions.instance().createValueExpression(expression).getValue();
- }
-
/**
* Convert our parameter values to an Object array of the specified target
* types.
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java 2009-08-01 18:51:04 UTC (rev 11334)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/ExecutionHandler.java 2009-08-03 13:45:14 UTC (rev 11335)
@@ -186,13 +186,6 @@
calls.add(call);
}
-
- List<Element> exprElements = env.element("body").elements("eval");
- for (Element e : exprElements)
- {
- Call call = new Call(e.attributeValue("id"), e.attributeValue("expr"));
- calls.add(call);
- }
return calls;
}
@@ -230,8 +223,7 @@
for (Call call : calls)
{
- MarshalUtils.marshalResult(call.getId(), call.getContext(), out,
- call.getResult(), call.getConstraints());
+ MarshalUtils.marshalResult(call, out);
}
out.write(BODY_TAG_CLOSE);
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java 2009-08-01 18:51:04 UTC (rev 11334)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java 2009-08-03 13:45:14 UTC (rev 11335)
@@ -364,7 +364,7 @@
componentSrc.append(i);
}
- componentSrc.append("], callback);\n");
+ componentSrc.append("], callback, exceptionHandler);\n");
componentSrc.append(" }\n");
}
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/MarshalUtils.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/MarshalUtils.java 2009-08-01 18:51:04 UTC (rev 11334)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/MarshalUtils.java 2009-08-03 13:45:14 UTC (rev 11335)
@@ -20,46 +20,63 @@
private static final byte[] VALUE_TAG_OPEN = "<value>".getBytes();
private static final byte[] VALUE_TAG_CLOSE = "</value>".getBytes();
+
+ private static final byte[] EXCEPTION_TAG_OPEN = "<exception>".getBytes();
+ private static final byte[] EXCEPTION_TAG_CLOSE = "</exception>".getBytes();
+
+ private static final byte[] MESSAGE_TAG_OPEN = "<message>".getBytes();
+ private static final byte[] MESSAGE_TAG_CLOSE = "</message>".getBytes();
- public static void marshalResult(String callId, CallContext ctx, OutputStream out,
- Object result, List<String> constraints)
+ public static void marshalResult(Call call, OutputStream out)
throws IOException
{
- if (callId != null)
+ if (call.getId() != null)
{
out.write(RESULT_TAG_OPEN_START);
- out.write(callId.getBytes());
+ out.write(call.getId().getBytes());
out.write(RESULT_TAG_OPEN_END);
}
else
out.write(RESULT_TAG_OPEN);
- out.write(VALUE_TAG_OPEN);
-
- ctx.createWrapperFromObject(result, "").marshal(out);
-
- out.write(VALUE_TAG_CLOSE);
-
- out.write(RequestHandler.REFS_TAG_OPEN);
-
- // Using a for-loop, because stuff can get added to outRefs as we recurse the object graph
- for (int i = 0; i < ctx.getOutRefs().size(); i++)
+ if (call.getException() != null)
{
- Wrapper wrapper = ctx.getOutRefs().get(i);
-
- out.write(RequestHandler.REF_TAG_OPEN_START);
- out.write(Integer.toString(i).getBytes());
- out.write(RequestHandler.REF_TAG_OPEN_END);
-
- if (wrapper instanceof BeanWrapper && constraints != null)
- ((BeanWrapper) wrapper).serialize(out, constraints);
- else
- wrapper.serialize(out);
-
- out.write(RequestHandler.REF_TAG_CLOSE);
+ out.write(EXCEPTION_TAG_OPEN);
+ out.write(MESSAGE_TAG_OPEN);
+ call.getContext().createWrapperFromObject(call.getException().getMessage(), "").marshal(out);
+ out.write(MESSAGE_TAG_CLOSE);
+ out.write(EXCEPTION_TAG_CLOSE);
}
-
- out.write(RequestHandler.REFS_TAG_CLOSE);
+ else
+ {
+ out.write(VALUE_TAG_OPEN);
+
+ call.getContext().createWrapperFromObject(call.getResult(), "").marshal(out);
+
+ out.write(VALUE_TAG_CLOSE);
+
+ out.write(RequestHandler.REFS_TAG_OPEN);
+
+ // Using a for-loop, because stuff can get added to outRefs as we recurse the object graph
+ for (int i = 0; i < call.getContext().getOutRefs().size(); i++)
+ {
+ Wrapper wrapper = call.getContext().getOutRefs().get(i);
+
+ out.write(RequestHandler.REF_TAG_OPEN_START);
+ out.write(Integer.toString(i).getBytes());
+ out.write(RequestHandler.REF_TAG_OPEN_END);
+
+ if (wrapper instanceof BeanWrapper && call.getConstraints() != null)
+ ((BeanWrapper) wrapper).serialize(out, call.getConstraints());
+ else
+ wrapper.serialize(out);
+
+ out.write(RequestHandler.REF_TAG_CLOSE);
+ }
+
+ out.write(RequestHandler.REFS_TAG_CLOSE);
+ }
+
out.write(RESULT_TAG_CLOSE);
}
}
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/remote.js
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/remote.js 2009-08-01 18:51:04 UTC (rev 11334)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/remoting/org/jboss/seam/remoting/remote.js 2009-08-03 13:45:14 UTC (rev 11335)
@@ -152,7 +152,8 @@
}
}
-Seam.Remoting.__Context = function() {
+Seam.Remoting.__Context = function()
+{
this.conversationId = null;
Seam.Remoting.__Context.prototype.setConversationId = function(conversationId)
@@ -166,6 +167,16 @@
}
}
+Seam.Remoting.Exception = function(msg)
+{
+ this.message = msg;
+
+ Seam.Remoting.Exception.prototype.getMessage = function()
+ {
+ return this.message;
+ }
+}
+
Seam.Remoting.context = new Seam.Remoting.__Context();
Seam.Remoting.getContext = function()
@@ -464,7 +475,7 @@
call.asyncReq = Seam.Remoting.sendAjaxRequest(envelope, Seam.Remoting.PATH_EXECUTE, Seam.Remoting.processResponse, false);
}
-Seam.Remoting.createCall = function(component, methodName, params, callback)
+Seam.Remoting.createCall = function(component, methodName, params, callback, exceptionHandler)
{
var callId = "" + Seam.Remoting.__callId++;
if (!callback)
@@ -504,7 +515,7 @@
data += "</call>";
- return {data: data, id: callId, callback: callback};
+ return {data: data, id: callId, callback: callback, exceptionHandler: exceptionHandler};
}
Seam.Remoting.createHeader = function()
@@ -593,9 +604,9 @@
}
}
-Seam.Remoting.execute = function(component, methodName, params, callback)
+Seam.Remoting.execute = function(component, methodName, params, callback, exceptionHandler)
{
- var call = Seam.Remoting.createCall(component, methodName, params, callback);
+ var call = Seam.Remoting.createCall(component, methodName, params, callback, exceptionHandler);
if (Seam.Remoting.inBatch)
{
@@ -731,10 +742,11 @@
var call = Seam.Remoting.pendingCalls.get(callId);
Seam.Remoting.pendingCalls.remove(callId);
- if (call && call.callback)
+ if (call && (call.callback || call.exceptionHandler))
{
var valueNode = null;
var refsNode = null;
+ var exceptionNode = null;
var children = result.childNodes;
for (var i = 0; i < children.length; i++)
@@ -744,15 +756,35 @@
valueNode = children.item(i);
else if (tag == "refs")
refsNode = children.item(i);
+ else if (tag == "exception")
+ exceptionNode = children.item(i);
}
- var refs = new Array();
- if (refsNode)
- Seam.Remoting.unmarshalRefs(refsNode, refs);
-
- var value = Seam.Remoting.unmarshalValue(valueNode.firstChild, refs);
-
- call.callback(value, context);
+ if (exceptionNode != null)
+ {
+ var msgNode = null;
+ var children = exceptionNode.childNodes;
+ for (var i = 0; i < children.length; i++)
+ {
+ var tag = children.item(i).tagName;
+ if (tag == "message")
+ msgNode = children.item(i);
+ }
+
+ var msg = Seam.Remoting.unmarshalValue(msgNode.firstChild);
+ var ex = new Seam.Remoting.Exception(msg);
+ call.exceptionHandler(ex);
+ }
+ else
+ {
+ var refs = new Array();
+ if (refsNode)
+ Seam.Remoting.unmarshalRefs(refsNode, refs);
+
+ var value = Seam.Remoting.unmarshalValue(valueNode.firstChild, refs);
+
+ call.callback(value, context, callId);
+ }
}
}
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-01 18:51:04 UTC (rev 11334)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-03 13:45:14 UTC (rev 11335)
@@ -34,6 +34,7 @@
import org.jboss.seam.contexts.ServletLifecycle;
import org.jboss.seam.init.Initialization;
import org.jboss.seam.mock.MockServletContext;
+import org.jboss.seam.remoting.Call;
import org.jboss.seam.remoting.CallContext;
import org.jboss.seam.remoting.MarshalUtils;
import org.jboss.seam.remoting.client.ParserUtils;
@@ -740,9 +741,10 @@
ByteArrayOutputStream out = new ByteArrayOutputStream();
// Constrain a single field of the result
- List<String> constraints = Arrays.asList(new String[] { "secret" });
- MarshalUtils.marshalResult(null, new CallContext(), out, result,
- constraints);
+ Call c = new Call(null, null, null);
+ c.setConstraints(Arrays.asList(new String[] { "secret" }));
+ c.setResult(result);
+ MarshalUtils.marshalResult(c, out);
SAXReader xmlReader = new SAXReader();
Document doc = xmlReader.read(new StringReader(new String(out
@@ -766,10 +768,9 @@
out.reset();
// Now we're going to constrain result.child's secret field
- constraints = Arrays.asList(new String[] { "child.secret" });
- MarshalUtils.marshalResult(null, new CallContext(), out, result,
- constraints);
-
+ c.setConstraints(Arrays.asList(new String[] { "child.secret" }));
+ MarshalUtils.marshalResult(c, out);
+
doc = xmlReader.read(new StringReader(new String(out.toByteArray())));
widget = (Widget) ParserUtils.unmarshalResult(doc.getRootElement());
assert "foo".equals(widget.getValue());
@@ -789,10 +790,8 @@
// Constrain the "secret" field of the widgetMap map's values (sounds
// confusing, I know...)
- constraints = Arrays
- .asList(new String[] { "widgetMap[value].secret" });
- MarshalUtils.marshalResult(null, new CallContext(), out, result,
- constraints);
+ c.setConstraints(Arrays.asList(new String[] { "widgetMap[value].secret" }));
+ MarshalUtils.marshalResult(c, out);
doc = xmlReader.read(new StringReader(new String(out.toByteArray())));
widget = (Widget) ParserUtils.unmarshalResult(doc.getRootElement());
@@ -812,9 +811,8 @@
result.getWidgetList().add(item);
// Constraint the "secret" field of widgetList
- constraints = Arrays.asList(new String[] { "widgetList.secret" });
- MarshalUtils.marshalResult(null, new CallContext(), out, result,
- constraints);
+ c.setConstraints(Arrays.asList(new String[] { "widgetList.secret" }));
+ MarshalUtils.marshalResult(c, out);
doc = xmlReader.read(new StringReader(new String(out.toByteArray())));
widget = (Widget) ParserUtils.unmarshalResult(doc.getRootElement());
@@ -827,10 +825,8 @@
out.reset();
// Now constrain all secrets
- constraints = Arrays
- .asList(new String[] { "[" + Widget.class.getName() + "].secret" });
- MarshalUtils.marshalResult(null, new CallContext(), out, result,
- constraints);
+ c.setConstraints(Arrays.asList(new String[] { "[" + Widget.class.getName() + "].secret" }));
+ MarshalUtils.marshalResult(c, out);
doc = xmlReader.read(new StringReader(new String(out.toByteArray())));
widget = (Widget) ParserUtils.unmarshalResult(doc.getRootElement());
15 years, 5 months