This content has been marked as final.
Show 4 replies
-
1. Re: Weird SimpleValueSupport instance
starksm64 Oct 10, 2007 10:40 AM (in response to alesj)You have to input a valid MetaValue. You should validate the value using the MetaValue.getType().isValue(Object obj) call, or SimpleValueSupport.setValue should be doing this.
-
2. Re: Weird SimpleValueSupport instance
alesj Oct 10, 2007 10:53 AM (in response to alesj)Cause:
2007-10-10 16:42:50,750 DEBUG [org.jboss.system.deployers.managed.ServiceMetaDataICF] Failed to get property value for bean: org.jboss.resource.connectionmanager.JBossManagedConnectionPool, property: minSize java.lang.IllegalArgumentException: Value and metatype are differ in type: SimpleMetaType:java.lang.Integer:5 at org.jboss.metatype.api.values.SimpleValueSupport.setValue(SimpleValueSupport.java:102) at org.jboss.metatype.api.values.SimpleValueSupport.<init>(SimpleValueSupport.java:75) at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.createSimpleValue(DefaultMetaValueFactory.java:129) at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.internalCreate(DefaultMetaValueFactory.java:492) at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.create(DefaultMetaValueFactory.java:442) at org.jboss.system.deployers.managed.ServiceMetaDataICF.getValue(ServiceMetaDataICF.java:121) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateValues(AbstractManagedObjectFactory.java:605) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateManagedObject(AbstractManagedObjectFactory.java:525) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:171) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.getValue(AbstractManagedObjectFactory.java:695) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateValues(AbstractManagedObjectFactory.java:605) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateManagedObject(AbstractManagedObjectFactory.java:525) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:171) at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.build(AbstractParsingDeployerWithOutput.java:290) at org.jboss.deployers.plugins.deployers.DeployerWrapper.build(DeployerWrapper.java:202) at org.jboss.deployers.plugins.deployers.DeployersImpl.getManagedObjects(DeployersImpl.java:339) at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedObjects(MainDeployerImpl.java:458) at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedDeployment(MainDeployerImpl.java:432) at org.jboss.profileservice.management.ManagementViewImpl.loadProfile(ManagementViewImpl.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) 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:56) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769) at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573) at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373) at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166) 2007-10-10 16:42:50,750 DEBUG [org.jboss.system.deployers.managed.ServiceMetaDataICF] Failed to get property value for bean: org.jboss.resource.connectionmanager.JBossManagedConnectionPool, property: maxSize java.lang.IllegalArgumentException: Value and metatype are differ in type: SimpleMetaType:java.lang.Integer:20 at org.jboss.metatype.api.values.SimpleValueSupport.setValue(SimpleValueSupport.java:102) at org.jboss.metatype.api.values.SimpleValueSupport.<init>(SimpleValueSupport.java:75) at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.createSimpleValue(DefaultMetaValueFactory.java:129) at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.internalCreate(DefaultMetaValueFactory.java:492) at org.jboss.metatype.plugins.values.DefaultMetaValueFactory.create(DefaultMetaValueFactory.java:442) at org.jboss.system.deployers.managed.ServiceMetaDataICF.getValue(ServiceMetaDataICF.java:121) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateValues(AbstractManagedObjectFactory.java:605) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateManagedObject(AbstractManagedObjectFactory.java:525) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:171) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.getValue(AbstractManagedObjectFactory.java:695) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateValues(AbstractManagedObjectFactory.java:605) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.populateManagedObject(AbstractManagedObjectFactory.java:525) at org.jboss.managed.plugins.factory.AbstractManagedObjectFactory.initManagedObject(AbstractManagedObjectFactory.java:171) at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.build(AbstractParsingDeployerWithOutput.java:290) at org.jboss.deployers.plugins.deployers.DeployerWrapper.build(DeployerWrapper.java:202) at org.jboss.deployers.plugins.deployers.DeployersImpl.getManagedObjects(DeployersImpl.java:339) at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedObjects(MainDeployerImpl.java:458) at org.jboss.deployers.plugins.main.MainDeployerImpl.getManagedDeployment(MainDeployerImpl.java:432) at org.jboss.profileservice.management.ManagementViewImpl.loadProfile(ManagementViewImpl.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) 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:56) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769) at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573) at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373) at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
Which makes sense with the following code@Override public List<ServiceAttributeMetaData> buildAttributes(ManagedConnectionFactoryDeploymentMetaData md) { List<ServiceAttributeMetaData> poolAttributes = new ArrayList<ServiceAttributeMetaData>(); ServiceAttributeMetaData poolAttribute = null; poolAttribute = buildSimpleAttribute("PoolJndiName", md.getJndiName()); poolAttributes.add(poolAttribute); poolAttribute = buildSimpleAttribute("MinSize", String.valueOf(md.getMinSize())); poolAttributes.add(poolAttribute); poolAttribute = buildSimpleAttribute("MaxSize", String.valueOf(md.getMaxSize())); poolAttributes.add(poolAttribute);
andif (metaType.isSimple()) result = createSimpleValue((SimpleMetaType<Serializable>) metaType, (Serializable) value);
At which point to fix this?
Or is this expected behaviour? -
3. Re: Weird SimpleValueSupport instance
starksm64 Oct 10, 2007 10:59 AM (in response to alesj)The ServiceMetaDataICF class has to deal with any type conversion issues due to the attribute metadata not matching the underlying mbean attribute type.
-
4. Re: Weird SimpleValueSupport instance
alesj Oct 11, 2007 6:26 AM (in response to alesj)We could add
value = typeInfo.convert(value)
right after we fully determine typeInfo to either DefaultMetaValueFactory or just to ServiceMetaDataICF.
Just tested addition to DefaultMetaValueFactory and the tests pass.
OK to commit it there?