[EJB 3.0] - Re: How to set default mapping to TEXT instead of VARCHAR(25
by tigrou
I have the same problem (I have to store a VARCHAR(5000) on MySQL 4 (witch as WARCHAR limited to 255)).
I'm not sure it will work but I have found that the mapping file is in :
$JBOSS_HOME\serveur\default\conf\standardjbosscmp-jdbc.xml
You have the mapping for each type of Bdd.
For my case, I have change the
<type-mapping>
| <name>mySQL</name>
| ...
| <mapping>
| <java-type>java.lang.String</java-type>
| <jdbc-type>VARCHAR</jdbc-type>
| <sql-type>VARCHAR(250) BINARY</sql-type>
| </mapping>
| </type-mapping>
by :
<type-mapping>
| <name>mySQL</name>
| ...
| <mapping>
| <java-type>java.lang.String</java-type>
| <jdbc-type>VARCHAR</jdbc-type>
| <sql-type>TEXT</sql-type>
| </mapping>
| </type-mapping>
It seams to work fine after a Jboss reboot.
Dont forget to select your database type in your xxx-ds.xml file
<metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964603#3964603
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964603
19 years, 10 months
[EJB/JBoss] - could not dereference object when running the EJB
by vitalstrike82
Hi,
I'm using jboss4.0.3. I want to reference my jsp page to EJB but get a "could not dereference object" upon running the jsp with this as it went into the catch exception instead of looking up to the EJB:
try {
|
| objref = initial.lookup("java:comp/env/ejb/MyMusicCart");
| System.out.println("lookup success for ejb/MyMusicCart");
| // a reference to the home interface is shareable
| cartHome = (MusicCartHome)PortableRemoteObject.narrow(objref, MusicCartHome.class);
| System.out.println("created MusicCartHome object");
|
| } catch (Exception ex) {
| System.out.println("Unexpected Exception: " +ex.getMessage());
My web.xml
| <ejb-ref>
| <ejb-ref-name>ejb/MyMusicCart</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| asg.MusicCartEJB.MusicCartHome
| asg.MusicCartEJB.MusicCart
| <ejb-link>ejb-jar-ic.jar#MusicCartBean</ejb-link>
|
| </ejb-ref>
|
Can anyone encounter this problem before? Please help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964601#3964601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964601
19 years, 10 months
[Beginners Corner] - Re: could not dereference object
by vitalstrike82
"vitalstrike82" wrote : Hi,
| I'm using jboss4.0.3. I want to reference my jsp page to EJB but get a "could not dereference object" upon running the jsp with this as it went into the catch exception instead of looking up to the EJB:
|
| try {
| |
| | objref = initial.lookup("java:comp/env/ejb/MyMusicCart");
| | System.out.println("lookup success for ejb/MyMusicCart");
| | // a reference to the home interface is shareable
| | cartHome = (MusicCartHome)PortableRemoteObject.narrow(objref, MusicCartHome.class);
| | System.out.println("created MusicCartHome object");
| |
| | } catch (Exception ex) {
| | System.out.println("Unexpected Exception: " +ex.getMessage());
|
| My web.xml
| [code
| <ejb-ref>
| <ejb-ref-name>ejb/MyMusicCart</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| asg.MusicCartEJB.MusicCartHome
| asg.MusicCartEJB.MusicCart
| <ejb-link>ejb-jar-ic.jar#MusicCartBean</ejb-link>
|
| </ejb-ref>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964599#3964599
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964599
19 years, 10 months