[EJB 3.0] - Two databases, two persistence-units but one entity jar-file
by ville-ingman
Hi all,
This message was initially sent to Hibernate forums, but Emmanuel from the Hibernate Team suggested to post this it here. Hibernate thread is http://forum.hibernate.org/viewtopic.php?p=2338630.
I'm trying to create two different database schemas from one entity jar-file. The point is that I need one DB for the actual data and exactly identical DB for backup purposes etc. My operative DB works just fine and all tables are created, but the problem is that my backup DB remains empty without any errors from Hibernate. I get no tables, no errors, no warnings and nothing seems to be wrong in log-files either. The other DB just remains empty.
Log-file is identical with both of these persistence-units. Hibernate tells me that this-n-that table not found in database etc and it leads to table creation in my operative database, like it should be. Nothing, absolutely nothing, happens to my backup persistence-unit.
I have JBoss 4.0.5.GA and Hibernate 3.2.1.GA. Both databases are empty and listed in deploy/postgres-ds.xml and they do exist before JBoss launch. My app is packed inside an EAR and my EJB-module has this persistence.xml listed below.
My persistence.xml:
<persistence-unit name="my-operative-db">
<jta-data-source>java:/my-operative-db</jta-data-source>
<jar-file>../entity-data.jar</jar-file>
<properties...
</persistence-unit>
<persistence-unit name="my-backup-db">
<jta-data-source>java:/my-backup-db</jta-data-source>
<jar-file>../entity-data.jar</jar-file>
<properties...
</persistence-unit>
Does any one have similar problems? Am I missing something or is there something wrong in JBoss/Hibernate? Some one please try this out and post your comments.
I didn't open a JIRA issue on this yet. I'd like to wait if someone has more info on this and perhaps a JIRA issue isn't needed. Atleat I keep my fingers crossed on that. :)
Thanks for advance,
Ville
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006225#4006225
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006225
19 years, 3 months
[JBoss and NetBeans] - Server instance location is null
by erkinda
hai
I have jboss as, installed at same computer and registered in netbeans.
I set jboss as target server for LoanProcessingCompositeApp http://blogs.sun.com/pcmreddy/resource/loanProcessing.zip
When I try to deploy this project, I have error "Server instance location is null"
jboss started from netbeans and work
jboss directory have default folder and files
server\default\deploy\jbossweb-tomcat55.sar\server.xml.
server\default\deploy\hsqldb-ds.xml.
build.xml:
PackageRetrievedFiles:
Deleting directory C:\jboss\projects\netbeans\loanProcessing\LoanRequestorBpel\build\dependentProjectFiles
Created dir: C:\jboss\projects\netbeans\loanProcessing\LoanRequestorBpel\build\dependentProjectFiles
dist_se:
Building jar: C:\jboss\projects\netbeans\loanProcessing\LoanRequestorBpel\build\SEDeployment.jar
Expanding: C:\jboss\projects\netbeans\loanProcessing\LoanRequestorBpel\build\SEDeployment.jar into C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\src\bindingComponentASA
Expanding: C:\jboss\projects\netbeans\loanProcessing\LoanRequestorBpel\build\SEDeployment.jar into C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\src\bindingComponentASA\META-INF\catalogData\LoanRequestorBpel
jbi-build:
Building jar: C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\build\BCDeployment.jar
copying Sub-Assembly: C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\build\LoanRequestorBpel.jar
Create BindingComponent jar: C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\build/com.sun.httpsoapbc-1.0-2.jar
Deleting: C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\build\BCDeployment.jar
Building jar: C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\dist\LoanProcessingCompositeApp.zip
run-jbi-deploy:
C:\jboss\projects\netbeans\loanProcessing\LoanProcessingCompositeApp\nbproject\build-impl.xml:214: Server instance location is null
BUILD FAILED (total time: 0 seconds)
Why Server instance location is null?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006213#4006213
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006213
19 years, 3 months
[JBoss Seam] - couldn't run seam generate-entities twice, found workaround
by codelion
Ran seam generate-entities a couple of weeks ago. Wanted to know what has changed in Seam, wanted to run seam generate-entities a second time and then diff the directories. Problem:
At seam-gen/view/list.xhtml.ftl line 30 there was an undefined property.value.typeName.
But the real reason then was that two weeks ago I had seven tables, and seam-gen generated code that then made that nine tables (generally good Hibernate magic). Seam-gen must have added some relations, is my first simplistic interpretation. (I never used that generated project per se, I scavenged from it, so I don't know all its details.)
How did I work around it? I compared the entity classes from last week, (there were seven), with the tables in the database (there were nine) and dropped those two extra tables. Then seam-gen ran fine again.
Maybe it had to do with many-to-many relationships? There are two in it. I could look closer, but for now I have deleted all bad versions.
To sum it up: Seam-gen may cause generation of additional tables (only once the app runs, of course). When trying to run seam-gen again (e.g. much later to see whether Seam has changed with a diff) then those additional tables not just are unwanted, but they also cause a failure at least in list.xhtml.ftl.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006207#4006207
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006207
19 years, 3 months