[JBoss Portal] - JBoss Portal 2.4 and MySQL UTF-8 problems
by wgross
The problem:
JBoss Portal installation fails to create a variety of required tables, specifically those tables required for the CMS system. This causes Portal to either fail to load, or to load, but throw an exception when the administrator tries to log in for the first time (using the admin/admin login).
The cause:
The current version of MySQL (and most/all prior versions) do not support key lengths greater than 1000 bytes. If MySQL is configured to use utf8 by default, key lengths can exceed 1000 bytes (in the worst case, one utf8 character can require up to 3 bytes). This problem is documented at http://bugs.mysql.com/bug.php?id=4541.
My environment:
JBoss Portal 2.4.1-CR2 (binary distribution)
JBoss AS Version 4.0.5.GA (installed using the JEMS installer)
MySQL 5.0.21-2.FC5.1
JDBC MySQL Connector 5.0.4 (mysql-connector-java-5.0.4-bin.jar)
Linux kernel 2.6.15-1 (Fedora Core 5)
How I fixed the problem:
To fix the problem, I had two options. I could either edit my MySQL configuration file to change MySQL's default character set, or I could define a different character set for the JBossPortal table. I chose to change the default character set for the JBossPortal table. To do this, I took the following steps:
1) Delete the old Portal database, and create a new one with a different character set:
mysql -p
| mysql> drop database jbossportal;
| mysql> create database jbossportal DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;
| mysql> GRANT ALL PRIVILEGES ON jbossportal.* TO jbossportal@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
| mysql> FLUSH PRIVILEGES;
| mysql> exit;
2) Delete old installation configuration files:
rm $JBOSS_HOME/server/default/work -R
| rm $JBOSS_HOME/server/default/tmp -R
| rm $JBOSS_HOME/server/default/data -R
| rm $JBOSS_HOME/server/default/log -R
3) Start JBoss
$JBOSS_HOME/bin/run.sh start
Assuming all configuration files are set up correctly, this should fix the problem. Note that this was all done while JBoss AS was not running. Also, a different character set could be used as needed. I chose latin1.
Unfortunately, there seems no way to allow JBoss Portal to use utf-8 without changing the JBoss Portal table structures. This is due to a limitation in MySQL. This limitation appears to be only in MySQL, and not in other products (MSSQL/PostgreSQL/etc.)
Be sure that in your configuration files you've implemented the truncation fix at http://wiki.jboss.org/wiki/Wiki.jsp?page=AvoidMySQL5DataTruncationErrors
Also, be sure to use the correct driver class in your portal-mysql-ds.xml file. For the MySQL JDBC Connector, use "com.mysql.jdbc.Driver".
Make sure you have a copy of the MySQL JDBC Connector in your $JBOSS_HOME/server/default/lib/ directory. You can get a copy of the Connector from http://www.mysql.com/products/connector/j/. More information about setting MySQL and JBoss is available at http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAMysqlDatasource
My configuration files:
1) $JBOSS_HOME/server/default/deploy/portal-mysql-ds.xml
<?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>jbossportal</user-name>
| <password>password</password>
| </local-tx-datasource>
| </datasources>
2) /etc/my.cnf
[client]
| default-character-set=utf8
|
| [mysqld]
| datadir=/mnt/raid/var/lib/mysql
| socket=/mnt/raid/var/lib/mysql/mysql.sock
| # Default to using old password format for compatibility with mysql 3.x
| # clients (those using the mysqlclient10 compatibility package).
| old_passwords=1
| default-character-set=utf8
|
| [mysql.server]
| user=mysql
| basedir=/mnt/raid/var/lib
|
| [mysqld_safe]
| log-error=/var/log/mysqld.log
| pid-file=/var/run/mysqld/mysqld.pid
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995853#3995853
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995853
19 years, 4 months
[JBoss Eclipse IDE (users)] - Re: How contribute to Freemarker plugin and add my Plugin ec
by azerr
anonymous wrote : I saw JBIDE-428, is that what you refer to ? It's not a patch it is the complete project...
I have post a comment.
anonymous wrote : What do you mean "another architecture" ? Have you even tried to use the tools and looked at the code to see how it works ?
For me architecture is the pattern of your Application (Service, DAO)
each people have their own architecture and implementation :
Architecture example :
Architecture 1 : Service call DAO which returns Bean (from hibernate)
and Service returns the Bean (after detach it to session)
Architecture 2 : Service call DAO which returns Bean (from hibernate)
Servive build DTO by using Bean and it returns the DTO.
Implementation example
DAO can be implements with JDBC or Hibernate,....
According to the architecture the Eclipse WizradPage must be different (parameters (package name, import classes ...) of the template are different).
Plesae let me a little time to study Hibernate Tool.
anonymous wrote : Maybe it is your vocabulary I just don't get; e.g. what is an "XML componeent" ? And if I need to write XML + a template what is saved here ?
XML Components is XML desciption of the Eclipse WizardPage (which parameters must be displayed). When you click to Finish Buton, the generation is launched, by merging a template (set in the XML Component)
, the XML file selected (hbm, OR OTHER XML FILE), and the parameters (fileds of the WizardPage).
XML Wizard is composed with several XML Component. You can synchronize parameters of one XML component with another XMl Component. (eg : you have XML Component for generate Struts ActionForm, and XML Component for generate XML struts-config). You can create a XML Wizard composed with the two XML COmponents and you can synchronyze className parameter of XML Component struts-config with XML Component ActionForm. When you change the parameter className of the XML Component ActionForm, it will change to for struts-config.
Akrogen is not mature, and my documentation is very poor. But I search another people which will interest with Akrogen. I have a lot of idea, but I would like discuss with another people.
Please let me time to write Akrogen documentation. After I hope that Akrogen will please you.
Regards Angelo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995848#3995848
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995848
19 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Remove item from CMR
by murtuza52
The correct way to remove an item from the OneToMany relation is as follows:
| @Entity
| public class A
| {
| private Collection<B> bees;
| @OneToMany (mappedBy="a")
| public Collection<B> getBs()
| {
| return bees;
| }
| public void setBs(Collection<B> b)
| {
| this. bees = b;
| }}
|
| @Entity
| public class B
| {
| private A a;
| @ManyToOne
| public A getA()
| {
| return a;
| }
| public void setContact(A a)
| {
| this.a = a;
| }}
|
The remove method will look like this in SLSB or SFSB
|
| public void removeAllB(){
| for(B b1: a.getBs()){
| b1.setContact(null);
| }
| manager.merge(a);
| }
|
Please note in EJB3 the merge method will mark A with null in column for a. This will not remove the record from the database. This must be done using other hibernate specific tags like DELETE_ORPHAN in OneToMany relations or through other techniques.
Murtuza
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995847#3995847
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995847
19 years, 4 months
[JBoss Messaging] - Failed
by hendra_netm
Hi all,
I just installed jboss messaging 1.2.0 beta1 and try the queue-failover example.
When it tried to copy application-server-killer.jar, I get this message
| --- Packages waiting for a deployer ---
| org.jboss.deployment.DeploymentInfo@9dae65fe { url=file:/C:/jboss/server/messaging-node0/deploy/application-server-killer.jar }
| deployer: null
| status: null
| state: INIT_WAITING_DEPLOYER
| watch: file:/C:/jboss/server/messaging-node0/deploy/application-server-
| killer.jar
| altDD: null
| lastDeployed: 1166785410910
| lastModified: 1166785410910
| mbeans:
|
What do I need to do in order to be able to deploy this jar?
Because I cannot use the jar, I tried to shutdown the server manually. So I used two messaging servers. After I receive first message, I shut down the messaging-node0 (my first messaging server).
Then I get this message in client-side :
| [java] 12:01:02,196 WARN @Thread-3 [HAAspect] Client attempted failover, but no failover attempt has been detected on the server side.
|
And in the failover node, I get this message:
| 12:00:59,152 INFO [ServerPeer] ServerPeer[1] waiting for server-side failover for failed node 0 to complete
| 12:01:02,156 INFO [ServerPeer] ServerPeer[1] already waited long enough for failover to start, giving up
|
I don't know what should I do to make the server failover works. Can Anybody point it out?
Regards,
Hendra
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995841#3995841
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995841
19 years, 4 months