This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 226987 - New Project does not work on Windows 8 - freemarker tries to load JythonWrapper
Summary: New Project does not work on Windows 8 - freemarker tries to load JythonWrapper
Status: RESOLVED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.4
Hardware: PC Other
: P4 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-04 15:46 UTC by CElliott
Modified: 2015-10-29 13:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (46.83 KB, text/plain)
2013-03-07 12:07 UTC, CElliott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description CElliott 2013-03-04 15:46:09 UTC
Create new project does not work on Windows 8; worked on Netbeans 7.2.1.  IDE goes thru the motions of creating a new project, but just halts before process completed.  If one presses cancel and looks on the hard disk in the NetbeansProjects folder,the new project exists.  One can import the new project into Netbeans 7.3, click on the main class, and it appears in the editor, but it is empty of text.  The same thing happens when a new class is added to the project: An empty file is created with the desired name, but all the boilerplate for the class has to be typed in by hand.
Comment 1 Marian Mirilovic 2013-03-07 00:09:49 UTC
Could you please attach messages.log file, are you able to reproduce it, what type of project you are creating ...  and reopen this issue ?
Thanks in advance.
http://wiki.netbeans.org/FaqLogMessagesFile
Comment 2 CElliott 2013-03-07 12:07:35 UTC
Created attachment 132324 [details]
messages.log

The attached log files shows that NetBeans 7.3 is apparently missing a class: freemarker.ext.jython.JythonWrapper, which causes a class not found exception when a new project is created.
Comment 3 CElliott 2013-03-07 12:33:05 UTC
Here is the procedure I used to reproduce this bug (which happens whether or not NetBeans is run as administrator; debugging will not work unless NetBeans is run as administrator on Win 8):

Select File/New Project
Choose Java/Java Application
Click next
Set project name to "TestProject" and set project location to "E:\Development\NetBeansProjects."  In all previous versions of NetBeans the project location could be set once to a reasonable default (NOT THE SYSTEM DRIVE) and it would stay that way. I have spent hours trying to find a way to change the default project location and there is just no way!!!!?????????
Note "Create Main Class" is selected.
Click next
A message area appears in bottom left of dialog box saying creating project.  The progress bar therein goes to 25% and stays there for several seconds, then the display area disappears.  All the buttons at the bottom of the dialog box are greyed out except Help.
Dismiss the dialog box by clicking the red X in the top right corner.
Click on File/Open Project; the new "TestProject" appears in E:\Development\NetBeansProjects; select it and then click on "Open Project"
Note that the main class "TestProject.java" exists, but is an empty file.

I uploaded the most recent messages.log file, which contains a java.lang.ClassNotFoundException: freemarker.ext.jython.JythonWrapper.
Comment 4 Milos Kleint 2013-03-07 14:39:38 UTC
reassigning to platform datasystems (that appears to be closest to freemarker script engine)

from the log stacktrace the problem appears to be in freemarker's code that somehow triggered loading of optional extension?
Comment 5 Jaroslav Tulach 2013-07-18 08:22:28 UTC
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.
Comment 6 CElliott 2013-07-18 17:04:47 UTC
Tank yu for your herd wrk and for yu're suggestion that remaiming jython.jar in the C:\Windows\Java\lib\ext fulder wood fixe thy project/file creation problem in Netbeans 7.3.4651 buld 107842.  I remaimed tree copies of jython.jar in tre separate (and fefferint) \ext\ directories, and no thing is chnged.
Comment 7 Jaroslav Havlin 2013-08-19 08:30:29 UTC
So did you remove the jython.jar files, or moved them somewhere else?
Is the exception still the same?
(Can you please attach the IDE Log again?)
Thanks.
Comment 8 Jaroslav Havlin 2015-10-29 13:44:28 UTC
Closing as WORKSFORME for now.
If you can still reproduce the bug, please reopen this issue (and preferably provide requested information).
Thank you for understanding.