[JBoss Portal] - Re: Bad password for username=admin
by AndrewBoyd
Peter,
I want to thank you for taking the time to help! I compaired your ds-xml to mine and they look the same. here is mine:
| <?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>PortalDS</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>portalUser</user-name>
| <password>portalUser</password>
| </local-tx-datasource>
| </datasources>
|
anonymous wrote : The 'table not found' error is expected the first time you run the portal with a new database. Hibernate creates the table automatically.
|
I was aware that some errors happened with the initial startup but I've seen this one before. I just rebooted and here are the errors during startup:
| INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
| ERROR [LocaleUtils] Locale name null or empty, ignoring
|
| ... snip ...
|
| WARN [EhCacheProvider] Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
| INFO [StandardQueryCache] starting query cache at region: org.hibernate.cache.StandardQueryCache
| WARN [EhCacheProvider] Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
| WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
| ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_instance_per_user' doesn't exist
| INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
|
...snip...
| 17:14:22,593 ERROR [SchemaUpdate] Unsuccessful: create table JBP_INSTANCE_PER_USER (PK bigint not null auto_increment, INSTANCE_PK bigint, SER_STATE longblob, USER_ID varchar(170) not null, PORTLET_RE
| F varchar(170) not null, primary key (PK), unique (USER_ID, PORTLET_REF))
| 17:14:22,593 ERROR [SchemaUpdate] Specified key was too long; max key length is 1000 bytes
| 17:14:22,609 ERROR [SchemaUpdate] Unsuccessful: alter table JBP_INSTANCE_PER_USER add index FK9349B3D05EE4E4AE (INSTANCE_PK), add constraint FK9349B3D05EE4E4AE foreign key (INSTANCE_PK) references JBP
| _INSTANCE (PK)
| 17:14:22,609 ERROR [SchemaUpdate] Table 'jbossportal.jbp_instance_per_user' doesn't exist
| 17:14:22,609 INFO [SchemaUpdate] schema update complete
|
Do you think I should go ahead and drop the database and re-create as you show above? I don't have any data. Perhaps since I don't have the hybernate -ds.xml there anymore it will treate it as the initial startup and will create everyting for me.
Thanks again,
Andrew
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967939#3967939
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967939
19 years, 8 months
[JBossWS] - Initialize WS in deployment descriptor?
by gmn314
Hi,
When creating JBoss Webservices, you package a java class as though it were a Servlet. In the web.xml, you specify element in web.xml with <servlet-name>, <servlet-class>, <load-on-startup> etc. You also create a <servlet-mapping> element. However, the Java class invoked is not actually a Servlet!
My question is, is there any way that I can initialize my Java Webservice in the web.xml? I can't specify init parameters, as I would a servlet, because the class is not a servlet. Is the only way to use a regular properties file, and read the file from you Java class that implements your webservice?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967938#3967938
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967938
19 years, 8 months
[JBoss Messaging] - Re: Problems at Startup with MySQL 5 and XAConnection
by timfox
As already mentioned, it's completely pointless using an XADatasource for the messaging database connection, since internally we suspend any current tx and create a new tx for the duration of the database operation.
That tx is not available to have any other resource enlisted in it.
So, you should always use an local-tx datasource.
If you want to send (or acknowledge) message(s) in the same global tx as something else (e.g. updating a database) then you can either:
1) Use the XAResource directly (this is a bit fiddly and I suggest you read the JTA spec first to ensure you know what you are doing)
something like this off the top of my head:
|
| transactionManager.begin();
|
| Transaction tx = transactionManager.getTransaction();
|
| XAConnectionFactory cf = (XAConnectionFactory)ic.lookup("/XAConnectionFactory");
|
| XAConnection connection = cf.createConnection();
|
| XASession sess = connection.createXASession();
|
| XAResource res = sess.getXAResource();
|
| tx.enlistResource(res);
|
| MessageProducer producer = sess.createProducer(queue);
|
| producer.send(sess.createMessage());
|
| XAResource res2 = getXAResourceForYourdatabase();
|
| tx.enlistResource(res2);
|
| //do something with your database
|
| tx.commit();
|
|
You can find xa examples in the Jboss messaging test suite
org.jboss.test.messaging.jms.XATest
Alternatively, if you are executing in a managed (read, JCA enabled) environment then you can use a UserTransaction, this is a whole lot easier.
Managed environments typically include servlets, and inside ejbs.
To do this, just start a user transaction, send your message and do your database update, commit and that should all happen in the same global tx.
You just need to make sure you are using the jms JCA resource adapter - this is the one normally available at java:/jmsXA, and are using a JCA managed data source for your database access.
See the JCA wiki pages for more information.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967936#3967936
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967936
19 years, 8 months