AnsweredAssumed Answered

Execute JAR file placed inside Alfresco repository

Question asked by cile87 on Dec 6, 2011
Latest reply on Dec 7, 2011 by cile87
Say I have a JAR file in Company Home/myfolder/myJarFiles/someJar.jar and now I want to execute that JAR form inside Alfresco. Is that possible by the way?

What I'm trying to do, is create an URL out of that JAR file with this (when I enter given URL in browser, it starts downloading a file, so the URL is probably correct):
String url = "" + Utils.generateURL(FacesContext.getCurrentInstance(), new Node(fileInfo.getNodeRef()), URLMode.HTTP_DOWNLOAD);
then use class loader to load jar and create an instance of class:
Class klass = Class.forName("my.package.MyClass", true, classLoader);
Object myObject = klass.newInstance();
However, I keep getting a ClassNotFoundException in method.
Is is possible that Alfresco doesn't let me load my own classes dynamically? Is there a cure? Or perhaps it is something totally diiferent…?