Richard Tookey wrote:
viki Bhardwaj wrote:
1-he asked me that when we print object reference through sop statement then it prints like Student@736e84 where 736e84 is hexadecimal representation of hashcode
Not necessarily true since a hash code can be up to 32 bits and 6 hex digits is only 24 bits and I have seen system generated 32 bit hash codes. Also, since the JVM can move objects in memory it is not even a simple cut down representation of the address. Other than to suggest once again that you look at the OpenJDK source I can't help. To my mind, life is too short to worry about this irrelevant implementation detail and I suggest that it would be more productive for you to spend your spare time learning more of the language details.
Richard Tookey wrote: why do you need to know?
Jeanne Boyarsky wrote:Viki,
Has it ever worked? If so, have you installed any plugins since?
If you aren't using a clean workspace, try that first. That will either solve your problem or narrow it down to the Eclipse side.
eclipse.buildId=M20130204-1200
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product -clean
!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-09-19 13:01:48.601
!MESSAGE Unable to create class 'org.eclipse.e4.core.commands.CommandServiceAddon' from bundle '262'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.ClassCastException: Cannot cast org.eclipse.core.commands.CommandManager to org.eclipse.core.commands.CommandManager
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:861)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:113)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:255)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:185)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:49)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:258)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Caused by: java.lang.ClassCastException: Cannot cast org.eclipse.core.commands.CommandManager to org.eclipse.core.commands.CommandManager
at java.lang.Class.cast(Unknown Source)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:561)
at org.eclipse.e4.core.commands.CommandServiceAddon.init(CommandServiceAddon.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
... 26 more
!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-09-19 13:01:48.621
!MESSAGE Unable to create class 'org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon' from bundle '275'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "CommandProcessingAddon.commandService": no actual value was found for the argument "ECommandService".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:396)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:387)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:102)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:255)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:185)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:49)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:258)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-09-19 13:01:48.636
!MESSAGE Unable to create class 'org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon' from bundle '278'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "BindingProcessingAddon.commandService": no actual value was found for the argument "ECommandService".
at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:396)
at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:387)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:102)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:321)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:255)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:185)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:49)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:258)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
!ENTRY org.eclipse.osgi 2 0 2013-09-19 13:01:54.000
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:54.000
!MESSAGE Bundle reference:file:plugins/org.eclipse.persistence.jpa_2.4.2.v20121206-a9d0e8d.jar was not resolved.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.000
!MESSAGE Missing imported package javax.persistence_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.002
!MESSAGE Missing imported package javax.persistence.metamodel_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.002
!MESSAGE Missing imported package javax.persistence.spi_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:54.002
!MESSAGE Missing imported package javax.persistence.criteria_[1.1.0,2.2.0).
!ENTRY org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.jpt.dbws.eclipselink.core.gen_1.0.1.v201208222210 [436] was not resolved.
!SUBENTRY 2 org.eclipse.jpt.dbws.eclipselink.core.gen 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.dbws.builder_[2.3.0,3.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.jpt.dbws.eclipselink.ui_1.0.201.v201208222210 [437] was not resolved.
!SUBENTRY 2 org.eclipse.jpt.dbws.eclipselink.ui 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.jpt.dbws.eclipselink.core.gen_[1.0.0,2.0.0).
!SUBENTRY 2 org.eclipse.jpt.dbws.eclipselink.ui 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.dbws.builder_[2.3.0,3.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.persistence.dbws_2.4.2.v20121206-a9d0e8d [657] was not resolved.
!SUBENTRY 2 org.eclipse.persistence.dbws 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.jpa_2.4.2.
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.282
!MESSAGE Bundle org.eclipse.persistence.dbws.builder_2.4.2.v20121206-a9d0e8d [658] was not resolved.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing required bundle org.eclipse.persistence.dbws_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.dbws_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.internal.dbws_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.internal.xr_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing imported package org.eclipse.persistence.internal.xr.sxf_2.4.2.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.282
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.metadata_1.0.0.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.metadata.visit_1.0.0.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.parser_1.0.0.
!SUBENTRY 2 org.eclipse.persistence.dbws.builder 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package org.eclipse.persistence.tools.oracleddl.util_1.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-09-19 13:01:55.283
!MESSAGE Bundle org.eclipse.persistence.jpa_2.4.2.v20121206-a9d0e8d [659] was not resolved.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence.criteria_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence.metamodel_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing imported package javax.persistence.spi_[1.1.0,2.2.0).
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.transaction_1.1.0.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.transaction.xa_1.1.0.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.validation_0.0.0.
!SUBENTRY 2 org.eclipse.persistence.jpa 2 0 2013-09-19 13:01:55.283
!MESSAGE Missing optionally imported package javax.validation.groups_0.0.0.
!ENTRY org.eclipse.osgi 4 0 2013-09-19 13:01:55.288
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
at org.eclipse.e4.ui.internal.workbench.E4Workbench.processHierarchy(E4Workbench.java:172)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.init(E4Workbench.java:118)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.<init>(E4Workbench.java:69)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:306)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Campbell Ritchie wrote:You use the hash code to decide which bucket to put the object into in a hash based data structure. If you go through this thread, you will (I hope) find out how it is used.
Campbell Ritchie wrote:No it isn't. There is nothing unique about hash codes at all. Look at this recent thread where that sort of thing is discussed.
lokesh sree wrote:
I will redirect the OP to the javadoc for more clarity.. http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#hashCode()
Jeff Verdegan wrote:
viki Bhardwaj wrote:as i know hashCode is unique no
The hashCode() method returns an int. There are 4,294,967,296 different possible int values.
There is an object called Long, which has 18,446,744,073,709,551,616 different possible values.
Based on this alone, the pigeonhole principle tells us that hashCode() values cannot possibly be unique. When you start to bring in Strings and more complex object graphs, it becomes even more obvious.
Class.forName("com.jdbc.mysql.Driver");