Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » ClassCastException or ClassNotFoundException
ClassCastException or ClassNotFoundException [message #103209] Thu, 05 July 2007 21:52 Go to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
I am trying to profile an application in Eclipse (Europa) and I keep
getting some exception like:

java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory

or a ClassCastException telling me that FileLoggerFactory doesn't
implement org.apache.commons.logging.LogFactory

depending on where i am in my experiments to get it working. (btw these
exceptions are being thrown while it attempts to configure the logger
for Hibernate).

I have installed 4.4 with all prereqs to 3.3. The application launches
and runs correctly outside of TPTP.

Is there any specific plugins that i should make available in the launch
configuration or the running plugin?

How can I debug such a situation? Using launch profile doesn't support
debugging?

Any and all help would be very welcome.

Thanks
Alain
Re: ClassCastException or ClassNotFoundException [message #103351 is a reply to message #103209] Fri, 06 July 2007 14:49 Go to previous messageGo to next message
Eugene Chan is currently offline Eugene ChanFriend
Messages: 287
Registered: July 2009
Senior Member
Hi Alain,

Could you check the workspace\.metadata\.log file and capture any
exception there in the file and post it here (or sent to me).

I assume you profile using the 'External Java Application' launch
configuration as you mentioned the application is running fine outside of
workbench.

It could also be the problem of a corrupted workbench. eg. plugins or
files within a plugin are missing.

Eugene
Re: ClassCastException or ClassNotFoundException [message #103405 is a reply to message #103351] Fri, 06 July 2007 21:41 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
Hi Eugene,

I have tried to run some more tests as I realized that some of the
issues seemed similar to the thread of a few days ago by Tom Funk.

Anyway, first I must report that I always get an exception the first
time I try to launch the profiling launch with the following:

org.eclipse.core.runtime.CoreException
Agent Controller is unavailable under port 10002. Make sure that the
service is started and the port number is correct under preferences.

org.eclipse.tptp.platform.execution.exceptions.AgentControll erUnavailableException
at
org.eclipse.tptp.platform.jvmti.client.internal.launcher.uti l.AgentControllerDelegate.getConnection(AgentControllerDeleg ate.java:226)
at
org.eclipse.tptp.platform.jvmti.client.internal.launcher.uti l.AgentControllerDelegate.getConnection(AgentControllerDeleg ate.java:71)
at
org.eclipse.tptp.platform.jvmti.client.internal.launcher.TID elegateHelper.connectToAgentController(TIDelegateHelper.java :388)
at
org.eclipse.tptp.platform.jvmti.client.internal.launcher.TID elegateHelper.launch(TIDelegateHelper.java:308)
at
org.eclipse.tptp.platform.jvmti.client.internal.launcher.TIR untimeWorkbenchDelegate.launch(TIRuntimeWorkbenchDelegate.ja va:32)
at
org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUti lity.delegateInit(LauncherUtility.java:1153)
at
org.eclipse.tptp.trace.ui.provisional.launcher.PrimaryLaunch Delegate.run(PrimaryLaunchDelegate.java:196)
at java.lang.Thread.run(Thread.java:595)



Then the next time it runs without this error.

After reading your reply, I just to clarify that I have no problems
running my code through the run/debug launch configuration. I have not
tried outside of Eclipse.

Now when I run the profiling launch, here is what I get in the log:
!SESSION 2007-07-06 17:28:25.159
-----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -application
com.castortech.iris.IrisApplicationLauncher -pdelaunch
com.castortech.CobolInterpreter.test.CFGTester
C:\eclipse\workspace\UniSelect\sources\ANA500.cbl
Command-line arguments: -application
com.castortech.iris.IrisApplicationLauncher -data C:\eclipse\workspace
-dev
file:C:/eclipse/workspace/.metadata/.plugins/org.eclipse.pde .core/IRIS
Cobol CFG Tester/dev.properties -pdelaunch -os win32 -ws win32 -arch x86
com.castortech.CobolInterpreter.test.CFGTester
C:\eclipse\workspace\UniSelect\sources\ANA500.cbl

!ENTRY org.eclipse.update.configurator 2007-07-06 17:28:29.940
!MESSAGE Could not install bundle
.../../eclipse/products/GMF-sdk-2.0/eclipse/plugins/net.sour ceforge.lpg.lpgjavaruntime_1.1.0.v200706111738.jar
Bundle "net.sourceforge.lpg.lpgjavaruntime" version
"1.1.0.v200706111738" has already been installed from:
update@.. /../eclipse/products/mdt-ocl-SDK-1.1/eclipse/plugins/net.sou rceforge.lpg.lpgjavaruntime_1.1.0.v200706111738.jar

!ENTRY org.eclipse.update.configurator 2007-07-06 17:28:29.971
!MESSAGE Could not install bundle
.../../eclipse/products/wtp-R-2.0-200706260303/eclipse/plugi ns/javax.servlet_2.4.0.v200706111738.jar
Bundle "javax.servlet" version "2.4.0.v200706111738" has already been
installed from: update@plugins/javax.servlet_2.4.0.v200706111738.jar

!ENTRY org.eclipse.update.configurator 2007-07-06 17:28:29.971
!MESSAGE Could not install bundle
.../../eclipse/products/wtp-R-2.0-200706260303/eclipse/plugi ns/org.apache.commons.logging_1.0.4.v200706111724.jar
Bundle "org.apache.commons.logging" version "1.0.4.v200706111724" has
already been installed from:
update@plugins/org.apache.commons.logging_1.0.4.v200706111724.jar

!ENTRY org.eclipse.update.configurator 2007-07-06 17:28:29.987
!MESSAGE Could not install bundle
.../../eclipse/products/wtp-R-2.0-200706260303/eclipse/plugi ns/org.apache.log4j_1.2.13.v200706111418.jar
Bundle "org.apache.log4j" version "1.2.13.v200706111418" has already
been installed from:
update@.. /../eclipse/products/tptp-runtime-TPTP-4.4.0/eclipse/plugins /org.apache.log4j_1.2.13.v200706111418.jar

!ENTRY org.eclipse.update.configurator 2007-07-06 17:28:30.002
!MESSAGE Could not install bundle
.../../eclipse/products/tptp-runtime-TPTP-4.4.0/eclipse/plug ins/org.apache.commons.logging_1.0.4.v200706111724.jar
Bundle "org.apache.commons.logging" version "1.0.4.v200706111724" has
already been installed from:
update@plugins/org.apache.commons.logging_1.0.4.v200706111724.jar

!ENTRY org.eclipse.core.resources 2 10035 2007-07-06 17:28:34.971
!MESSAGE The workspace exited with unsaved changes in the previous
session; refreshing workspace to recover changes.

!ENTRY org.eclipse.equinox.app 4 0 2007-07-06 17:28:56.096
!MESSAGE Error in invoking method.
!STACK 0
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.castortech.util.LaunchIrisApplication.run(LaunchIrisAppl ication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:533)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:155)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
at org.eclipse.core.launcher.Main.main(Main.java:30)
Caused by: java.lang.ExceptionInInitializerError
at
com.castortech.iris.database.common.HibernateSessionWrapper. <init>(HibernateSessionWrapper.java:58)
at
com.castortech.iris.database.common.BaseModelObjectsManager. getHibernateSessionWrapper(BaseModelObjectsManager.java:131)
at
com.castortech.iris.database.common.BaseModelObjectsManager. reInit(BaseModelObjectsManager.java:162)
at
com.castortech.iris.database.common.BaseModelObjectsManager. <init>(BaseModelObjectsManager.java:27)
at
com.castortech.iris.database.knowledgebase.KnowledgeBaseObje ctsManager. <init>(KnowledgeBaseObjectsManager.java:37)
at
com.castortech.iris.core.IrisPlugin.getKnowledgeBaseObjectsM anager(IrisPlugin.java:196)
at
com.castortech.iris.core.extensionpoints.AssetProviderDescri ptor.getAssetTypes(AssetProviderDescriptor.java:70)
at
com.castortech.iris.core.extensionpoints.AssetProviderDescri ptor. <init>(AssetProviderDescriptor.java:45)
at
com.castortech.iris.interpretation.InterpreterDescriptor.<init >(InterpreterDescriptor.java:24)
at
com.castortech.iris.interpretation.InterpretersManager.<init >(InterpretersManager.java:88)
at
com.castortech.iris.core.IrisPlugin.getInterpretersManager(I risPlugin.java:137)
at com.castortech.CobolInterpreter.test.CFGTester.run(CFGTester .java:30)
at com.castortech.CobolInterpreter.test.CFGTester.main(CFGTeste r.java:23)
... 24 more
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory (Caused by
java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java: 579)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory. java:517)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory. java:308)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java :351)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:120)
... 37 more
Caused by: java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory
at java.lang.ClassLoader.findClass(ClassLoader.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:429)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java: 568)
... 42 more
Root exception:
java.lang.ExceptionInInitializerError
at
com.castortech.iris.database.common.HibernateSessionWrapper. <init>(HibernateSessionWrapper.java:58)
at
com.castortech.iris.database.common.BaseModelObjectsManager. getHibernateSessionWrapper(BaseModelObjectsManager.java:131)
at
com.castortech.iris.database.common.BaseModelObjectsManager. reInit(BaseModelObjectsManager.java:162)
at
com.castortech.iris.database.common.BaseModelObjectsManager. <init>(BaseModelObjectsManager.java:27)
at
com.castortech.iris.database.knowledgebase.KnowledgeBaseObje ctsManager. <init>(KnowledgeBaseObjectsManager.java:37)
at
com.castortech.iris.core.IrisPlugin.getKnowledgeBaseObjectsM anager(IrisPlugin.java:196)
at
com.castortech.iris.core.extensionpoints.AssetProviderDescri ptor.getAssetTypes(AssetProviderDescriptor.java:70)
at
com.castortech.iris.core.extensionpoints.AssetProviderDescri ptor. <init>(AssetProviderDescriptor.java:45)
at
com.castortech.iris.interpretation.InterpreterDescriptor.<init >(InterpreterDescriptor.java:24)
at
com.castortech.iris.interpretation.InterpretersManager.<init >(InterpretersManager.java:88)
at
com.castortech.iris.core.IrisPlugin.getInterpretersManager(I risPlugin.java:137)
at com.castortech.CobolInterpreter.test.CFGTester.run(CFGTester .java:30)
at com.castortech.CobolInterpreter.test.CFGTester.main(CFGTeste r.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.castortech.util.LaunchIrisApplication.run(LaunchIrisAppl ication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:533)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:155)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
at org.eclipse.core.launcher.Main.main(Main.java:30)
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory (Caused by
java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java: 579)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory. java:517)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory. java:308)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java :351)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:120)
... 37 more
Caused by: java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory
at java.lang.ClassLoader.findClass(ClassLoader.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:429)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java: 568)
... 42 more


