[JBoss Seam] - Prod/Dev Datasource Problem
by gzoller
Hello,
I used seam-gen to create a project for Eclipse. No problem getting it to generate entities for my existing tables--even the generated web app pulled back data.
I wanted to try the prod/dev datasource distinction, so for my project (Spurs) I have Spurs-prod-ds.xml and Spurs-dev-ds.xml. The only differences are the jndi name, database url and login credentials:
Spurs-prod-ds.xml
| <datasources>
| <local-tx-datasource>
| <jndi-name>SpursDatasource</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/spurs</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>greg</user-name>
| <password>greg</password>
| </local-tx-datasource>
| </datasources>
|
Spurs-dev-ds.xml
| <datasources>
| <local-tx-datasource>
| <jndi-name>SpursDatasourceDev</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/spursdev</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>gregdev</user-name>
| <password>gregdev</password>
| </local-tx-datasource>
|
Both spurs and spursdev have identical schemas and both of these database logins work fine going into MySQL manually. Inside my Spurs.ear I have a Spurs.jar with META-INF/persistence.xml:
| <persistence 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"
| version="1.0">
| <persistence-unit name="Spurs">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/SpursDatasourceDev</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="validate"/>
| <property name="hibernate.cache.use_query_cache" value="true"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/SpursEntityManagerFactory"/>
| </properties>
| </persistence-unit>
| </persistence>
|
Here's what happens: Seam appears to correctly find Spurs-dev-ds.xml from the jndi name when pesistence.xml is configured as above, but won't find my database tables and crashes my app. If I manually edit Spurs-dev-ds.xml and only change the tablename in the url (spursdev to spurs) and the name/pwd (gregdev to greg) to their prod counterparts everything works fine.
Here's a clue: When aimed at prod (spurs) one line in the JBoss startup log looks like this:
| 11:45:37,976 INFO [TableMetadata] table found: spurs.bucket
|
The same line when pointed at spursdev looks like this:
| 11:45:37,976 INFO [TableMetadata] table not found: bucket
|
Notice that the prefix "spurs." is missing. Why didn't it look for "spursdev.bucket"?
Greg
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012602#4012602
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012602
19Â years, 2Â months
[JBoss Seam] - Re: Seam and granularity
by vladimir.kovalyuk
A little bit more ...
http://jcp.org/en/jsr/detail?id=299
anonymous wrote :
| ...JBoss has submitted JSR 299 - Web Beans to the JCP for review. "The goal of this work is to enable EJB 3.0 components to be used as JSF managed beans, unifying the two component models and enabling a considerable simplification to the programming model for web-based applications in Java. In particular, this work will provide a programming model suitable for rapid development of simple data-driven applications without sacrificing the full power of the Java EE 5 platform. This is a domain where Java EE has been perceived as overly complex." ...
|
So, I believe it's the right place for the question. Seam implements JSR 299 that inspires developers to create more enterprise beans. (is it correct?)
What to do if simple application based on Seam eventually ceases to be simple? Does it become out of the Seam scope?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012596#4012596
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012596
19Â years, 2Â months
[JBoss Seam] - Re: Seam and granularity
by viniciuscarvalho
"hstang" wrote : (...) Now it would help make discussions more interesting if you can tell me why you think "having many SLSBs would be a burden for the AS?"
Ok, sorry for the vague question :P
Ok, regarding performance. Its just a guess, but a SLSB with all the interceptors it has (tx,security etc...) is a bit heavy in terms of processing time and memory usage than a simple managed bean.
Regarding architecture, its just a question about the granularity of our apps, we use the approach I was talking before, may not be the best, may not be right, and of course I'm willing to change, it was just a question about how could this shift in terms of granularity would impact on our apps.
Not trying to create any problems, just seeking some orientation.
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012587#4012587
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012587
19Â years, 2Â months
[JBoss Seam] - Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
by bsmithjj
Thanks for making the fix - I'll try it out when the next CVS bundle appears on the nightly builds server.
I disagree with your suggestion about how I should log a message. As far as I'm concerned, when I ask a logger to log a message, whether it's a single string, concatenation of strings, an invokation of an object's toString() method, etc., that's exactly what I mean - print the resultant strings to the logging device. When I construct logging messages, I do not at all regard my message the same way I would a localized message with parameters.
Anyway, thanks again,
Brad Smith
PS: after I post this, I am going to try reverting to commons-logging - the old fashioned way. It just never occured to me that at org.jboss.seam.log.LogImpl.interpolate(...) would be the culprit. My guess is good old fashioned logging will work fine.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012582#4012582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012582
19Â years, 2Â months
[JNDI/Naming/Network] - Why JBoss always look for DefaultPartition for bound even I
by beaversx
I set up a JBoss4.0.5 (ejb3-clustered installation) cluster with 3 nodes, and I use the following:
"run -Djboss.partition.name=newPartition -c a11"
I received the following log info:
11:36:26,544 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:ear=CMgmt.ear,jar=CMgmt.jar,name=CManagerImpl,service=EJB3
State: FAILED
Reason: javax.naming.NameNotFoundException: DefaultPartition not bound
I Depend On:
persistence.units:ear=CMgmt.ear,jar=CMgmt.jar,unitName=CMgmt
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.j2ee:ear=CMgmt.ear,jar=CMgmt.jar,name=CManagerImpl,service=EJB3
State: FAILED
Reason: javax.naming.NameNotFoundException: DefaultPartition not bound
I Depend On:
persistence.units:ear=CMgmt.ear,jar=CMgmt.jar,unitName=CMgmt
When I use "run -c all" all problem gone. How can I setup the partition name correctly?
Thanks a lot.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012580#4012580
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012580
19Â years, 2Â months
[JBoss Seam] - Re: view vs action attribute (Explanation needed)
by SmokingAPipe
Action can be a call to a method in a session bean. If that method returns a string, that string is used as the view identifier. If that method has no return (void) or it returns null, then the view specified by view="" is used as the view. If the action returns null AND there is no view="", then the same page is just redisplayed.
So, it is a bit confusing, but here's how I use it:
Most of my session beans are SFSBs, conversation scoped. They have a @Begin(join=true) method. I make this @Begin method return void, and when I want to navigate to one of them, I use that @Begin method as the action and then specify view="/foo". That way I make sure there is an active conversation when the /foo page is first rendered, so I don't get LazyInitializationErrors. I'm not enough of a Seam pro to know if this is the absolutely right way to do this but it certainly does work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012577#4012577
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012577
19Â years, 2Â months