Re: Can't compile unicorn

Le 16/08/2010 21:57, Thibault ROHMER a écrit :
> Thanks,
>
> Works like a charm with latest JDK/JRE :)
>
> However i'm having the same issue as Johan Cardel, Ivan Smith, JC
> Etiemble, tanyuqiang, Bobbi Fox, Billy Walker, ...

I believe it is a different issue, but with similar consequences. If you 
try again now you should get some information on what went wrong instead 
of this stack trace.

> The validatation by URI is failing for local addresses. I've edited
> *unicorn.properties* to set *ACCEPT_LOCAL_ADDRESSES* to *true.*
> [...]
> As a temporary workaround, i'm using the file upload which is working.

I think I understand what your problem is. ACCEPT_LOCAL_ADDRESSES means 
that Unicorn will allow pages that are on your local network (or 
localhost). But basically, Unicorn is only a frontend to different 
services. It does HTTP requests to the online markup validator, css 
validator, mobileOK checker, ...
So what happens when you give Unicorn a local URI? It will send a 
request to the markup validator with this uri as the main parameter. 
Then the markup validator will try to reach and validate it and send 
results back to Unicorn. I think that's where your problem lies: the 
markup validator is probably not able to reach the local URI you tried 
to validate. For this to work, you would have to either:
  1- make your local webserver accessible from the Internet (probably 
implying tuning your router, firewall, ...)
  2- setup instances of the different services (markup, css, feed, ...) 
locally as well so they can reach your webserver and adapt Unicorn's 
observers.list and contracts files to your setup.

I realize that this main not be written in the website obviously enough, 
as a few people had related comments. For example, some people think 
using Unicorn will save bandwidth. Overall, that is wrong as there are 
1+n requests made when a user uses Unicorn:
  * one made by the user to Unicorn,
  * n made by Unicorn to the different validators
What's true though, is that it saves bandwidth for the user, as he 
already does one request himself.

>
> [Community bonus]
> Very small installation tuto (for windows) :

Thank you very much for that! I'll add it to code.w3.org/unicorn soon.

Best Regards,
Jean-Gui

> -Download & extract the following software:
>
> apache-ant        # used to compile unicorn
> apache-ivy         # needed to add features to apache-ant
> apache-tomcat   # the webserver
>
> - Copy apache-ivy\ivy-x.x.x.jar to apache-ant\lib
> - Set the following environment variables (adapth paths to your system):
>
> ANT_HOME = D:\...\apache-ant\
> ANT_OPTS = -Xmx256Mo       # Optionnal, I guess you can offer 256Mo to
> the compiler
> JAVA_HOME = C:\Program Files\Java\jdk
> JRE_HOME = C:\Program Files (x86)\Java\jre
> TOMCAT_OPTS = -Dunicorn.home=/C:/unicorn
>
> - Edit apache-tomcat\conf\tomcat-users.xml to add the manager role
> (replace username/password !):
>
> <role rolename="manager"/>
> <user username="tomcat" password="s3crets3crets3cret" roles="manager"/>
>
> - Start tomcat with apache-tomcat\bin\startup.bat [use shutdown.bat to
> close it properly]
>
> - Go to http://localhost:8080/ to see tomcat home page
> Then clic on "Tomcat Manager" or go to http://localhost:8080/manager/html
> Use login & password you've just define in tomcat-users.xml
>
> - Leave this window a few minutes, time to build unicorn:
>
> - Fetch the source code with Mercurial :
>
> hg clone https://dvcs.w3.org/hg/unicorn
>
> - Then open a console where you just clone/pull latest code and execute
> the following command to get dependancies & compile :
>
> ant retrieve generate_observer generate_tasklist default_conf war
>
> - BUILD SUCCESSFUL
> -> Go next step
> BUILD FAILED
> -> Something's missing / broken, try to resolve the issue, look on the
> internet, eventually request some help in the forums
>
> - Copy
> unicorn\WebContent\WEB-INF\resources\tomcat_policy\05unicorn.policy to
> apache-tomcat\conf\
>
> - Deploy the .war you've just built by filling the form "Select WAR file
> to upload", it is located in unicor\dist\unicorn.war
>
> - Goto to http://localhost:8080/unicorn
>
> - n'joy
>
> - A few more stuff:
> I've edited unicorn.properties to set ACCEPT_LOCAL_ADDRESSES to true
> I've edited unicorn_log4j.xml to reduce log level to "info" for
> Velocity, Framework & unicorn.
>
>
> Sources :
> -------------
> - http://code.w3.org/unicorn/wiki/Documentation/Install
> - unicorn/README (downloaded file)
> - http://mercurial.selenic.com/wiki/Mercurial
> - http://lists.w3.org/Archives/Public/public-qa-dev/2010Aug/0004.html
> - http://lists.w3.org/Archives/Public/public-qa-dev/2010Aug/0014.html
>
>
> On Thu, Aug 12, 2010 at 6:26 PM, Jean-Guilhem Rouel <jean-gui@w3.org
> <mailto:jean-gui@w3.org>> wrote:
>
>     Le 11/08/2010 19:00, Thibault ROHMER a écrit :
>
>         Hi,
>
>         Sorry to bother you but I can't compile unicorn, it fails here
>         (Framework.java:32)
>
>         import org.*w3*.unicorn.tasklist.TUi;
>
>         The TUi class seems to be missing. Notice w3 != w3c.
>
>
>     Hi,
>
>     You may want to check
>     http://lists.w3.org/Archives/Public/public-qa-dev/2010Aug/0004.html.
>
>     You have to run [[ant retrieve generate_observer generate_tasklist
>     default_conf war]] to generate and compile everything. Note that the
>     task retrieve needs apache ivy to work properly.
>
>     And yes, we need to update
>     http://code.w3..org/unicorn/wiki/Documentation/Install :).
>
>     HTH.
>
>     Regards,
>     Jean-Gui
>
>
>         I'm using the mercurial repository mentionned here
>         http://code.w3.org/unicorn/wiki/Documentation/Install
>         <http://code.w3..org/unicorn/wiki/Documentation/Install> but
>
>         I've also added the following .jars in filesystem & build.xml to
>         avoid
>         first obvious build errors :
>         <fileset file="WebContent/WEB-INF/lib/commons-lang-2.5.jar" />
>         <fileset file="WebContent/WEB-INF/lib/commons-logging-1.1.1.jar" />
>         <fileset file="WebContent/WEB-INF/lib/log4j-1.2.16.jar" />
>         <fileset file="WebContent/WEB-INF/lib/velocity-1.6.4.jar" />
>         <fileset
>         file="WebContent/WEB-INF/lib/velocity-tools-generic-2.0.jar" />
>
>         Thanks for helping me :)
>
>         Thibault
>
>
>

Received on Tuesday, 17 August 2010 16:25:28 UTC