Note that the profiling (Execution time analysis in my case) is actually
working up until the exception is being thrown and that I can view and
process those partial results.

Also just also note that this is happening even if I select the
org.eclipse.hyades.logging.core plugin as part of the launch
configuration plugins.

Thanks for your help
Alain



Eugene Chan wrote:
> Hi Alain,
>
> Could you check the workspace\.metadata\.log file and capture any
> exception there in the file and post it here (or sent to me).
>
> I assume you profile using the 'External Java Application' launch
> configuration as you mentioned the application is running fine outside
> of workbench.
> It could also be the problem of a corrupted workbench. eg. plugins or
> files within a plugin are missing.
> Eugene
>
Re: ClassCastException or ClassNotFoundException [message #103463 is a reply to message #103351] Sat, 07 July 2007 18:39 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
Eugene,

I ran many more tests to try to pinpoint the origin of the issue.

I started with a new install to see if our install method that relies on
the link/products directories could have anything to do with the issue.

Well, I am not getting the same behavior at all, except that it looks worse.

I have been getting this error whenever I 1st try to start a profiling
session:
Error occurred during initialization of VM
Could not find agent library on the library path or in the local
directory: JPIBootLoader

And now I just got another type of error:
The JVMTI agent org.eclipse.tptp.jvmti is not available. Make sure that
the librairies for the agent are available and that it is configured
properly.

I then tried to make some path changes and cleanup. This changed the
error messages, but it still kept failing.

I also tried running the sampleclient application, and that ran without
a glitch.

After all of this, I then downloaded the "all TPTP SDK" package and
overlaid it on my new install. After a clean restart, I have now stopped
getting any of the new errors and I am actually getting the exact same
errors as with my original install (ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory).

A couple more notes:
1) It seems that unless I do a connection test prior to launching the
profile launch, I get an error connecting to the agent.

