Problem with run.mode=production and /classpath URLs

91 views
Skip to first unread message

Nolan Darilek

unread,
May 7, 2011, 12:39:09 PM5/7/11
to Lift
I just deployed my first Lift app in a production environment for a
client, but noticed an odd issue. My comet updates weren't processing,
and after a bit of diagnosis, I noticed that
/context/classpath/jquery.js wasn't being found. Since the app worked
locally, I tried diagnosing what was different.

I'm using the SBT Jetty embedding plugin. I noticed that if I ran:

java -jar myapp.war

that everything worked fine. If I ran:

java -Drun.mode=production -jar myapp.war

then:

curl localhost:8080/classpath/jquery.js

returned a 404 page from Lift.

This is in 2.4-SNAPSHOT. Am I missing something obvious, like /classpath
URLs not working in production or something? Doesn't make much sense,
but I'm kind of at a loss.

Thanks.

Jeppe Nejsum Madsen

unread,
May 7, 2011, 2:20:11 PM5/7/11
to lif...@googlegroups.com

Jquery is served minified when running in production. I haven't
checked 2.4, but at one time we had a problem including the minified
version in the jar. You should verify if the minified jquery js
included in the jar

/Jeppe

Nolan Darilek

unread,
May 7, 2011, 3:15:00 PM5/7/11
to lif...@googlegroups.com
If I do:

find . -name '*jquery*js'

from the Lift checkout, I see JQuery 1.4.4 and 1.3.2. I don't see
.min.js files that I'd assume were minified versions.

What files from the checkout should I be looking for to determine their
presence in the webkit jar? Or is the minification happening in code?

Indrajit Raychaudhuri

unread,
May 7, 2011, 3:44:30 PM5/7/11
to lif...@googlegroups.com
Minified jquery file should be part of lift-webkit jar. It is minified during package action.
I hope it's not falling off the edge during jetty embedding.

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Jeppe Nejsum Madsen

unread,
May 7, 2011, 5:37:11 PM5/7/11
to lif...@googlegroups.com
On Sat, May 7, 2011 at 9:15 PM, Nolan Darilek <no...@thewordnerd.info> wrote:
> If I do:
>
> find . -name '*jquery*js'
>
> from the Lift checkout, I see JQuery 1.4.4 and 1.3.2. I don't see .min.js
> files that I'd assume were minified versions.
>
> What files from the checkout should I be looking for to determine their
> presence in the webkit jar? Or is the minification happening in code?

You need to check the lift-webkit jar, not the source checkout.
Minification happens during build.

/Jeppe

Nolan Darilek

unread,
May 7, 2011, 6:20:40 PM5/7/11
to lif...@googlegroups.com
In my lift-webkit.jar, I see jquery-1.4.4.js and jquery-1.3.2.js. Should
I be seeing jquery-1.4.4.min.js/1.3.2.min.js as well?

Mahmood Ali

unread,
May 7, 2011, 7:42:20 PM5/7/11
to lif...@googlegroups.com
Greetings,

> You need to check the lift-webkit jar, not the source checkout.
> Minification happens during build.

It seems that minification actually happens, but bnd-bundle ignores
all minified resources when bundling the jar.

- Mahmood

Mahmood Ali

unread,
May 7, 2011, 7:49:50 PM5/7/11
to lif...@googlegroups.com
Greetings,

>> You need to check the lift-webkit jar, not the source checkout.
>> Minification happens during build.

bnd-bundle uses the main resources path (path to resources in
src/main/resources) rather than in target where the minified files
are: https://github.com/weiglewilczek/bnd4sbt/blob/master/src/main/scala/properties.scala#L142
. The `bndIncludeResource` should overriden to use
`mainResourcesOutputPath` instead, so that the minified files get
copied.

- Mahmood

Nolan Darilek

unread,
May 7, 2011, 8:02:25 PM5/7/11
to lif...@googlegroups.com
I don't know to which message you're replying, but for clarification, I
grabbed the lift-webkit.jar from the lib_managed/ directory of my
project. It did not seem to have a jquery*.min.js file inside.

Mahmood Ali

unread,
May 8, 2011, 1:37:39 AM5/8/11
to lif...@googlegroups.com
> I don't know to which message you're replying, but for clarification, I
> grabbed the lift-webkit.jar from the lib_managed/ directory of my project.
> It did not seem to have a jquery*.min.js file inside.
Sorry for confusing you. My email was to expose a bug in the
LiftProject configuration that causes to ignore the minified files
(and all generated resources) when deploying jars. Pending a commiter
review, we should file a ticket for this.

- Mahmood

Jeppe Nejsum Madsen

unread,
May 8, 2011, 8:06:32 AM5/8/11
to lif...@googlegroups.com

Thanks for diagnosing this. Could you open a ticket and reference this
thread ou need to be a watcher of the liftweb space)?

Jeppe

Mahmood Ali

unread,
May 8, 2011, 8:23:05 AM5/8/11
to lif...@googlegroups.com

Indrajit Raychaudhuri

unread,
May 15, 2011, 3:34:17 PM5/15/11
to Lift
Folks,

This stands fixed in Lift, in master now - should be available in 2.4-
M1

Cheers, Indrajit

On May 8, 5:23 pm, Mahmood Ali <notn...@gmail.com> wrote:
> Thanks!
>
> Created #1004:https://www.assembla.com/spaces/liftweb/tickets/1004-minified-files-a...
> .
>
> I also reported the issue to bnd4sbt:https://github.com/weiglewilczek/bnd4sbt/issues/27.
>
> - Mahmood
>
> On Sun, May 8, 2011 at 8:06 AM, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
>
>
>
>
>
>
>
> > On Sun, May 8, 2011 at 1:49 AM, Mahmood Ali <notn...@gmail.com> wrote:
> >> Greetings,
>
> >>>> You need to check the lift-webkit jar, not the source checkout.
> >>>> Minification happens during build.
> >> bnd-bundle uses the main resources path (path to resources in
> >> src/main/resources) rather than in target where the minified files
> >> are:https://github.com/weiglewilczek/bnd4sbt/blob/master/src/main/scala/p...

Nolan Darilek

unread,
May 15, 2011, 7:19:54 PM5/15/11
to lif...@googlegroups.com
Cool, thanks a bunch to everyone who debugged/resolved this. Haven't
gotten to confirm it yet, but I'm glad to know that it's fixed.
Reply all
Reply to author
Forward
0 new messages