+++ This bug was initially created as a clone of Bug #634306 +++ Description of problem: I get a "java.lang.IllegalStateException: Neither a native nor a Java platform was discovered - this should never happen." error when trying to access the JBoss application server 6.0 management console on my machine. This is probably because I have a custom Linux kernel. Version-Release number of selected component (if applicable): 1.4.0.CR2 My kernel info is: uname -a Linux smarlowpc.localdomain 2.6.33.5-124.intelpatch.intelpatch.fc13.x86_64 #1 SMP Thu Jun 17 01:49:34 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux The error from the AS server.log is here http://pastebin.com/N1ydwq76 --- Additional comment from ian.springer on 2010-09-16 11:32:21 EDT --- The root cause of this is that the Resource version returned by the platform discovery component is longer than the max length allowed for the version field in the Resource entity. Here's the stack trace from the Agent log: 2010-09-14 13:50:28,840 DEBUG [org.rhq.core.pc.inventory.InventoryManager] (http-127.0.0.1-8080-3) Executing platform scan... 2010-09-14 13:50:28,942 WARN [org.rhq.core.pc.inventory.InventoryManager] (http-127.0.0.1-8080-3) Platform plugin discovery failed - skipping: java.lang.Exception: Discovery component invocation failed. at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:270) [:3.0.0.B06] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [:1.6.0_20] at java.util.concurrent.FutureTask.run(FutureTask.java:138) [:1.6.0_20] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_20] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_20] at java.lang.Thread.run(Thread.java:619) [:1.6.0_20] Caused by: java.lang.IllegalArgumentException: Resource version is longer than maximum length (50) [Linux 2.6.33.5-124.intelpatch.intelpatch.fc13.x86_64] at org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails.setResourceVersion(DiscoveredResourceDetails.java:201) [:3.0.0.B06] at org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails.<init>(DiscoveredResourceDetails.java:95) [:3.0.0.B06] at org.rhq.plugins.platform.PlatformDiscoveryComponent.discoverResources(PlatformDiscoveryComponent.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_20] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_20] at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20] at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:266) [:3.0.0.B06] ... 5 more To address this, we could do: 1) make the platform plugin smart enough to abbreviate the version to <= 50 characters, and/or: 2) make the plugin container more lax if the version returned by the plugin is > 50 characters - it could log a warning and truncate the version to 50 chars. --- Additional comment from ian.springer on 2010-09-16 18:30:36 EDT --- Fixed in master (commit 08f582b) as follows: - increase max length of Resource.version in RHQ_RESOURCE table from 50 to 100 chars - make PC more forgiving if a discovery component returns a Resource details with a name, version, or description longer than the max length (the PC will log a warning and then truncate the value to the max length) --- Additional comment from ian.springer on 2010-09-16 18:37:38 EDT --- Fixed in release-3.0.0 branch (commit 8577501) but only the "make PC more forgiving" part.
Test the "make PC more forgiving" part in JON2.4.1
Ian, Can you please provide the steps to verify the bug?
Sunil, I hope Ian can provide better steps than I can. I had installed a custom linux kernel that had a long name (over 50 characters). Last week, I installed Fedora 14 and no longer have the custom kernel. If it was up to me, the steps for testing this, would involve hacking the fixed Java class to use a hacked kernel name that is over 50 characters long. That is probably easier than installing a custom kernel which would be much more hacking. :) Regards, Scott
I'm attaching a hacked platform plugin jar whose platform discovery component will return a 100+ character version, specifically: "xxxxxxxxx0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9This should get truncated." When testing this on the release-3.0.0 branch this should get truncated to 50 characters (i.e. "xxxxxxxxx0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4") by the PC and a warning logged. When testing it on the master branch, it should get truncated to 100 characters (i.e. "xxxxxxxxx0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9") by the PC and a warning logged.
Created attachment 471944 [details] a modified platform plugin to allow testing of the fix for this issue
QA Verified for JON 241. The kernel name gets truncated to 50 characters and throws an appropriate warning in the agent log: 2011-01-05 16:34:54,471 WARN [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.core.pluginapi.inventory.DiscoveredResourceDetails)- Plugin error: Resource version [xxxxxxxxx0xxxxxxxxx1xxxxxxxxx2xxxxxxxxx3xxxxxxxxx4xxxxxxxxx5xxxxxxxxx6xxxxxxxxx7xxxxxxxxx8xxxxxxxxx9This should get truncated.] specified by [ResourceType[id=0, category=Platform, name=Linux, plugin=Platforms]] discovery component is longer than the maximum length (50 - truncating it to 50 characters...
Bookkeeping - closing bug - fixed in recent release.