2) Every time I start profile a launch configuration, it insist of doing
a "build before launch", even if I have just been running the same exact
launch config under debug seconds before. Furthermore, it is trying to
build other non-related workspace projects. Is that expected behavior?

Thanks for your help (I really need it here).

Alain
Re: ClassCastException or ClassNotFoundException [message #103492 is a reply to message #103463] Sun, 08 July 2007 06:55 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Alain,

Can you check whether this exception also appears when you run the Heap
or Thread profilers? I would like to know whether this issue is specific
to the "execution time analysis" data collector.

Thanks,
Asaf

--
Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Re: ClassCastException or ClassNotFoundException [message #103527 is a reply to message #103492] Sun, 08 July 2007 15:05 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
Asaf,

I tried profiling with both the Memory and Thread Analysis and I am
getting the same result.

Anything else I could try or that you want me to collect in order to
pinpoint the error?

Thanks
Alain
Re: ClassCastException or ClassNotFoundException [message #103540 is a reply to message #103492] Sun, 08 July 2007 22:09 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
Asaf and Eugene,

The last recommendation from this forum that I had not undertaken was to
create a brand new workspace and import my projects in there.

Well I can now say that I did it and I am still getting the same error.

Now I have almost restored my environment of all changes and I am now
back with the ClassCasttException instead.

Caused by: org.apache.commons.logging.LogConfigurationException: The
chosen LogFactory implementation does not extend LogFactory. Please
check your configuration. (Caused by java.lang.ClassCastException:
org.eclipse.hyades.logging.commons.FileLoggerFactory cannot be cast to
org.apache.commons.logging.LogFactory)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java: 574)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory. java:517)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory. java:308)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java :351)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:120)


