Netbeans 7.3 silently fails on creating a new project or adding a file to an existing project. The project or file is created, but both are blank (e.g., no class definition or package name). I received the following email on this bug from jtulach@netbeans.org:
(https://netbeans.org/bugzilla/show_bug.cgi?id=226987)
"The code in freemarker's DefaultObjectWrapper says:
try {
JYTHON_OBJ_CLASS = Class.forName("org.python.core.PyObject");
JYTHON_WRAPPER = freemarker.ext.jython.JythonWrapper.INSTANCE;
} catch (Exception e) {}
I think it succeeds loading "org.python.core.PyObject", but then fails on
accessing the freemarker.ext.jython.JythonWrapper with an error (e.g. not an
exception).
It is possible to fix freemarker to also catch an Error in this case. Consider
reporting a bug to the freemarker guys. Explaining that you have jython on
classpath, but not the freemarker jython extension.
If you don't want to report a bug to them, remove
C:\Windows\Sun\Java\lib\ext\jython.jar and things should work again.
Closing the bug: status fixed is probably not the most appropriate one, but I
hope the above advice will be enough to get you past your problems."
Renaming jython.jar improves the situation (creating new project Temp now creates a Temp.java file), but does not fix it (the project still must be opened manually, and Temp.java is still blank). Nevertheless, Mr. Tulach seems convinced that this is a FreeMarker problem. Perhaps someone there could take a whack at it?
That it only catches
Exception(while, for example,LinkageErrorcould occur too) is most certainly an oversight. I will look into that. But how does that cause anything to fail silently? Sounds like a quite fatal error.Also,
freemarker.jaralways contains the Jython support. However, FreeMarker before 2.3.19 wasn't compatible with Jython 2.2 and 2.5. Are they using an older version maybe? If FreeMarker 2.3.19 or later still fails to linki to Jython, it would be good if you can send a stack trace.I would be glad to help. How would I capture a stack trace?
Charles Elliott
From: "Dániel Dékány" [mailto:ddekany@users.sf.net]
Sent: Thursday, July 18, 2013 2:29 PM
To: [freemarker:bugs]
Subject: [freemarker:bugs] #394 Netbeans 7.3 Fails on Creating a New Project
or File
That it only catches Exception (while, for example, LinkageError could occur
too) is most certainly an oversight. I will look into that. But how does
that cause anything to fail silently? Sounds like a quite fatal error.
Also, freemarker.jar always contains the Jython support. However, FreeMarker
before 2.3.19 wasn't compatible with Jython 2.2 and 2.5. Are they using an
older version maybe? If FreeMarker 2.3.19 or later still fails to linki to
Jython, it would be good if you can send a stack trace.
[bugs:#394] http://sourceforge.net/p/freemarker/bugs/394/ Netbeans 7.3
Fails on Creating a New Project or File
Status: open
Labels: FreeMarker Netbeans 7.3
Created: Thu Jul 18, 2013 04:52 PM UTC by Charles Elliott
Last Updated: Thu Jul 18, 2013 04:52 PM UTC
Owner: nobody
Netbeans 7.3 silently fails on creating a new project or adding a file to an
existing project. The project or file is created, but both are blank (e.g.,
no class definition or package name). I received the following email on this
bug from jtulach@netbeans.org:
(https://netbeans.org/bugzilla/show_bug.cgi?id=226987)
"The code in freemarker's DefaultObjectWrapper says:
try {
JYTHON_OBJ_CLASS = Class.forName("org.python.core.PyObject");
JYTHON_WRAPPER = freemarker.ext.jython.JythonWrapper.INSTANCE;
} catch (Exception e) {}
I think it succeeds loading "org.python.core.PyObject", but then fails on
accessing the freemarker.ext.jython.JythonWrapper with an error (e.g. not an
exception).
It is possible to fix freemarker to also catch an Error in this case.
Consider
reporting a bug to the freemarker guys. Explaining that you have jython on
classpath, but not the freemarker jython extension.
If you don't want to report a bug to them, remove
C:\Windows\Sun\Java\lib\ext\jython.jar and things should work again.
Closing the bug: status fixed is probably not the most appropriate one, but
I
hope the above advice will be enough to get you past your problems."
Renaming jython.jar improves the situation (creating new project Temp now
creates a Temp.java file), but does not fix it (the project still must be
opened manually, and Temp.java is still blank). Nevertheless, Mr. Tulach
seems convinced that this is a FreeMarker problem. Perhaps someone there
could take a whack at it?
Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/freemarker/bugs/394/
To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#394I have no idea what's going in the reported case, but I have changed how Jython class init failures are handled. From the version history:
Bug fix: When trying to access the optional Jython (or W3C DOM) classes has failed in DefaultObjectWrapper with an Error, rather than with an Exception, loading the DefaultObjectWrapper class itself has failed, instead of the Jython (or W3C DOM) support being disabled. From now in, it will survive any kind of Throwable there, and if the Throwable is not an ClassNotFoundException, it will also log the Throwable.
Last edit: Dániel Dékány 2014-06-15