[O'Reilly JBoss 3.0/4.0 Workbook] - MySql datasource configuration issue:Urgent
by jitendra007
Hi All,
I am trying to create MySql1.5 datasource.
I have done following steps
1) Mysql-ds.xml
<local-tx-datasource>
<jndi-name>MysqlDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/test</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
password
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!-- Use the security domain defined in conf/login-config.xml -->
<security-domain>MySqlDbRealm</security-domain>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>mySQL</type-mapping>
jboss.jca:service=LocalTxCM,name=MysqlDS
</local-tx-datasource>
2) Login.xml
<application-policy name = "MySqlDbRealm">
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal"></module-option>
<module-option name = "userName">root</module-option>
<module-option name = "password">password</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MysqlDS</module-option>
</login-module>
</application-policy>
3): standradjbosscmp-jdbc.xml
java:/MysqlDS
4):standardjaws.xml
java:/MysqlDS
<type-mapping>mysql</type-mapping>
5) : jboss-cmp-jdbc.xml
java:/MysqlDS
<datasource-mapping>mySQL</datasource-mapping>
<create-table>true</create-table>
<remove-table>false</remove-table>
<pk-constraint>true</pk-constraint>
<preferred-relation-mapping>
foreign-key
</preferred-relation-mapping>
I am getting following error while deploying
15:35:00,502 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=customerJndi,service=EJB
org.jboss.deployment.DeploymentException: Error: can't find data source: java:/MysqlDS; - nested thr
owable: (javax.naming.NameNotFoundException: MysqlDS not bound)
at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:139)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:42
0)
Please suggest for me if you any idea.
It is very urgent.
Thanks in advace.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094461#4094461
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094461
18Â years, 9Â months
[JBoss Seam] - Creating components
by cfthomas
Hi there!
I'm new to SEAM so maybe you can give me some hints:
I want to create a generic component (not a component as in SEAM but a component as in "reusable building block")
I have a nice JavaScript Table that features all nice things you can imagine. It's written completely in Javascript and support event-handlers.
So What you need to do is write your JavaScript code to setup the table and add event-handler that then call e.g. SEAM components via remoting.
That works fine but for my likings is too much reapeated code every time you want to display some tables.
I want to create a SEAM component that encapsulates the initial creation of the table and handles all the events (sorting, paging, ..).
The only thing you need to do is just configure it what entity/datasource it should use.
E.g.:
| @Stateful
| public TableBean extends Table
| {
| int currentPage; // Remembers the current page
| String sortedColumn; // The name of column that is currently sorted or null
| String entityName; // Name of the entity to use (componentName or className)
| List<String> propertyNames; // Names of properties to display
| List<String> columnTitles; // Column Titles for the displayed columns
|
| // Returns the JavaScript neccessary to setup the table in the browser
| String create() {}
|
| // Returns a list of queried data
| List getData() {}
|
| // Sets the current page
| void pageTo(int newPage);
|
| // Sets the sortedColumn
| void sort(String column);
|
| void select(Integer id);
| }
|
The idea behind is to somehow (is this even possible in SEAM?) create multisple instances and configure them:
| <component name="customerTable">
| <type class="TableBean"/>
| <property name="entityName">acme.Customer</property>
| <property name="propertyNames">
| <list>
| <value>name</value>
| <value>email</value>
| </list>
| </property>
| <property name="columnTitles">
| <list>
| <value>Cust. Name</value>
| <value>Email-Address</value>
| </list>
| </property>
| </component>
|
in that way I want to configure say an "articleTable", "companyTable" etc. etc. without writing any new java or javascript code.
please help me with that:
* How can I configure multiple "instances" of the same component/ejb
* Can conversations help me manage the state of such a component (currentPage, sortedColumn ..)
Thank you very much!
Thomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094455#4094455
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094455
18Â years, 9Â months