The difference happens to be with the fact that I am referencing a
specific instance of log4j in a "dummy" project called SharedJars that
exposes a bunch of jars and host the log4j.properties file. Otherwise in
normal run/debug of my plugin i get:
log4j:WARN No appenders could be found for logger
(org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.


Now if I switch in my plugin to just import a dependency to
org.apache.log4j, I get the above error but now when running the
profiling i get the following:

log4j:ERROR A "org.eclipse.hyades.logging.log4j.XmlLayout" object is not
assignable to a "org.apache.log4j.Layout" variable.
log4j:ERROR The class "org.apache.log4j.Layout" was loaded by
log4j:ERROR
[org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@9f2588]
whereas object of type
log4j:ERROR "org.eclipse.hyades.logging.log4j.XmlLayout" was loaded by
[org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@8aaff4].
log4j:ERROR No layout set for the appender named [fileOutput].

Not remembering exactly how, I also once got the following error reported:
log4j:ERROR Could not instantiate class
[org.eclipse.hyades.logging.log4j.XmlLayout].
java.lang.ClassNotFoundException: org.eclipse.hyades.logging.log4j.XmlLayout
at java.lang.ClassLoader.findClass(ClassLoader.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:429)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.log4j.helpers.Loader.loadClass(Loader.java:178)
at
org.apache.log4j.helpers.OptionConverter.instantiateByClassN ame(OptionConverter.java:317)
at
org.apache.log4j.helpers.OptionConverter.instantiateByKey(Op tionConverter.java:120)
at
org.apache.log4j.PropertyConfigurator.parseAppender(Property Configurator.java:641)
at
org.apache.log4j.PropertyConfigurator.parseCategory(Property Configurator.java:612)
at
org.apache.log4j.PropertyConfigurator.configureRootCategory( PropertyConfigurator.java:509)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyCo nfigurator.java:415)
at
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyCo nfigurator.java:441)
at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure( OptionConverter.java:468)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
at org.apache.log4j.Logger.getLogger(Logger.java:117)
at
com.castortech.util.LaunchIrisApplication.run(LaunchIrisAppl ication.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:533)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:155)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
at org.eclipse.core.launcher.Main.main(Main.java:30)
log4j:ERROR No layout set for the appender named [fileOutput].


But, all of that being said, I can't find anyway for my plugin to now
recognize the log4j.properties file. I have almost copied it all over
the place.

