[JBoss Seam] - skeleton generated by Hibernate does not work, probably data
by bpgergo
Hi,
I generated a seam skeleton app with Hibernate tools from a legacy db.
Hibernate version: 3.2.4.sp1, May 18, 2007
Hibernate tools version: org.hibernate.eclipse, 3.2.0.beta8
DB type &version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit on Windose 2003 SP2, x64 Edition
Appserver: jboss-4.0.5.GA (installed with JEMS 1.2 Installer and the ejb3 profile selected)
Framework:jboss-seam-1.2.1.GA
The seam example apps are working fine.
My generated sekeleton app does not work after deployment, and I can not figure out what could be the problem. I guess the app can not really connect to the db.
This is the typical exception thrown by every page:
| exception
|
| javax.servlet.ServletException: Cannot get value for expression '#{tirolesFinder.example.roId}'
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
| org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| root cause
|
| javax.faces.FacesException: Cannot get value for expression '#{tirolesFinder.example.roId}'
| org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
| org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
| org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
|
Here are those files which I consider to be relevant supposing it is some kind of a datasource problem.
persistence.xml
| <entity-manager>
| <persistence-unit name="entityManager">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <!-- modified manually from DefaultDS -->
| <jta-data-source>java:/TimeDS</jta-data-source>
| <properties>
| <!-- modified manually from HSQLDialect -->
| <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
| <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
| <property name="hibernate.transaction.flush_before_completion" value="true" />
| <!-- commented manually -->
| <!--property name="hibernate.hbm2ddl.auto" value="create-drop" /-->
| <property name="hibernate.show_sql" value="true" />
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/seamappEntityManagerFactory" />
| </properties>
| </persistence-unit>
| </entity-manager>
|
time-ds.xml
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!-- ===================================================================== -->
| <!-- -->
| <!-- JBoss Server DataBase Configuration -->
| <!-- created manually -->
| <!-- ===================================================================== -->
|
| <datasources>
|
| <local-tx-datasource>
| <jndi-name>TimeDS</jndi-name>
| <connection-url>jdbc:oracle:thin:@localhost:1521:time</connection-url>
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>SON</user-name>
| <password>risa</password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>20</max-pool-size>
|
| <metadata>
| <type-mapping>Oracle10g</type-mapping>
| </metadata>
| </local-tx-datasource>
|
| </datasources>
|
build.xml
| <?xml version="1.0"?>
| <project name="SeamApplication" default="deploy" basedir=".">
| <!-- Allow this to be overriden by others importing this project. -->
| <dirname property="imported.basedir" file="${ant.file.Seam}" />
| <!-- Give user a chance to override without editing this file or typing -D -->
| <property file="${imported.basedir}/build.properties" />
| <!-- Name of project and version, used to create filenames -->
| <property name="Name" value="SeamApplication" />
| <property name="name" value="seamapp" />
| <!-- set global properties for this build -->
| <property name="build.dir" value="build" />
| <property name="classes.dir" value="${build.dir}/classes" />
| <property name="src.java.dir" value="src" />
| <property name="lib.dir" value="lib" />
| <property name="deploy.dir" value="${jboss.home}/server/default/deploy" />
| <property name="javac.debug" value="true" />
| <property name="javac.deprecation" value="false" />
| <!-- WAR -->
| <zipfileset id="war.docroot" dir="resources/jsp">
| <include name="**/*" />
| </zipfileset>
| <zipfileset id="war.webinf" prefix="WEB-INF" dir="resources/WEB-INF">
| <patternset refid="meta.files" />
| </zipfileset>
| <zipfileset id="war.webinf.lib" prefix="WEB-INF/lib" dir="resources/WEB-INF/lib">
| <include name="*.jar" />
| </zipfileset>
| <!-- EJB3 -->
| <fileset id="ejb3.root" dir="resources">
| <include name="import.sql" />
| <include name="seam.properties" />
| <include name="META-INF/persistence.xml" />
| </fileset>
| <fileset id="ejb3.lib" dir="lib">
| <include name="jboss-seam.jar" />
| </fileset>
| <!-- EAR -->
| <zipfileset id="ear.resources" prefix="META-INF" dir="resources/META-INF">
| <include name="*" />
| <exclude name="persistence.xml" />
| </zipfileset>
| <!-- Deploy -->
| <fileset id="deploy" dir="resources">
| <include name="_NONE_" />
| <!-- added manually -->
| <include name="time-ds.xml"/>
| </fileset>
| <!-- Undeploy -->
| <patternset id="undeploy">
| <include name="_NONE_" />
| </patternset>
| <path id="build.classpath">
| <fileset dir="${lib.dir}">
| <include name="**/*.jar" />
| </fileset>
| </path>
| <patternset id="meta.files">
| <include name="**/*.dtd" />
| <include name="**/*.xml" />
| <include name="**/*.xslt" />
| <include name="**/*.properties" />
| </patternset>
| <patternset id="src.files">
| <!-- include everything we want in the src directory
| that we didn't want in the jar itself -->
| <include name="**/*.java" />
| </patternset>
| <target name="clean" description="Cleans up the build directory">
| <delete dir="${build.dir}" />
| </target>
| <target name="init" description="Initialize the build">
| <echo message="Build ${Name}" />
| <mkdir dir="${classes.dir}" />
| <copy todir="${classes.dir}">
| <fileset dir="${src.java.dir}">
| <patternset refid="meta.files" />
| </fileset>
| </copy>
| </target>
| <target name="compile" depends="init" description="Compile the Java source code">
| <javac destdir="${classes.dir}" classpathref="build.classpath" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on">
| <src path="${src.java.dir}" />
| </javac>
| </target>
| <target name="war" depends="compile">
| <jar destfile="${build.dir}/${name}.war">
| <zipfileset refid="war.docroot" />
| <zipfileset refid="war.webinf" />
| <zipfileset refid="war.webinf.lib" />
| </jar>
| </target>
| <target name="ejb3" depends="compile">
| <jar jarfile="${build.dir}/${name}.ejb3">
| <fileset dir="${imported.basedir}">
| <include name="${name}.jar" />
| </fileset>
| <fileset dir="${classes.dir}">
| <include name="**/*.class" />
| <exclude name="**/test/*.class" />
| </fileset>
| <fileset refid="ejb3.root" />
| <fileset refid="ejb3.lib" />
| </jar>
| </target>
| <target name="ear" depends="ejb3, war">
| <jar destfile="${build.dir}/${name}.ear">
| <zipfileset dir="${build.dir}">
| <include name="${name}.ejb3" />
| </zipfileset>
| <zipfileset dir="${build.dir}">
| <include name="${name}.war" />
| </zipfileset>
| <zipfileset refid="ear.resources" />
| </jar>
| </target>
| <target name="deploy" depends="ear">
| <property name="unit.ext" value="ear" />
| <fail unless="jboss.home">jboss.home MUST be set. Update build.properties to point to a valid JBoss installation.</fail>
| <copy todir="${deploy.dir}">
| <fileset refid="deploy" />
| </copy>
| <copy file="${build.dir}/${name}.${unit.ext}" todir="${deploy.dir}" />
| </target>
| <target name="undeploy">
| <property name="unit.ext" value="ear" />
| <delete file="${deploy.dir}/${name}.${unit.ext}" />
| <delete>
| <fileset dir="${deploy.dir}">
| <patternset refid="undeploy" />
| </fileset>
| </delete>
| </target>
| <target name="cleandb">
| <delete dir="${deploy.dir}/../data/hypersonic" />
| </target>
| </project>
|
There's one more thing which is hopefully irrelevant for now (though it could be interesting for Hibernate tools developers). One of the generated EditorBeans was also modified manually, because it did not compile.
All modifications was similar to this one:
| if (instance.getTiPersons()!=null) {
| //corrected manually
| //instance.getTiPersons().getTiTimess().add(instance);
| instance.getTiPersons().getTiTimeses().add(instance);
| }
|
Apart from this error, all the Java and JSF seems sound to me.
Thanks for your help.
Gergo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059723#4059723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059723
17Â years, 7Â months
[JNDI/Naming/Network] - Ports disappear in JBoss 3.2.6
by Sekhara
Please Help !!!
Hi,
We are running a CRM application on JBoss 3.2.6. across 4 HP Unix hosts. Each unix host possesses 4 JBoss Process Kernels.
The lsof utility provides a breakdown of each pid. This is what i see which is quite wierd. If anyone can give me an explanation i would be most greatful !!!
-----------------
The pids listed are those belonging to each VM on one host and was taken on 070622 at 17h16.
$ grep LIST instfd_mp2hs100_070622_1716.log|grep 280|grep -v 4099
java 11434 user 68u IPv4 0x958e2280 0t0 TCP *:9280 (LISTEN)
java 11443 user 68u IPv4 0x5f0d2500 0t0 TCP *:10280 (LISTEN)
java 11453 user 68u IPv4 0x60271880 0t0 TCP *:11280 LISTEN)
java 11462 user 68u IPv4 0x5f0d2500 0t0 TCP *:10280 (LISTEN)
About 12 minutes later, the pids are all the same, implying that the VM's were not restarted, but the listening ports are now all 9280 on the same host ????? Why ?
$ grep LIST instfd_mp2hs100_070622_1728.log|grep 280|grep -v 4099
java 11434 user 68u IPv4 0x958e2280 0t0 TCP *:9280 (LISTEN)
java 11443 user 68u IPv4 0x958e2280 0t0 TCP *:9280 (LISTEN)
java 11453 user 68u IPv4 0x958e2280 0t0 TCP *:9280 (LISTEN)
java 11462 user 68u IPv4 0x958e2280 0t0 TCP *:9280 (LISTEN)
Any ideas ?
Regards
Chan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059721#4059721
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059721
17Â years, 7Â months
[Installation, Configuration & Deployment] - JBoss-4.2.0.GA readme.html jboss-native-2.0.0-windows-i686.
by roxello
Hello -
The readme.html file (in the JBoss-4.2.0.GA distribution,
the 'Highlights' paragraph, JBoss Web bullet point) refers to
native libraries for hybrid deployment. jboss-native-2.0.0-windows-i686.zip
downloaded from labs.jboss.com/jbossweb/downloads,
JBoss Native 2.0.0 section, contains README-service.txt (full txt below)
which appears confusing. The terms JBoss AS, JBoss Application Server
and JBoss Web Server seem to be used interchangeably. Is JBoss
Application Server/ JBoss AS synonymous with JBoss Web Server?
| The JBoss(R)* app server is Copyright 2000-2007, Red Hat Middleware LLC
| and individual contributors, and is licensed under the GNU LGPL.
|
|
| How to run JBoss AS as a Windows Service
|
| JBoss AS comes with Windows service executable as part of JBossNative
| that can run JBoss Application Server as service.
| The service executable jbosssvc.exe transforms the run.bat and
| shutdown.bat batch scripts to services. This means that any change
| made to those scripts will be used both in service and command
| line mode.
|
|
| To install the JBoss Application Server as Windows service use
| the provided service.bat batch file.
|
| C:\> cd c:\jboss-4.2.0\bin
| C:\> service.bat install
|
| To start the JBoss Web server as Windows service use Control pannel or
| net start command. When running in service mode the console output is
| redirected to the file run.log. You can inspect the file for any errors
| during service startup.
|
|
| C:\> net start JBAS4SVC
| The JBoss Application Server 4.2 service is starting.
| The JBoss Application Server 4.2 service was started successfully.
|
|
| To stop the JBoss Web server as Windows service use Control pannel
| or net stop command. When running in service mode the console output
| is redirected to the file shutdown.log. You can inspect the file for
| any errors during service shutdown.
|
|
| C:\> net stop JBAS4SVC
| The JBoss Web Server 4.2 service was stopped successfully.
|
|
| To restart the JBoss Web server as Windows service use Control pannel.
|
| To remove the JBoss Web server as Windows service use the provided
| service.bat batch file.
|
|
| C:\> cd c:\jboss-4.2.0\bin
| C:\> service.bat uninstall
|
|
| Service customization is done by editing the service.bat script.
| Each command has a separate section that you can customize. The most
| common customization task would be changing service names if more then
| one service instances per box are required.
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059719#4059719
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059719
17Â years, 7Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Mapping @Enumerated to Numeric Values
by jfrankman
I found a partial solution. If I do the following:
1.change the column from varchar to integer in the DB table.
2. Change the EnumType to ORDINAL
@Column(name = "TYPEPAYMENT")
| @Enumerated(EnumType.ORDINAL)
| public TypePayment getTypePayment() {
| return typePayment;
| }
Then I can get it to work. This works except there is a gap in the values. Allowed values are 1-7 and 9. Zero and Eight are excluded. But since the ordinal begins with zero there is not a way for me to handle this unless I put a dummy enumerated values in positions 0 and 8 in my enumeration.
| public enum TypePayment
| {
| DUMMY0("dummy0"),
| ANNUAL("Annual"),
| SEMI("Semi-Annual ($4 Fee)"),
| FOUR_PAY("4-Pay ($12 Fee)"),
| QUARTERLY("Quarterly ($12 Fee)"),
| TWELVE_PAY("12-Pay (No Fee)"),
| MONTHLY("Monthly"),
| DEFERRED("Deferred ($7 Fee)"),
| DUMMY8("dummy8"),
| OTHER("Other")
| ;
|
The problem with the above solution is that I will have to exclude ordinals 0 and 8 in my application by makeing them not appear in drop down boxes, etc. I wish there was a way I could map and enumeration to numeric values using the EnumType(STRING).
Any ideas are appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059718#4059718
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059718
17Â years, 7Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Mapping @Enumerated to Numeric Values
by jfrankman
All,
I have a column in a Table with values 1-9. Each value is a code that represents a certain value i.e.
1=Annual
2=Semi Annual
3=Quarterly
I want to map this column to an Enumeration. I have created the following Enumeration:
@Name("typePayment")
| public enum TypePayment
| {
| 1("Annual"),
| 2("SemiAnnual"),
| 3("Quarterly")
| }
|
In my class I have mapped a column to this enumeration as follows:
| @Column(name = "TYPEPAYMENT")
| @Enumerated(EnumType.STRING)
| public TypePayment getTypePayment() {
| return typePayment;
| }
|
The problem is any value beginning with a number is not allowed as an enumerated value. So I get a compile error in my enumeration. I can change the enumeration to contain something like A, B, C instead of 1,2,3 but I am working against legacy data and cannot easily change the data values contained in the table from numbers to letters.
So my question is, how can I map an enumeration to a table column where the values contained in the column will be digits 0-9?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059713#4059713
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059713
17Â years, 7Â months