[JBoss-user] key auto-increment in Jboss3.2.2 and MySql

2004-01-05 Thread aaaa aaaa
Hi,

Some time ago, there was some discusion about auto-increment for the key (mySQL database is supported). But I looked email archive, I couldn't find answer to my question.

Say I have an ejb bean with a key for auto-increment. What changes I should make to ejb-jar.xml (or other deploymentdescriptors, or something else)so that jboss will know the key is auto-increment-template?

(
 In the standardjbosscmp-jdbc.xml file, there was a line for mySQL database.:

 auto-increment-template?1 auto_increment/auto-increment-template
)


If possible, any examples?

Any help is appreciated.

Mark
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003


[JBoss-user] jboss dynamic ql problem

2003-07-07 Thread aaaa aaaa
Hi,
I have a dynamic ql issue. Does anyone has working examples for dynamic-ql and share them with jboss -users? I am stuck with the following dynamic ql errors.

Thanks

J.P.

in the ejb-jar.xml, here is the piece:
query query-method method-nameejbSelectABCD/method-name method-params method-paramjava.lang.String/method-param method-paramjava.lang.Object[]/method-param /query-method ejb-ql//query

in the jbosscmp-jdbc.xml, here is the piece:
query query-method method-nameejbSelectABCD/method-name method-params method-paramjava.lang.String/method-param method-paramjava.lang.Object[]/method-param /query-method dynamic-ql//query

In the program, I construct:
String sql_str="SELECT OBJECT(obj) FROM xyzTable obj WHERE obj.f1 = a1 AND obj.f2 = a2";
and call jbSelectABCD(sql_str, new Object[]{});

the error log messages I got are:

DEBUG [ejbSelectABCD] DYNAMIC-QL: SELECT OBJECT(obj) FROM xyzTable obj WHERE obj.f1 = a1 AND obj.f2 = a2

ERROR [STDERR] javax.ejb.FinderException: 
Error compiling ejbql: org.jboss.ejb.plugins.cmp.ParseException: Encountered "a1" at line1, column ...
Was expecting one of:"CONCAT""SUBSTRING"...

ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCDynamicQLQuery.execute(JDBCDynamicQLQuery.java:74)

org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.execute(JDBCSelectorBridge.java:64)
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

[JBoss-user] jboss dynamic ql problem

2003-07-07 Thread aaaa aaaa

Hi,

I have a dynamic ql issue. Does anyone has working examples for dynamic-ql and share them with jboss -users? I am stuck with the following dynamic ql errors.

Thanks

J.P.

in the ejb-jar.xml, here is the piece:
query query-method method-nameejbSelectABCD/method-name method-params method-paramjava.lang.String/method-param method-paramjava.lang.Object[]/method-param /query-method ejb-ql//query

in the jbosscmp-jdbc.xml, here is the piece:
query query-method method-nameejbSelectABCD/method-name method-params method-paramjava.lang.String/method-param method-paramjava.lang.Object[]/method-param /query-method dynamic-ql//query
---
In the program, I construct:
String sql_str="SELECT OBJECT(obj) FROM xyzTable obj WHERE obj.f1 = a1 AND obj.f2 = a2";
and call jbSelectABCD(sql_str, new Object[]{});
-

the error log messages I got are:

DEBUG [ejbSelectABCD] DYNAMIC-QL: SELECT OBJECT(obj) FROM xyzTable obj WHERE obj.f1 = a1 AND obj.f2 = a2

ERROR [STDERR] javax.ejb.FinderException: 
Error compiling ejbql: org.jboss.ejb.plugins.cmp.ParseException: Encountered "a1" at line1, column ...
Was expecting one of:"CONCAT""SUBSTRING"...

ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCDynamicQLQuery.execute(JDBCDynamicQLQuery.java:74)

org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.execute(JDBCSelectorBridge.java:64)
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

[JBoss-user] DefaultDS not bound

