Wednesday, November 23, 2011

java.lang.IllegalStateException: "Workbench has not been created yet"

I’ve been working with OSGi for quite awhile and have faced a problem "Workbench has not been createt yet" issues. I was getting this error, When i was trying to run OSGI plugin from Eclipse and I guess many of you must have face this problem. So i am writing a little bit about how to resolve this issue so others don’t repeat the same mistakes.

From a good article on eclipsezone:

java.lang.IllegalStateException: Workbench has not been created yet

This usually comes when someone tries to run a Java application against an OSGi bundle with java -classpath .... . It really means that the workbench plug-in hasn't started yet, and so calls to getWorkbench() fail. This is essentially a race condition, and can be solved by either expressing an explicit dependency on that bundle or bumping up that bundle to a higher start level than the workbench. Generally not seen, but if it is, that's what's happening.

Now to set the bundle to a higher start level than the workbench.
Select your manifest.mf, right-click, select Run As-> Run Configuration. Create a OSGi Framework launch configuration. Deselect all bundles except your bundle. Change the default set level to higher level and Press then "Add Required bundles"
Run this configuration. This should give you the correct output.

If you still get the same error ,then you can do
1. Add the -clean to the program Arguments.i,e(Run Configuration->OSGI framework->Arguments ->program Arguments)
                                           OR (Recommended 1 if failed then try 2)
2. Delete the .metadata folder which is created by default in Eclipse Workspace but before that please take the backup..:)




Hope its gonna work for you guys too..Feel free to comment.



Monday, October 31, 2011

Downloading and installing cURL on windows 7

cURL is a command-line tool. This means it is run from the command prompt (in Windows) or terminal (in Linux or OSX) and its results are displayed in the terminal window. There is no graphical interface. So in order to use cURL, you first have to open a command-line window.


To setup cURL:
  1. Download and unzip 64-bit cURL with SSL: http://curl.download.nextag.com/download/curl-7.21.7-win64-ssl-sspi.zip
  2. Copy the curl.exe file into your Windows PATH folder. By default, this is C:\Windows\System32.
  3. Download and install the Visual Studio 2010 C++ Runtime Redistributable 64 bit here: http://www.microsoft.com/download/en/details.aspx?id=13523
  4. Download the latest bundle of Certficate Authority Public Keys from http://curl.haxx.se/ca/cacert.pem
  5. Rename this file from cacert.pem to curl-ca-bundle.crt.
  6. Move this file into your Windows PATH folder. By default, this is C:\\Windows\System32.
Run cmd.exe to open your command prompt.
  1. type curl  http://www.google.com
  2. type curl  https://www.google.com
For both commands, you should see a couple pages of the HTML source code. If you see this, cURL is up and running!

Thursday, October 27, 2011

How to install Subversion,Google App Engine,Android with Eclipse.


This is tutorial assumes you already have Eclipse installed.

You can install the any plugin for Eclipse using the Software Update feature of Eclipse.
To install the plugin, using Eclipse:
Select the Help menu > Install New Software....
In the Work with text box, enter:


For Subversion:
http://subclipse.tigris.org/update_1.0.x

For Android:
https://dl-ssl.google.com/android/eclipse/

For Google App Engine:

Eclipse 3.6 (Helios):
http://dl.google.com/eclipse/plugin/3.6
Eclipse 3.5 (Galileo): http://dl.google.com/eclipse/plugin/3.5
Eclipse 3.4 (Ganymede): http://dl.google.com/eclipse/plugin/3.4
Eclipse 3.3 (Europa): http://dl.google.com/eclipse/plugin/3.3

Click OK
In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
In the next window, you'll see a list of the tools to be downloaded. Click Next.
Read and accept the license agreements, then click Finish.
Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
When the installation completes, restart Eclipse.

Additional Info:
Android
Subversion

How TOPT Works: Generating OTPs Without Internet Connection

Introduction Have you ever wondered how authentication apps like RSA Authenticator generate One-Time Passwords (OTPs) without requiring an i...