[Installation, Configuration & DEPLOYMENT] - Re: 5.0 beta3, war class scoping problem
by PeterJ
Here are the test files:
RouteServlet.java
package peter.scope;
| import java.io.*;
| import javax.servlet.ServletException;
| import javax.servlet.http.*;
| public class RouteServlet extends HttpServlet {
| protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
| IOException {
| InEar ie = new InEar();
| String result = ie.route();
| PrintWriter out = resp.getWriter();
| out.print("<html><body><h2>" + result + "</h2></body></html>");
| }
| protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
| IOException {
| doGet(req, resp);
| }
| }
InWar.java
package peter.scope;
| public class InWar {
| public String route() {
| return "oops";
| }
| }
InEar.java
package peter.scope;
| public class InEar {
| public String route() {
| String result = null;
| try {
| result = callInWar();
| } catch (Throwable e) {
| result = "exception when calling InWar: " + e;
| }
| return result;
| }
| private String callInWar() {
| InWar id = new InWar();
| return id.route();
| }
| }
application.xml
<application>
| <display-name>Route</display-name>
| <module>
| <java>inear.jar</java>
| </module>
| </application>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
| <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
| version="2.5"
| >
| <servlet>
| <servlet-name>Route</servlet-name>
| <servlet-class>peter.scope.RouteServlet</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>Route</servlet-name>
| <url-pattern>/route</url-pattern>
| </servlet-mapping>
| <welcome-file-list>
| <welcome-file>route</welcome-file>
| </welcome-file-list>
| </web-app>
Compile the three Java source files together. Then package the files as follows:
inear.jar should contain:
peter/scope/InEar.class
inear.ear should contain:
inear.jar
META-INF/application.xml
route.war should contain:
WEB-INF/web.xml
WEB-INF/classes/peter/scope/InWar.class
WEB-INF/classes/peter/scope/RouteServlet.class
Deploy inear.ear and route.war, point a browser at http://localhost:8080/route.
When I do this on 5.0.0.Beta3, the browser displays:
anonymous wrote : oops
When I do this on 4.2.2.GA, the browser displays:
anonymous wrote : exception when calling InWar: java.lang.NoClassDefFoundError: peter/scope/InWar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118858#4118858
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118858
18 years, 3 months
[JBoss Seam] - Re: How to control end of conversations/state of stateful be
by chris.simons
I think part of the problem here is that outside of a few, small example applications provided by the gracious Seam team, there are no true examples of a large, enterprise-level application properly using Seam conversations.
Seam is so closely coupled with conversations that there is no true way of escaping them. Yet the amount of confusion over how to manage them in an Web environment where the user is truly allowed to go anywhere, do anything, start any process and end it at any time, should point out to the Seam team that *are* issues with conversations in general.
They're a great idea - but I know we're struggling with their usage. Results are unpredictable at best. The authors of Seam documentation attempt to show its great value but in practice it is hard to come by. Try using breadcrumbs based off of Seam conversations - I'll tell you upfront that it simply will cause more headaches than it is worth in a system with many pages and processes.
I think there needs to be a definitive, large-scale example on how to manage conversations in an enterprise application. There is simply too much confusion for this to be ignored.
My two cents.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118845#4118845
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118845
18 years, 3 months