[jboss-jira] [JBoss JIRA] Commented: (JBAS-6188) fix "java.lang.IllegalArgumentException: Wrong arguments. setUseTryLock for target org.jboss.resource.metadata.mcf .LocalDataSourceDeploymentMetaData at 75687c expected=[long] actual=[null]" error on call to profileView.applyTemplate() for new datasource

Ian Springer (JIRA) jira-events at lists.jboss.org
Fri Nov 21 18:54:36 EST 2008


    [ https://jira.jboss.org/jira/browse/JBAS-6188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12439366#action_12439366 ] 

Ian Springer commented on JBAS-6188:
------------------------------------

This issue deals with non-mandatory ManagedProperty's. IMO, if such properties are set to null, then the Profile Service should either supply a default to the underlying managed object or the underlying managed object should accept null and take care of supplying its own default.

To further complicate things, tt seems there are three potential ways to specify a null value for a non-mandatory ManagedProperty:

1) Remove the ManagedProperty from the Map in the ManagedComponent, i.e.:

Map<String, ManagedProperty> managedProps = managedComponent.getProperties();
managedProps.remove("foo");

2) Set the ManagedProperty's MetaValue to null, i.e.:

Map<String, ManagedProperty> managedProps = managedComponent.getProperties();
ManagedProperty managedProp = managedProps.get("foo");
managedProp.setValue(null);

3) Set the ManagedProperty's MetaValue's value to null (for SimpleValues and EnumValues), i.e.:

Map<String, ManagedProperty> managedProps = managedComponent.getProperties();
ManagedProperty managedProp = managedProps.get("foo");
SimpleValueSupport metaValue = (SimpleValueSupport)managedProp.getValue();
metaValue.setValue(null);

I think we should have test cases for all three.

Scott, if you don't get to this by Mon or Tue, I'll try to do some tests of my own next week to determine which if any of the above options if any is a workaround for the "Caused by: java.lang.IllegalArgumentException: Wrong arguments. setXXX for target org.jboss.resource.metadata.mcf.XADataSourceDeploymentMetaData at 1f74662 expected=[int] actual=[null] " errors.
 


> fix "java.lang.IllegalArgumentException: Wrong arguments. setUseTryLock for target org.jboss.resource.metadata.mcf .LocalDataSourceDeploymentMetaData at 75687c expected=[long] actual=[null]" error on call to profileView.applyTemplate() for new datasource
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBAS-6188
>                 URL: https://jira.jboss.org/jira/browse/JBAS-6188
>             Project: JBoss Application Server
>          Issue Type: Sub-task
>      Security Level: Public(Everyone can see) 
>          Components: ProfileService
>         Environment: AS5 build from Hudson dated 200811070836
>            Reporter: Ian Springer
>            Assignee: Scott M Stark
>
> The property in question, "use-try-lock", has a value of null, which should be fine since its isMandatory() method returns false. However, it appears from the error message that the underlying property is a primitive long and so it chokes when the value is null.
> Here's the stack trace (including the WARN message that occurs a bit earlier in case it's either related or is a separate issue that can be fixed):
> 15:44:33,530 WARN  [AbstractManagedObjectPopulator] Cannot create String name from non-Simple property: ManagedProperty{
> jndi-name,jndiName,metaType=SimpleMetaType:java.lang.String}, value=null
> 15:44:33,530 ERROR [ProfileJBossServerComponent] Unable to apply Template and process through Profile View
> java.lang.reflect.UndeclaredThrowableException
>         at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.setValue(AbstractInstanceClassFactory.java:277
> )
>         at org.jboss.managed.plugins.WritethroughManagedPropertyImpl.setValue(WritethroughManagedPropertyImpl.java:109)
>         at org.jboss.resource.deployers.management.DsDataSourceTemplate.writeTemplate(DsDataSourceTemplate.java:154)
>         at org.jboss.resource.deployers.management.DsDataSourceTemplate.applyTemplate(DsDataSourceTemplate.java:70)
>         at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:673)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:623)
>         at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
>         at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
>         at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java
> :67)
>         at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
>         at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
>         at org.jboss.remoting.Client.invoke(Client.java:1708)
>         at org.jboss.remoting.Client.invoke(Client.java:612)
>         at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
>         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>         at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
>         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>         at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
>         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>         at AOPProxy$1.applyTemplate(AOPProxy$1.java)
>         at org.rhq.plugins.jbossas5.ProfileJBossServerComponent.createConfigurationBasedResource(ProfileJBossServerCompo
> nent.java:235)
>         at org.rhq.plugins.jbossas5.ProfileJBossServerComponent.createResource(ProfileJBossServerComponent.java:142)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:623)
>         at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:450)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:713)
> Caused by: java.lang.IllegalArgumentException: Wrong arguments. setUseTryLock for target org.jboss.resource.metadata.mcf
> .LocalDataSourceDeploymentMetaData at 75687c expected=[long] actual=[null]
>         at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
>         at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:69)
>         at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
>         at org.jboss.beans.info.plugins.DefaultPropertyInfo.set(DefaultPropertyInfo.java:143)
>         at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.setValue(AbstractInstanceClassFactory.java:378
> )
>         at org.jboss.managed.plugins.factory.AbstractInstanceClassFactory.setValue(AbstractInstanceClassFactory.java:273
> )
>         at org.jboss.managed.plugins.WritethroughManagedPropertyImpl.setValue(WritethroughManagedPropertyImpl.java:109)
>         at org.jboss.resource.deployers.management.DsDataSourceTemplate.writeTemplate(DsDataSourceTemplate.java:154)
>         at org.jboss.resource.deployers.management.DsDataSourceTemplate.applyTemplate(DsDataSourceTemplate.java:70)
>         at org.jboss.profileservice.management.ManagementViewImpl.applyTemplate(ManagementViewImpl.java:673)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:623)
>         at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:121)
>         at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
>         at org.jboss.profileservice.remoting.ProfileServiceInvocationHandler.invoke(ProfileServiceInvocationHandler.java
> :67)
>         at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
>         at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
>         at org.jboss.remoting.Client.invoke(Client.java:1708)
>         at org.jboss.remoting.Client.invoke(Client.java:612)
>         at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
>         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>         at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
>         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>         at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
>         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>         at AOPProxy$1.applyTemplate(AOPProxy$1.java)
>         at org.rhq.plugins.jbossas5.ProfileJBossServerComponent.createConfigurationBasedResource(ProfileJBossServerCompo
> nent.java:235)
>         at org.rhq.plugins.jbossas5.ProfileJBossServerComponent.createResource(ProfileJBossServerComponent.java:142)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:623)
>         at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:450)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:713)
>         at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
>         ... 18 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list