Compressed JavaScript Files Not Available

Bug #1084323 reported by Karthik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Helioviewer.org
New
Undecided
Unassigned

Bug Description

After installing the helioviewer application, I noticed that jquery files are not available under /lib folder.

Please see the attached screen shot of the site with Firebug results.

Tags: javascript
Revision history for this message
Karthik (karthikgp) wrote :
Revision history for this message
Keith Hughitt (keith-hughitt) wrote :

Do the files exist on your filesystem? What are the values you have in Config.ini for "root_dir" and "web_root_url"?

You may also want to check the permissions for the lib/ folder.

Revision history for this message
Karthik (karthikgp) wrote :
Download full text (3.1 KiB)

I ran apache ant command in scripts directory to generate the compressed Javascript files.

However, I encountered error in jsmin.py.

Below is the trace.

Buildfile: /var/www/scripts/build.xml

clean:
     [echo] Removing old build files

build:
     [echo] Concatenating JavaScript/CSS
     [echo] Minifying JavaScript/CSS

BUILD FAILED
/var/www/scripts/build.xml:39: Execute failed: java.io.IOException: Cannot run program "/var/www/scripts/jsmin/jsmin.py" (in directory "/var/www/scripts/jsmin"): java.io.IOException: error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
        at java.lang.Runtime.exec(Runtime.java:593)
        at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:827)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:445)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:459)
        at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:635)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:676)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:502)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
        at org.apache.tools.ant.Main.runBuild(Main.java:801)
        at org.apache.tools.ant.Main.startAnt(Main.java:218)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
        at java.lang.ProcessImpl.start(ProcessImpl.java:65)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
        ... 24 more

Total time: 1 second

And I fixed it by changing the code of jsmin.py to run ant command. I changed the first line of the program to /usr/bin/python instead of /usr/bin/python2 of the jsmin.py file.

But even then, it did not create any compressed files in lib folder. The folder is still empty.

Moreover, these are the settings I have for "root_dir" and "web_root_url".

root_dir =/var/www

web_root_url=http://helioviewer.cs.montana.edu

See the attached screen shot of the site ...

Read more...

Revision history for this message
Karthik (karthikgp) wrote :

The permission of lib folder is for the root user.

I ran the ant command with sudo command.

Revision history for this message
Keith Hughitt (keith-hughitt) wrote : Re: [Bug 1084323] Re: Compressed JavaScript Files Not Available

Thanks for reporting the python issues -- on another machine it was having
trouble because python pointed to python3 which jsmin.py is incompatible
with. The better fix would probably be to update jsmin.py (e.g. using 2to3).

The compressed JS files go in the build/ folder, not in lib. Do you see
them there?

As you are getting things set up I would recommend disabling "compress_js"
and "compress_css". That should make it easier to debug some problems.

I'm guessing that the "missing" errors you are seeing are all permissions
errors -- the apache user (www-data) does not have access to the files. As
a test you could try either making all files temporaily world readable
(e.g. chmod -R 755 /var/www), or possibly adding www-data to the group for
all files and folders in /var/www.

Keith

On Thu, Nov 29, 2012 at 12:51 PM, Karthik <email address hidden> wrote:

> The permission of lib folder is for the root user.
>
> I ran the ant command with sudo command.
>
> --
> You received this bug notification because you are a member of
> Helioviewer, which is subscribed to Helioviewer.org.
> https://bugs.launchpad.net/bugs/1084323
>
> Title:
> Compressed JavaScript Files Not Available
>
> Status in Helioviewer.org:
> New
>
> Bug description:
> After installing the helioviewer application, I noticed that jquery
> files are not available under /lib folder.
>
> Please see the attached screen shot of the site with Firebug results.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/helioviewer.org/+bug/1084323/+subscriptions
>

Revision history for this message
Karthik (karthikgp) wrote :

I updated jsmin.py to have python instead of python2.

Also, after I copied the files that I had in the previous version of the application from /lib folder (i.e., all the jquery files). the site is works now.

However, I am not able to see any recently posted videos yet. I will check the settings and try to fix it.

You can check the site at "http://helioviewer.cs.montana.edu/".

Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.