[JBoss Seam] - Re: DBUnit Data
by neilac333
As Stewie on Family Guy might say, "Victory is mine!"
I discovered why the data was disappearing. As I said, the DBUnit Ant task was populating the database as I wanted, but something was happening when I ran my SeamTest, which retrieved that data through JPA. Well, the persistence unit through which I created the entity manager had hibernate.hbm2ddl.auto set to "create-drop." Just one setting among many. Once I set it to "update," everything worked as it should. This goes to show how the littlest, seemingly unrelated thing can have profound side effects.
Of course, I still have no idea how to get my DBUnitSeamTest past that exception, but at least now I can test my code the old-fashioned way!
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102769#4102769
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102769
18 years, 7 months
[EJB 3.0] - tables cannot be created automatically.WHY?
by caijc
jboss4.2,postgresql7.2,jdk1.6:
in persistence.xml,I used:
<jta-data-source>java:/PostgresDS</jta-data-source>
org.hibernate.ejb.HibernatePersistence
create-drop
org.hibernate.dialect.PostgreSQLDialect
Here I set "hibernate.hbm2ddl.auto" to "create-drop",and in JMX-console I also see this DSN:PostgresDS;
and in postgres-ds.xml,it also seems no errors:
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://127.0.0.1:5432/my</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgresql</user-name>
111111
but when I access the entities from JSP,exceptions are thrown:
java.sql.BatchUpdateException: insert into tbl_Authors (birthday, levels, name) values (2007-11-08 +00:00:00, 5, wawa) failed
LOOK:neither '2007-11-08 +00:00:00' nor 'wawa' are quoted with quotation marks,I think this is wrong.But why? it's generated by hibernate itself,not me!
What's more,I login the postgresql database,and there is no tables created automatically either.Why this happens?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102768#4102768
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102768
18 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - strange PersistenceException with EJB3:tables cannot be crea
by caijc
jboss4.2,postgresql7.2,jdk1.6:
in persistence.xml,I used:
<jta-data-source>java:/PostgresDS</jta-data-source>
org.hibernate.ejb.HibernatePersistence
create-drop
org.hibernate.dialect.PostgreSQLDialect
Here I set "hibernate.hbm2ddl.auto" to "create-drop",and in JMX-console I also see this DSN:PostgresDS;
and in postgres-ds.xml,it also seems no errors:
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc:postgresql://127.0.0.1:5432/my</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgresql</user-name>
111111
but when I access the entities from JSP,exceptions are thrown:
java.sql.BatchUpdateException: insert into tbl_Authors (birthday, levels, name) values (2007-11-08 +00:00:00, 5, wawa) failed
LOOK:neither '2007-11-08 +00:00:00' nor 'wawa' are quoted with quotation marks,I think this is wrong.But why? it's generated by hibernate itself,not me!
What's more,I login the postgresql database,and there is no tables created automatically either.Why this happens?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102767#4102767
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102767
18 years, 7 months
Re: Running JBoss 4.0 as a Windows Service
by samk@twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=23 Posted on behalf of a User
This worked fine for me w/ JBoss 4.0.5.
I used the same setup for a 4.2.2 box, but w/ the added "security" feature, it only runs on the "localhost" address.
Is there an easy way to change this to run on the NIC address, or both? Comparable to doing "run.bat -b 0.0.0.0" or "run.bat -b 192.168.100.123"
Thanks!
In Response To:
People have been complaining bitterly about JBoss 4.0.3SP1 crashing nightly with Java 1.5. We have looked
at that problem reported and we cannot figure out why the JVM is complaining. Repeated bug reports to
Sun, according to this person, have produced no results. Therefore we have taken a Windows desktop running
Windows 2000 and have installed JBoss as a server. Now I will admit that we are Unix/Linux bigots and
it was somewhat painful to work on a windows machine. Difficult to keep / \ apart not to mention the space
between program files. It is enough to drive you batty but we have presevered and have got JBoss to run
as a server. The beauty of this is that you can configure the Service to restart in a minute if it crashes
so even if Java 1.5 is buggy as all heck this should keep your application server afloat.
All the samples that we found showing how to run JBoss as a service are buggy. Use what we have done
here to have a smooth install.
1. Download JavaService-2.0.7.zip from http://forge.objectweb.org/project/showfiles.php?group_id=137
2. Extract to C:\JavaService-2.0.7
3. copy JavaService.exe to jboss bin directory. In our case C:\Program Files\jboss-4.0.2
4. Make sure JBOSS_HOME and JAVA_HOME are set. In our case: C:\Program Files\jboss-4.0.2 and C:\Program
Files\Java\jdk1.5.0_02 respectively
5. Create a batch file install.bat in %JBOSS_HOME%/bin directory. Its contents should be as follows:
Rem Start Here
set javadll=%JAVA_HOME%\jre\bin\client\jvm.dll
set javatool=%JAVA_HOME%\lib\tools.jar
set javarun=%JBOSS_HOME%\bin\run.jar
set outlog=%JBOSS_HOME%\bin\stdout.log
set errlog=%JBOSS_HOME%\bin\stderr.log
JBossService.exe -install JBoss "%javadll%" -Djava.class.path="%javatool%";"%javarun%" -start org.jboss.Main
-stop org.jboss.Main -method systemExit -out "%outlog%" -err "%errlog%" -current "%JBOSS_HOME%\bin" -manual
Rem End Here
Make sure to set word wrap off in the file and do not forget the quotes. This will allow the Program
Files path to work correctly. You can change the location of stderr.log and stdout.log to server/model/log
if you prefer.
Start a cmd window and cd to %JBOSS_HOME%\bin. run install.bat by typing install. This will install JBoss
as a service.
To start the service type net start JBoss.
JBoss should now be running as a service. Enjoy.
18 years, 7 months