[Persistence, JBoss/CMP, Hibernate, Database] - hibernate SessionFactory lookup return null
by goodidea
My hibernate-service.xml
| <server>
| <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
| <attribute name="DatasourceName">java:/reqDS</attribute>
| <attribute name="Dialect">org.hibernate.dialect.MySQL5InnoDBDialect</attribute>
| <attribute name="ShowSqlEnabled">true</attribute>
| <attribute name="SessionFactoryName">hibernate/SessionFactory</attribute>
| </mbean>
| </server>
|
req.har successfully loaded.
In my swing client I am trying to lookup "SessionFactory"
| InitialContext ctx=new InitialContext();
| Object obj=ctx.lookup("java:/hibernate/SessionFactory");
|
obj is ALWAYS NULL. Help please.
Release ID: JBoss [Trinity] 4.2.1.GA,
Hibernate-Version: 3.2.4.sp1
ctx.list("") return all my jndi Objects properly, and hibernate also in that list.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118150#4118150
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118150
18 years, 3 months
[JBoss Seam] - Re: Changing Look and Feel of Seam Gen-ed apps
by thejavafreak
"jfrankman" wrote : In order to get a jump start with Seam a few months ago we used the Seam Gen tool to generate an applicaiton from our database. We are at a point now where we would like to modify the way the application looks. Specifically we are trying to shrink the size of the generated Edit pages to fit more fields into a smaller area. It looks like this will require use to modify the css and/or templates that the seam gen tool created. However, I wanted to probe for any tips or advice from anyone before we get started.
|
I use the h:panelGrid for this. It is much easier than using html table and css. You can define how many columns you want and how the column look like with the css.
"jfrankman" wrote :
| Also, is there an easy way to change the css dynamically based upon user actions on a "settings form" of some kind?
|
|
Check point 14.4 in the document. Is that what you're looking for?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118138#4118138
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118138
18 years, 3 months
[JBoss Seam] - @EndTask do not work in method calls!!
by rainhust
in a backing method call another method which annotated with @EndTask and the task do not end .
if call the annotated method from backing method , it's work.
for example:
there is a seam component
| @Stateful
| @Name("chiefExamine")
| public class ChiefExamineAction implements ChiefExamine , Serializable {
| @EndTask(transition="need modify form")
| public String reject() {
| log.info("endTask: reject");
| // modify form
| return "admin";
| }
| @BeginTask
| public String viewTask() {
| loadBaoxiaoInfo();
| return "examine";
| }
| @EndTask(transition="to result")
| public String accept() {
| log.info("endTask: accept");
| return "admin";
| }
|
| @Transactional
| public String saveApprove() {
| this.approve.setBaoxiao(getBaoxiao());
| this.approve.setDate(new Date());
| this.approve.setUser(user);
|
| em.persist(this.approve);
| em.flush();
| // call the @EndTask method.
| if(approve.getResult().equals("agree")) {
| return this.accept();
| }else if(approve.getResult().equals("more info")) {
| return this.reject();
| } else return "admin";
| }
|
in jsp pages:
| <h:commandButton action="#{chiefExamine.saveApprove}" value="Submit" />
|
| <h:commandButton action="#{chiefExamine.accept}" value="Accept Request" />
|
if using #{chiefExamine.saveApprove}, then the task do not end.
if using #{chiefExamine.accept}, then the task can end .
but if i put the saveApprove method in accept method, like this:
@EndTask(transition="to result")
| public String accept() {
| log.info("endTask: accept");
| saveApprove(); // call the save method from there will cause exception
| return "admin";
| }
|
this will cause one exception. see there:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=127226
so i want to know why the @EndTask do not work when call the annotated method from other backing method. or something i do wrong.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118137#4118137
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118137
18 years, 3 months
[Installation, Configuration & DEPLOYMENT] - Re: Exception creating identity
by tmerrill
Here is my script that I use to start and stop the jboss service
| #!/bin/sh
| #
| # $Id: jboss_init_redhat.sh 60992 2007-02-28 11:33:27Z dimitris(a)jboss.org $
| #
| # JBoss Control Script
| #
| # To use this script run it as root - it will switch to the specified user
| #
| # Here is a little (and extremely primitive) startup/shutdown script
| # for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
| # it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.
| # All this can be changed in the script itself.
| #
| # Either modify this script for your requirements or just ensure that
| # the following variables are set correctly before calling the script.
|
| #Enter the IP address of your server
| JBOSS_HOST="127.0.0.1"
|
| #define where jboss is - this is the directory containing directories log, bin, conf etc
| JBOSS_HOME=${JBOSS_HOME:-"/server/jboss"}
|
| #define the user under which jboss will run, or use 'RUNASIS' to run as the current user
| #JBOSS_USER=${JBOSS_USER:-"jboss"}
| JBOSS_USER=${JBOSS_USER:-"root"}
|
| #make sure java is in your path
| JAVAPTH=${JAVAPTH:-"/usr/lib/jvm/java-6-sun"}
|
| #configuration to use, usually one of 'minimal', 'default', 'all'
| JBOSS_CONF=${JBOSS_CONF:-"vencomm"}
|
| #if JBOSS_HOST specified, use -b to bind jboss services to that address
| JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}
|
| #define the classpath for the shutdown class
| JBOSSSTOP=${JBOSSSTOP:-"$JBOSS_HOME/bin/shutdown.sh -s $JBOSS_HOST:1099 -S"}
|
| #define the script to use to start jboss
| JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR"}
|
| if [ "$JBOSS_USER" = "RUNASIS" ]; then
| SUBIT=""
| else
| SUBIT="su - $JBOSS_USER -c "
| fi
|
| if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
| # ensure the file exists
| touch $JBOSS_CONSOLE
| if [ ! -z "$SUBIT" ]; then
| chown $JBOSS_USER $JBOSS_CONSOLE
| fi
| fi
|
| if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
| echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
| echo "WARNING: ignoring it and using /dev/null"
| JBOSS_CONSOLE="/var/log/jboss/jboss.log"
| fi
|
| #define what will be done with the console log
| JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/var/log/jboss/jboss.log"}
|
| JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
| JBOSS_CMD_STOP="cd $JBOSS_HOME/bin; $JBOSSSTOP"
|
| if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
| export PATH=$PATH:$JAVAPTH
| fi
|
| if [ ! -d "$JBOSS_HOME" ]; then
| echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
| exit 1
| fi
|
|
| case "$1" in
| start)
| echo JBOSS_CMD_START = $JBOSS_CMD_START
| cd $JBOSS_HOME/bin
| if [ -z "$SUBIT" ]; then
| eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
| else
| $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"
| fi
| ;;
| stop)
| if [ -z "$SUBIT" ]; then
| $JBOSS_CMD_STOP
| else
| $SUBIT "$JBOSS_CMD_STOP"
| fi
| ;;
| restart)
| $0 stop
| $0 start
| ;;
| *)
| echo "usage: $0 (start|stop|restart|help)"
| esac
|
I have also tried running directly from $JBOSS_HOME/bin/run.sh and I get the same error.
I have even tried using JBoss AS 4.2.2 with by configuration, I still get the same error. I bet some Ubuntu update did something but I am trying to recall if I ran updates on this server. I am the only sys admin so it had to have been me... if I could recall with some clarity that would be nice.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118136#4118136
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118136
18 years, 3 months