Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333150

Summary: Class org.eclipse.jface.text.TextSelection can't be used outside Eclipse RCP application
Product: [Eclipse Project] Platform Reporter: Dmitry K <dmitry.astu>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dmitry K CLA 2010-12-23 07:22:18 EST
Build Identifier: 20100617-1415

I've created application using JFace viewer infrastructure including TextSelection.
While trying to run it, I've got the following error:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2691)
	at org.eclipse.jface.text.TextViewer$5.run(TextViewer.java:2672)
	at org.eclipse.swt.widgets.Display.runTimer(Display.java:4167)
	at org.eclipse.swt.widgets.Display.messageProc(Display.java:3256)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
	at com.onpositive.richtexteditor.snippets.BrowserSample.main(BrowserSample.java:65)
Caused by: java.lang.SecurityException: class "org.eclipse.core.runtime.Platform"'s signer information does not match signer information of other classes in the same package
	at java.lang.ClassLoader.checkCerts(Unknown Source)
	at java.lang.ClassLoader.preDefineClass(Unknown Source)
	at java.lang.ClassLoader.defineClassCond(Unknown Source)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$000(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)

Reproducible: Always

Steps to Reproduce:
1. Try to use TextSelection in standalone SWT application, you'll get an error described
Comment 1 Dmitry K CLA 2010-12-23 07:24:04 EST
Added not full stacktrace by mistake. the last line is:

	at org.eclipse.jface.text.TextSelection.<clinit>(TextSelection.java:32)
Comment 2 Dani Megert CLA 2010-12-29 05:17:33 EST
Sorry, but I cannot reproduce the problem. Maybe you manually extracted stuff from the JAR and hence it fails with the security exception.

If you still see this problem then please provide steps (example) to reproduce it and reopen the bug.