2002-08-20 Thread aaaa aaaa
Hi,
I went through the topic DefaultDB in this forum and made corresponding changes. But still it seemed that my problem was not addressed here. Wish somebody can help.
Thanks in advance.
Jerry
My env:
Database Vendor: MySql
Database: authority
Table: users| username | password || scott | scott123 || start | start123 |+--+--+
Table:userroles| username | userrole || start | Coder || scott | Echo |
user "scott" has all previledges---
mysql-service.xml:
server
mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=MySqlDS"
!--uncomment out this line if you are using the MySqlDbRealm above
attribute name="SecurityDomainJndiName"MySqlDbRealm/attribute
--
depends optional-attribute-name="ManagedConnectionFactoryName"
!--embedded mbean--
mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=MySqlDS"
attribute name="JndiName"DefaultDS/attribute
attribute name="ManagedConnectionFactoryProperties"
properties
config-property name="ConnectionURL" type="java.lang.String"jdbc:mysql://localhost:3306/authority/config-property
config-property name="DriverClass" type="java.lang.String"org.gjt.mm.mysql.Driver/config-property
!--set these only if you want only default logins, not through JAAS --
config-property name="UserName" type="java.lang.String"scott/config-property
config-property name="Password" type="java.lang.String"scott123/config-property
/properties
/attribute
!--Below here are advanced properties --
!--hack--
depends optional-attribute-name="OldRarDeployment"jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper/depends
/mbean
/depends
depends optional-attribute-name="ManagedConnectionPool"
!--embedded mbean--
mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=MySqlDS"
attribute name="MinSize"0/attribute
attribute name="MaxSize"50/attribute
attribute name="BlockingTimeoutMillis"5000/attribute
attribute name="IdleTimeoutMinutes"15/attribute
attribute name="Criteria"ByContainer/attribute
/mbean
/depends
depends optional-attribute-name="CachedConnectionManager"jboss.jca:service=CachedConnectionManager/depends
depends optional-attribute-name="JaasSecurityManagerService"jboss.security:service=JaasSecurityManager/depends
attribute name="TransactionManager"java:/TransactionManager/attribute
!--make the rar deploy! hack till better deployment--
dependsjboss.jca:service=RARDeployer/depends
/mbean
/server
---
login-config.xml
---
policy
authentication
login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required" /
module-option name = "principal"scott/module-option
module-option name = "userName"scott/module-option
module-option name = "password"scott123/module-option
module-option name = "unauthenticatedIdentity"nobody/module-option
module-option name = "managedConnectionFactoryName"jboss.jca:service=XaTxCM,name=MySqlDS/module-option
/authentication
/application-policy
/policy

standardjbosscmp-jdbc.xml:
jbosscmp-jdbc  defaults datasourcejava:/DefaultDS/datasource datasource-mappingmySQL/datasource-mapping  create-tabletrue/create-table remove-tablefalse/remove-table read-onlyfalse/read-only time-out300/time-out pk-constrainttrue/pk-constraint fk-constraintfalse/fk-constraint row-lockingfalse/row-locking preferred-relation-mappingforeign-key/preferred-relation-mapping read-ahead strategyon-load/strategy page-size1000/page-size eager-load-group*/eager-load-group /read-ahead list-cache-max1000/list-cache-max /defaults
.
/jbosscmp-jdbc
---

At last: the error:
2002-08-20 18:10:41,207 DEBUG [org.jboss.jetty.security.JBossUserRealm#jaastest-domain] JBossUserPrincipal: start2002-08-20 18:10:41,217 DEBUG [org.jboss.jetty.security.JBossUserRealm#jaastest-domain] created JBossUserRealm::JBossUserPrincipal: scott2002-08-20 18:10:41,217 DEBUG [org.jboss.jetty.security.JBossUserRealm#jaastest-domain] authenticating: Name:scott Password:2002-08-20 18:10:41,467 DEBUG [org.jboss.security.plugins.JaasSecurityManager.jaastest-domain] Login failurejavax.security.auth.login.LoginException: javax.naming.NameNotFoundException: DefaultDS not boundat org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:110)at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:142)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:324)at javax.security.auth.login.LoginContext.invoke(LoginContext.java:664)at