Here is what I get from log4j debug:
log4j: Trying to find [log4j.xml] using context classloader
org.eclipse.core.runtime.internal.adaptor.ContextFinder@17e7691.
log4j: Trying to find [log4j.xml] using
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@52744 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader
org.eclipse.core.runtime.internal.adaptor.ContextFinder@17e7691.
log4j: Trying to find [log4j.properties] using
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@52744 class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [null].


So, I think we are getting closer here, I believe that the
ClassCastException is due to 2 version of the log4j classes being loaded
and not being cast compatible probably, but now I am chasing another
issue here.

I am starting to run out of ideas. Any thoughts?

Thanks
Alain
Re: ClassCastException or ClassNotFoundException [message #103554 is a reply to message #103492] Mon, 09 July 2007 03:59 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
After reviewing what appears to be the possible settings for using log4j
in plugin development (and running under the run/debug mode), that what
we had through a registered/buddy jar, is really the way to go
(difference is that ours project jarred not only log4j but other common
jars) in order to get the eclipse run/debug launcher to find the
log4j.properties.

When I looked at the 3 attempts that log4j makes to find the
log4j.properties file, it uses the context loader that seems to point to
the log4j jar file itself. Then it uses the default class loader which
seems to point to the jre location and the ClassLoader.getSystemResource
also delegates to the main class loader at the vm location.

What then is the solution to using TPTP for analysis/profiling of plugin
code in those circumstances?

Thanks
Alain
Re: ClassCastException or ClassNotFoundException [message #105677 is a reply to message #103554] Thu, 19 July 2007 06:32 Go to previous messageGo to next message
Asaf Yaffe is currently offline Asaf YaffeFriend
Messages: 333
Registered: July 2009
Senior Member
Alain Picard wrote:
> After reviewing what appears to be the possible settings for using log4j
> in plugin development (and running under the run/debug mode), that what
> we had through a registered/buddy jar, is really the way to go
> (difference is that ours project jarred not only log4j but other common
> jars) in order to get the eclipse run/debug launcher to find the
> log4j.properties.
>
> When I looked at the 3 attempts that log4j makes to find the
> log4j.properties file, it uses the context loader that seems to point to
> the log4j jar file itself. Then it uses the default class loader which
> seems to point to the jre location and the ClassLoader.getSystemResource
> also delegates to the main class loader at the vm location.
>
> What then is the solution to using TPTP for analysis/profiling of plugin
> code in those circumstances?
>
> Thanks
> Alain

Alain,

I think that the best way to push this forward is to create a Bugzilla
entry for this (see http://bugs.eclipse.org/bugs). It would be very
helpful if you can also include a small project which reproduces this
problem.

Thanks,
Asaf

--

Asaf Yaffe
Eclipse TPTP Committer, JVMTI Profiler
Re: ClassCastException or ClassNotFoundException [message #106555 is a reply to message #105677] Wed, 25 July 2007 21:54 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
Asaf,

I will do that.

Thanks
Alain
Re: ClassCastException or ClassNotFoundException [message #109085 is a reply to message #106555] Wed, 15 August 2007 11:22 Go to previous messageGo to next message
Svenja Wendler is currently offline Svenja WendlerFriend
Messages: 10
Registered: July 2009
Junior Member
Hi,

I have a similar problem to you, but I did not find the bug for that so I
cannot aprove if its solved already. This is my log:

!SUBENTRY 1 org.eclipse.equinox.registry 4 1 2007-08-14 17:58:03.884
!MESSAGE Plug-in "com.builder" was unable to instantiate class
"com.builder.Builder".
!STACK 0
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:170)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:788)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at
org.eclipse.core.internal.events.BuildManager.instantiateBui lder(BuildManager.java:779)
at
org.eclipse.core.internal.events.BuildManager.initializeBuil der(BuildManager.java:732)
at
org.eclipse.core.internal.events.BuildManager.getBuilder(Bui ldManager.java:473)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:195)
at
org.eclipse.core.internal.events.BuildManager$1.run(BuildMan ager.java:246)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:249)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:214)
at
org.eclipse.core.internal.events.BuildManager.build(BuildMan ager.java:353)
at
org.eclipse.core.internal.resources.Project.internalBuild(Pr oject.java:494)
at org.eclipse.core.internal.resources.Project.build(Project.ja va:75)
at
org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(Clea nDialog.java:242)
at
org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.runInWorks pace(CleanDialog.java:127)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory (Caused by
java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory)
at
org.apache.commons.logging.LogFactory.createFactory(LogFacto ry.java:1205)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java: 994)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory. java:991)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory. java:572)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java :645)
at
com.bosch.blueworx.builder.BlueWorXBuilder.<clinit>(BlueWorXBuilder.java:207)
... 25 more
Caused by: java.lang.ClassNotFoundException:
org.eclipse.hyades.logging.commons.FileLoggerFactory
at java.lang.ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:429)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.apache.commons.logging.LogFactory.createFactory(LogFacto ry.java:1190)
... 31 more

