[JBoss Seam] - Worst possible situation
by yuriy_zubarev
Greeting,
The subject line is grim but true. I was developing Seam app on Windows box and everything worked fine, I put it on a Linux box and it doesn't work and doesn't spit out any exceptions.
Ok, a bit of details. I use Seam 2.0.1 and tomcat 6 on Java 5. Windows and Linux environments have the very same versions of all components. When I started debugging this problem I created a very simple TestWidget entity with two pages to see the list and details for test widgets.
| @Entity
| @Table(name = "test_widgets")
| public class TestWidget implements Serializable {
|
| private int id;
| private String name;
|
| @Id
| @GeneratedValue
| @Column
| public int getId() {
| return id;
| }
|
| public void setId(int id) {
| this.id = id;
| }
|
| @Column
| public String getName() {
| return name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
| }
|
TestWidget class is coming from a maven sub-project and the generated JAR also includes persistence.xml:
| persistence.xml
|
| <?xml version="1.0" encoding="UTF-8"?>
| <persistence version="1.0" 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">
| <persistence-unit name="provisioningDatabase" transaction-type="RESOURCE_LOCAL">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:comp/env/jdbc/ProvisioningDB</jta-data-source>
| <class>mypackage.entity.TestWidget</class>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
| </properties>
| </persistence-unit>
| </persistence>
|
| components.xml
|
| <framework:entity-query name="testWidgets" ejbql="select w from TestWidget w" />
|
| @Name("testWidgetHome")
| public class TestWidgetHome extends EntityHome<TestWidget> {
|
| @Factory("testWidget")
| public TestWidget initModule() {
| return getInstance();
| }
| }
|
| test_widgets.xhtml
|
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:a="http://richfaces.org/a4j"
| xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">
|
| <ui:define name="content">
| <h1>Test Widgets</h1>
| <h:dataTable id="roles" value="#{testWidgets.resultList}" var="w">
| <h:column>
| <f:facet name="header">ID</f:facet>
| #{w.id}
| </h:column>
| <h:column>
| <f:facet name="header">Name</f:facet>
| #{w.name}
| </h:column>
| <h:column>
| <f:facet name="header">Actions</f:facet>
| <s:link value="edit" view="/test_widget.xhtml">
| <f:param name="twId" value="#{w.id}"/>
| </s:link>
| </h:column>
| </h:dataTable>
|
| <h2>Create Test Widget</h2>
| <h:form styleClass="normal-form">
| <fieldset>
| <s:decorate template="layout/edit.xhtml">
| <ui:define name="label">Name:</ui:define>
| <h:inputText value="#{testWidget.name}" id="name" required="true"/>
| </s:decorate>
| </fieldset>
| <div><h:commandButton value="Create" action="#{testWidgetHome.persist}"/></div>
| </h:form>
|
| </ui:define>
|
| </ui:composition>
|
| test_widget.xhtml
|
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:t="http://myfaces.apache.org/tomahawk"
| xmlns:a="http://richfaces.org/a4j"
| xmlns:platform="http://boats.com/platform/taglib"
| xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">
|
| <ui:define name="content">
|
| <h1>Test Widget: #{testWidget.id}</h1>
|
| <h:form>
| <s:decorate template="layout/edit.xhtml">
| <ui:define name="label">Name:</ui:define>
| <h:inputText value="#{testWidget.name}" required="true"/>
| </s:decorate>
|
| <h:commandButton action="#{testWidgetHome.update}" value="Save"/>
| </h:form>
|
| </ui:define>
|
| </ui:composition>
|
| test_widget.page.xml
|
| <page>
| <param name="twId" value="#{testWidgetHome.id}" converterId="javax.faces.Integer"/>
| </page>
|
When I run the app on a windows box everything works. When I run it on a Linux box, I can create widgets and see the list of widgets but when I click to see details of a particular widget, I get a screen with no details information. The screen looks like as if I'm trying to create a new widget. #{testWidget.id} shows "0" and "name" textbox is empty. No exception or warnings in a log file. I'm totally puzzled. This is a very basic set-up and everything works fine on a Windows box.
Any clues would be highly appreciated.
Thank you,
Yuriy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128196#4128196
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128196
18 years, 2 months
[JBoss Seam] - component with multiple interfaces?
by alex.x.zhang
My question is: can you use one component with multiple interfaces for multiple purposes?
I am trying to use one class as both the backing bean and the selectItem converter, like this:
@Stateful
| @Name("fooManager")
| @org.jboss.seam.annotations.faces.Converter
| public class FooManagerBean implements FooManager, javax.faces.convert.Converter{
|
| }
|
| <h:selectOneMenu ... converter="#{fooManager}"></h:selectOneMenu>
|
But at run time I got this exception:
anonymous wrote : Cannot convert FooManagerBean:3j011-5hrmn-fcfnjsws-1-fcfnlgsp-13 of type class org.javassist.tmp.java.lang.Object_$$_javassist_6 to interface javax.faces.convert.Converter
I think this is neat because the converter and the backing bean are all together so there is no need to pass data around and no synchronization issues.
Is this possible?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128193#4128193
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128193
18 years, 2 months
[JNDI/Naming/Network] - JNDI Problems with Cluster, Windows XP
by MarcusDidiusFalco
Hallo I am just trying to learn more about JBoss.
I have a single Windows XP machine.
JBoss 4.0.2.GA
With a non-clustered setup I have never had any problems with JNDI. However when I try even the simplest application in a cluster (vertical, copied the all configuration two times and used the BindingManager in one of them), I cannot get a connection to the JNDI Service working.
Both instances start up normally. In the the jmx-console I can see the HAJNDI.
With
jndi.properties on the client side
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming
| java.naming.provider.url=localhost:1100
I get a
anonymous wrote : javax.naming.NotContextException
| at org.jnp.server.NamingServer.lookup(NamingServer.java:285)
| at org.jboss.ha.jndi.TreeHead.lookupLocally(TreeHead.java:296)
| at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:215)
| at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:155)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Met
The same with port 1099.
The logs show nothing.
When I switch back to a non-clustered application the jndi-Lookup on 1099 works normally.
I really need a working testing enviroment to learn about JBoss clustering. Any help would be greatly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128186#4128186
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128186
18 years, 2 months