Weird bug running MM from Netbeans

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Weird bug running MM from Netbeans

Seamus Holden-2
Hi all

I've run into a really weird netbeans bug. I'm trying to write and debug an MM plugin  I am developing via netbeans, following the guide on the website.

Basically, when I launch micromanager from Netbeans, I get the following error:

java.lang.ClassNotFoundException: org.micromanager.AcquisitionEngine2010 in Thread[Pipeline Class loading thread,6,main]
  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:169)
  at org.micromanager.MMStudioMainFrame$8.run(MMStudioMainFrame.java:653)

Then my plugin crashes because it cannot use the acquisition engine (ie calling AcquisitionEngine.acquire()) .

After much hair pulling, I realised that my plugin runs fine if I launch MM outside of netbeans - presumably meaning that the acquisitionEngine2010 is loaded fine.

To my novice Java eyes, it looks like AcquisitionEngine2010 is not defined at org.micromanager.AcquisitionEngine2010, but rather at org.micromanager.AcquisitionWrapperEngine.AcquisitionEngine2010, or perhaps at org.micromanager.api.IAcquisitionEngine2010 (although there the class name is different) - maybe this is something to do with it.

Does anyone have any advice or idea what is going on (or how to fix it)? Clearly, this is not a killer issue since things work fine outside of netbeans, but it's such a nice IDE it would be a shame not to be able to use it.

Thanks!
Seamus

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Weird bug running MM from Netbeans

GrantHarris
Do you have MMAcqEngine.jar as a library in your NB project?
We have the libraries setup like this:  


-- Grant Harris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Weird bug running MM from Netbeans

Johannes Schindelin
In reply to this post by Seamus Holden-2
Hi Seamus,

On Fri, 21 Sep 2012, Holden Seamus John wrote:

> java.lang.ClassNotFoundException: org.micromanager.AcquisitionEngine2010 in Thread[Pipeline Class loading thread,6,main]

Unfortunately, the acquisition engine is written in Clojure. You will have
to compile it outside of Netbeans.

Ciao,
Johannes

P.S.: assuming that you're on Windows, you need to run build.bat in
acqEngine, I believe.

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Weird bug running MM from Netbeans

Seamus Holden-2
In reply to this post by GrantHarris
Hi Grant

Thanks very much, that worked!

I was using the list of libraries from http://valelab.ucsf.edu/~MM/MMwiki/index.php/Writing_plugins_for_Micro-Manager

To avoid anyone else getting confused, could someone with edit access maybe change the lines:

"
5.Browse to C:\Program Files\Micro-Manager-1.4\plugins\Micro-Manager and choose bsh-2.0b4.jar, commons-math-2.0.jar, MMCoreJ.jar, MMJ_.jar, swing-layout-1.0.4.jar, and swingx-0.9.5.jar.
6. Click Add JAR/Folder again and add C:\Program Files\Micro-Manager-1.4\ij.jar"

to
"
5. Browse to  C:\Program Files\Micro-Manager-1.4\plugins\Micro-Manager and add all the JAR files except ij.jar
6. Click Add JAR/Folder again and add C:\Program Files\Micro-Manager-1.4\ij.jar"

While we're at it, there's a trick that if you insert the following in your NetBeans build.xml file, then you don't need to manually copy over the plugin jar every time you change it, you just need to rebuild the project:
"

    <property name="pluginsDir"  location="C:\Program Files\Micro-Manager-1.4\mmplugins" />
    <target name="-post-jar">
        <!-- Empty placeholder for easier customization. -->
        <!-- You can override this target in the ../build.xml file. -->
        <echo message="--Copied MM plugin JAR to basedir: ${basedir}" />

        <copy file="${basedir}/${dist.jar}" toDir="${pluginsDir}" />

    </target>
"
Maybe it's worth adding to the page?

Thanks
Seamus
________________________________________
From: GrantHarris [[hidden email]]
Sent: 21 September 2012 18:08
To: [hidden email]
Subject: Re: [micro-manager-general] Weird bug running MM from Netbeans

Do you have MMAcqEngine.jar as a library in your NB project?
We have the libraries setup like this:
<http://micro-manager.3463995.n2.nabble.com/file/n7578700/libs.gif>

-- Grant Harris



--
View this message in context: http://micro-manager.3463995.n2.nabble.com/Weird-bug-running-MM-from-Netbeans-tp7578699p7578700.html
Sent from the Micro-Manager mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Weird bug running MM from Netbeans

Nico Stuurman
Administrator
Hi Seamus,

> To avoid anyone else getting confused, could someone with edit access maybe change the lines:

Please do request an account so that you can make such changes yourself!

Thanks!


Nico


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Weird bug running MM from Netbeans

Seamus Holden-2
Ok, will do - sorry, I didn't know that was possible!

On 24/09/12 19:58, Nico Stuurman wrote:

> Hi Seamus,
>
>> To avoid anyone else getting confused, could someone with edit access maybe change the lines:
> Please do request an account so that you can make such changes yourself!
>
> Thanks!
>
>
> Nico
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> micro-manager-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...