What is the problem?

I hope you could help me

Svenja
Re: ClassCastException or ClassNotFoundException [message #120901 is a reply to message #109085] Wed, 16 January 2008 05:16 Go to previous message
Michael Lossos is currently offline Michael LossosFriend
Messages: 2
Registered: July 2009
Junior Member
This problem still exists in TPTP 4.4.1. I've filed the bug 215438 here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=215438




Svenja Wendler wrote on 8/15/2007 7:22 PM:
> Hi,
>
> I have a similar problem to you, but I did not find the bug for that so
> I cannot aprove if its solved already. This is my log:
>
> !SUBENTRY 1 org.eclipse.equinox.registry 4 1 2007-08-14 17:58:03.884
> !MESSAGE Plug-in "com.builder" was unable to instantiate class
> "com.builder.Builder".
> !STACK 0
> java.lang.ExceptionInInitializerError
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n
> Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at java.lang.Class.newInstance0(Unknown Source)
> at java.lang.Class.newInstance(Unknown Source)
> at
> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:170)
>
> at
> org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:788)
>
> at
> org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
>
> at
> org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
>
> at
> org.eclipse.core.internal.events.BuildManager.instantiateBui lder(BuildManager.java:779)
>
> at
> org.eclipse.core.internal.events.BuildManager.initializeBuil der(BuildManager.java:732)
>
> at
> org.eclipse.core.internal.events.BuildManager.getBuilder(Bui ldManager.java:473)
>
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:195)
>
> at
> org.eclipse.core.internal.events.BuildManager$1.run(BuildMan ager.java:246)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:249)
>
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(Bui ldManager.java:214)
>
> at
> org.eclipse.core.internal.events.BuildManager.build(BuildMan ager.java:353)
> at
> org.eclipse.core.internal.resources.Project.internalBuild(Pr oject.java:494)
> at org.eclipse.core.internal.resources.Project.build(Project.ja va:75)
> at
> org.eclipse.ui.internal.ide.dialogs.CleanDialog.doClean(Clea nDialog.java:242)
>
> at
> org.eclipse.ui.internal.ide.dialogs.CleanDialog$1.runInWorks pace(CleanDialog.java:127)
>
> at
> org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:38)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> Caused by: org.apache.commons.logging.LogConfigurationException:
> java.lang.ClassNotFoundException:
> org.eclipse.hyades.logging.commons.FileLoggerFactory (Caused by
> java.lang.ClassNotFoundException:
> org.eclipse.hyades.logging.commons.FileLoggerFactory)
> at
> org.apache.commons.logging.LogFactory.createFactory(LogFacto ry.java:1205)
> at org.apache.commons.logging.LogFactory$2.run(LogFactory.java: 994)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.commons.logging.LogFactory.newFactory(LogFactory. java:991)
> at
> org.apache.commons.logging.LogFactory.getFactory(LogFactory. java:572)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java :645)
> at
> com.bosch.blueworx.builder.BlueWorXBuilder.<clinit>(BlueWorXBuilder.java:207)
>
> ... 25 more
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.hyades.logging.commons.FileLoggerFactory
> at java.lang.ClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at
> org.apache.commons.logging.LogFactory.createFactory(LogFacto ry.java:1190)
> ... 31 more
>
> What is the problem?
>
> I hope you could help me
>
> Svenja
>
Previous Topic:Weblogic Profiling
Next Topic:running AGR testsuite file from command line
Goto Forum:
  


Current Time: Tue Apr 16 06:01:56 GMT 2024

Powered by FUDForum. Page generated in 0.05371 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top