[Persistence, JBoss/CMP, Hibernate, Database] - JBoss 3.2.8SP1/CMP/SQL TIME & DATETIME
by mailinator
I migrated an existing JBoss application to mySQL from MSSQL that has a DATETIME activityTime column in a specific table and a CMP EntityBean that uses the java.sql.Time to get and set values from that column.
Now I am getting the following exception:
javax.ejb.CreateException: Could not create entity:java.sql.SQLException: Data truncated for column 'activityTime' at row 1
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:339)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:150)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:587)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:226)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:282)
at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:587)
at sun.reflect.GeneratedMethodAccessor617.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1080)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:103)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:219)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:227)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:103)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:112)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:43)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:348)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:159)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:99)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:135)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:492)
at org.jboss.ejb.Container.invoke(Container.java:743)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:362)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:125)
at $Proxy259.create(Unknown Source)
......
After some Jboss debugging I noticed the following code in the org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.coerceToSQLType()
if(value.getClass() == java.util.Date.class)
{
Since the value in my case is a java.sql.Time and not a Date the if evaluates to false and the value returned by this method is the Time object. Now shouldnt the if use instanceof instead of the == operator since Time is a subclass of Date?
NOTE: I then realized that this code wasnt working in MSSQL. The difference there is that MSSQL was automatically coercing the value to a default Time value.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963788#3963788
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963788
19 years, 9 months
[JCA/JBoss] - State: NOTYETINSTALLED during deploying my resource adapter
by fshabestari
my resource adapter, which works wit JBoss 3.2.5, does not work with JBoss 4.0.3SP1. I get Problems deploying my resource adapter.
perhaps the problem was caused, because JBoss 4.0.3 supports JCA 1.5, but how can I change my JCA 1.0 to 1.5 ?
I get following message:
ERROR main 16:06:17,187 org.jboss.deployment.scanner.URLDeploymentScanner
Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: jboss.jca:service=LocalTxCM,name=mbstcpra
State: CONFIGURED
I Depend On:
jboss:service=TransactionManager
jboss.jca:service=RARDeployer
jboss.jca:service=LocalTxPool,name=mbstcpra
jboss.jca:service=CachedConnectionManager
ObjectName: jboss.jca:service=LocalTxPool,name=mbstcpra
State: CONFIGURED
I Depend On:
jboss.jca:service=LocalTxPF,name=mbstcpra
Depends On Me:
jboss.jca:service=LocalTxCM,name=mbstcpra
ObjectName: jboss.jca:service=LocalTxPF,name=mbstcpra
State: CONFIGURED
I Depend On:
jboss.jca:service=RARDeployment,name=MBS web TCP resource adapter
Depends On Me:
jboss.jca:service=LocalTxPool,name=mbstcpra
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.jca:service=RARDeployment,name=MBS web TCP resource adapter
State: NOTYETINSTALLED
Depends On Me:
jboss.jca:service=LocalTxPF,name=mbstcpra
my ...-service.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
eis/MBS
<depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager
jboss.jca:service=RARDeployer
<depends optional-attribute-name="ManagedConnectionPool">
<depends optional-attribute-name="ManagedConnectionFactoryName">
<depends optional-attribute-name="OldRarDeployment">
jboss.jca:service=RARDeployment,name=MBS web TCP resource adapter
0
50
5000
1
ByContainer
<depends optional-attribute-name="CachedConnectionManager">
jboss.jca:service=CachedConnectionManager
my ra.xml looks like this:
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963785#3963785
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963785
19 years, 9 months
[JBossWS] - Re: JSR181 Web Service Client
by sappenin
In your client, when you call the endpoint, can you confirm that the "System.getProperty("user.name")" call is returning a non-null value?
| String ret = port.getHello(System.getProperty("user.name"));
|
My guess is that "System.getProperty("user.name")" might be returning null on you. Try the demo/test with a hand-coded string instead.
Also, in you Endpoint's code, you might want to check for a null string passed into the function, and deal with it so that the code doesn't barf. Perhaps something like this:
| @WebMethod
| public String getHello(String name)
| {
| if(name == null || "".equals(name))
| {
| return "Invalid Name";
| }
| else
| return "Hello " + name + "!";
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963782#3963782
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963782
19 years, 9 months