ClasscastException: Cannot Cast org.jboss.ha.framework.server.HAPartitionImpl cannot be cast to org.jboss.ha.framework.server.HAPartitionImpl
by Dharmveer Jain
Hi,
I have setup a cluster partition in Jboss and trying to retrieve HAPartition
object from ClusterPartition mbean. Below is my code:
ArrayList<MBeanServer> list = MBeanServerFactory.findMBeanServer(null);
for (MBeanServer server : list)
{
String onStr = "jboss:service=DefaultPartition";
ObjectName objectName = new ObjectName(onStr);
Set mbeans = server.queryMBeans(objectName, null);
Object partitionObj = server.invoke(theName, "getHAPartition",
null, null);
org.jboss.ha.framework.server.HAPartitionImpl partition =
(org.jboss.ha.framework.server.HAPartitionImpl) partitionObj; //this line
throwing ClassCastException
}
The last line in above code is throwing ClasscastException: Cannot Cast
org.jboss.ha.framework.server.HAPartitionImpl cannot be cast to
org.jboss.ha.framework.server.HAPartitionImpl
I have same version of jbossha.jar in jboss lib and war's web-inf/lib
folder. I am not sure why it is throwing classcast exception. Any help is
much appreciated.
Thanks in advance !!!
Regards,
Dharmveer
Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew
15 years, 2 months
AS trunk build
by Ales Justin
I tried to update AS trunk with the latest MC libs.
It builds OK (running build.bat from root),
but trying to run it I get this:
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\bin>run
Calling
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\bin\run.conf.bat
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT
JAVA: c:\Java\jdk1.6.0_11\bin\java
JAVA_OPTS: -Dprogram.name=run.bat -Xms128M -Xmx512M
-XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=tru
CLASSPATH:
c:\Java\jdk1.6.0_11\lib\tools.jar;C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\bin\run.jar
===============================================================================
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\concurrent.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-logging-spi.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-logmanager.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-logging-logmanager.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-common-core.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-bootstrap-spi.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-bootstrap-spi-as.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-bootstrap-spi-mc.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-bootstrap-impl-base.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-bootstrap-impl-as.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-bootstrap-impl-mc.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\javassist.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-reflect.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-mdr.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-dependency.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-kernel.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-metatype.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-managed.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-vfs.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-classloading-spi.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-classloader.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-classloading.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-classloading-vfs.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-aop.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\jboss-aop-mc-int.jar
WARNING: Could not find expected boot lib
C:\projects\jboss5\trunk\build\output\jboss-6.0.0-SNAPSHOT\lib\trove.jar
Failed to boot JBoss:
java.lang.IllegalArgumentException: Specified implementation class could
not be found: org.jboss.bootstrap.impl.as.server.JBossASServerImpl on
ClassLoader java.net.URLClassLoader@1632c2d
at
org.jboss.bootstrap.spi.factory.GenericFactory.createInstance(GenericFactory.java:92)
at
org.jboss.bootstrap.spi.factory.ServerFactory.createServer(ServerFactory.java:83)
at org.jboss.Main.boot(Main.java:356)
at org.jboss.Main$1.run(Main.java:707)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException:
org.jboss.bootstrap.impl.as.server.JBossASServerImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.jboss.bootstrap.spi.factory.GenericFactory.createInstance(GenericFactory.java:88)
... 4 more
The lib directory contains jars with full name; e.g.
jboss-classloading-vfs-2.0.7.CR2.
Is this part of mvn refactoring or is it just me?
15 years, 2 months
Re: [jboss-dev] [jboss-cvs] JBossAS SVN: r94875 - in projects/jboss-cl/trunk: classloader/src/main/java/org/jboss/classloader/spi/filter and 7 other directories.
by Adrian Brock
You're probably right, although I don't trust volatile.
It's my c and pre Java5 background. ;-)
The issue flagged by FindBugs was that some access to
this ivar was synchronized and some wasn't.
The gets and sets were synchronized.
The real issue was code like the following
in an unsynchronized method:
if (loadedClass != null)
doStuff();
blah();
if (loadClass == null)
doSomethingElse();
Which won't work with volatile. The two if statements could
potentially see different values (although in practice
they won't in this use case).
However, I also fixed that code to copy the ivar into a local variable
at the start of the method so it has a consistent view
throughout, which should mean volatile is ok. At least with
the lastest java memory model. ;-)
On Wed, 2009-10-14 at 11:07 -0500, David M. Lloyd wrote:
> On 10/14/2009 11:01 AM, jboss-cvs-commits(a)lists.jboss.org wrote:
> > Author: adrian(a)jboss.org
> > Date: 2009-10-14 12:01:45 -0400 (Wed, 14 Oct 2009)
> > New Revision: 94875
>
> > Modified: projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base/ClassLoadingTask.java
> > ===================================================================
> > --- projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base/ClassLoadingTask.java 2009-10-14 15:23:40 UTC (rev 94874)
> > +++ projects/jboss-cl/trunk/classloader/src/main/java/org/jboss/classloader/spi/base/ClassLoadingTask.java 2009-10-14 16:01:45 UTC (rev 94875)
> > @@ -27,6 +27,7 @@
> > import java.security.CodeSource;
> > import java.security.PrivilegedAction;
> > import java.security.ProtectionDomain;
> > +import java.util.concurrent.atomic.AtomicReference;
> [..]
> > + return loadedClass.get();
> [..]
> > + this.loadedClass.set(loadedClass);
> [..]
> > + Class<?> loadedClass = getLoadedClass();
> [..]
> > + Class<?> loadedClass = getLoadedClass();
> [..]
> > + this.loadedClass.set(theClass);
> [..]
> > + return loadedClass.get();
> [..]
> > + Class<?> loadedClass = getLoadedClass();
>
> If you only do get & set, might as well just make it volatile instead of
> using AtomicReference, and save a bit of memory.
>
> - DML
> _______________________________________________
> jboss-cvs-commits mailing list
> jboss-cvs-commits(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-cvs-commits
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss by Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
15 years, 2 months
Re: [jboss-dev] Tag for JBoss CL
by Adrian Brock
Nice timing. ;-)
I'll release it as it is now.
There's nothing major in the FindBugs report.
The only thing I've committed so far is to make ClassFilter Serializable
which obviously creates no problems.
On Wed, 2009-10-14 at 15:30 +0200, Ales Justin wrote:
> I see Adrian is fixing some (obvious) bugs - the stuff that showed on
> FindBugs radar.
>
> How soon do you need this?
>
> I guess Adrian will be done soon. Adrian?
>
> -Ales
>
> Permaine Cheung wrote:
> > Hi Ales,
> >
> > Will the GA tag be available soon?
> >
> > Cheers,
> > Permaine
> >
> > Permaine Cheung wrote:
> >> Great! Will you be tagging it as GA then? If so, please let us know
> >> when that's ready and we'll build it in brew.
> >>
> >> Cheers,
> >> Permaine
> >>
> >> Ales Justin wrote:
> >>> 2.0.7.CR2 looks like it could be made GA.
> >>>
> >>> Permaine Cheung wrote:
> >>>> Hi Ales,
> >>>>
> >>>> We're getting close to having all components in for EAP5, is there a
> >>>> tag for JBoss CL GA ready to be used for EAP5?
> >>>>
> >>>> Thanks,
> >>>> Permaine
> >>>
> >>
> >>
> >
>
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss by Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
15 years, 2 months
Re: [jboss-dev] [JBoss JIRA] Updated: (JBCL-123) Fix problems flagged by FINDBUGS
by Adrian Brock
I've just bumped it to the next release.
I'm not doing the FindBugs stuff for 2.0.7.GA since its wanted
today and we won't have to time to make sure there are
no regressions caused.
If we do a CRx release for 2.0.8 then its just a question
of renaming 2.0.8.GA to 2.0.8.CR1 in JIRA.
On Wed, 2009-10-14 at 16:29 +0200, Ales Justin wrote:
> Why 2.0.8.GA?
>
> 2.0.7.GA wasn't released yet.
> My previous releases were still CR1|2.
>
> Adrian Brock (JIRA) wrote:
> > [ https://jira.jboss.org/jira/browse/JBCL-123?page=com.atlassian.jira.plugi... ]
> >
> > Adrian Brock updated JBCL-123:
> > ------------------------------
> >
> > Fix Version/s: JBossCL.2.0.8.GA
> > (was: JBossCL.2.0.7.GA)
> >
> >
> >> Fix problems flagged by FINDBUGS
> >> --------------------------------
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss by Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
15 years, 2 months
AS6 Boot time & Deployment time container task
by Jason T. Greene
I have created a container jira task with all of the items we identified
during the past AS6 meeting:
https://jira.jboss.org/jira/browse/JBAS-7329
Since each of these tasks is rather large, feel free to link any of them
to a larger container task.
Also, please add to it if you happen to work on something else that is
related to deployment or boot time.
Thanks!
--
Jason T. Greene
JBoss, a division of Red Hat
15 years, 2 months