Hemlock on Windows

185 views
Skip to first unread message

Umar Mustafa

unread,
Aug 27, 2009, 3:41:26 AM8/27/09
to Hemlock
Hello everyone!

Has anyone used Hemlock on Windows? I'm having problems setting it up
and using it.

Regards,
Umar

Yi Tan

unread,
Aug 27, 2009, 6:36:57 AM8/27/09
to hem...@googlegroups.com
Yes, I have been running it on Win.

What's your problem, give details please. I might be able to give advice.


Regards,

ty

thomas pomfret

unread,
Aug 27, 2009, 6:41:40 AM8/27/09
to hem...@googlegroups.com
Hi,
That's great to know as I haven't actually tried running it on windows yet.

Likewise if you have any specific errors/problems post them and maybe I can help also.

Thomas



2009/8/27 Yi Tan <yi2...@gmail.com>



--
http://bassinvaders.net
http://sub-ldn.com
http://thomaspomfret.com

Umar Mustafa

unread,
Aug 27, 2009, 8:03:37 AM8/27/09
to Hemlock
Thank you for responding.

I'm not a very experienced user, so forgive me if I ask any stupid
questions.

I followed the basic guide on the Hemlock website to set it up. I have
Flex, ejabberd, Ruby and Rake all set up on my system.

Now my basic question is where to unarchive the Hemlock files and how
to use them?

Secondly, it would be very nice if you could translate the steps given
under the "An example app" on the Hemlock website ( http://hemlock-kills.com/learn
) for Windows environment. As when I executed the following command;

rake hemlock:build:drawingDemo

It gave me the following error:

rake aborted!
wrong number of arguments (2 for 1)
rakefile:53:in `task'
(See full trace by running task with --trace)


Any light on what am I doing wrong here?

Thanks.

Umar

On Aug 27, 4:41 pm, thomas pomfret <thomaspomf...@gmail.com> wrote:
> Hi,
> That's great to know as I haven't actually tried running it on windows yet.
>
> Likewise if you have any specific errors/problems post them and maybe I can
> help also.
>
> Thomas
>
> 2009/8/27 Yi Tan <yi2...@gmail.com>
>
>
>
>
>
> > Yes, I have been running it on Win.
>
> > What's your problem, give details please. I might be able to give advice.
>
> > Regards,
>
> > ty
>

Yi Tan

unread,
Aug 27, 2009, 10:50:22 AM8/27/09
to hem...@googlegroups.com
You got a rake(ruby) error, which says something wrong in the Rakefile(in hemlock) folder.

Please open Rakefile to have a look. it's written in Ruby, similar to english.

From line 54, it says:

      # Usage:
      # - `rake hemlock:build:drawingDemo`
      # - `rake hemlock:build:drawingDemo[true] (debug mode)


So, try

"rake hemlock:build:drawingDemo true"

if it still fails, then run

rake hemlock:build:drawingDemo --trace

and copy&paste the detailed trace info into this post.

Umar Mustafa

unread,
Aug 27, 2009, 11:37:26 AM8/27/09
to Hemlock
I did try both the commands, same error. Here's the result of --trace:

(in D:/Hemlock)
rake aborted!
wrong number of arguments (2 for 1)
D:/Hemlock/rakefile:53:in `task'
D:/Hemlock/rakefile:53
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1571:in
`in_namespace'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:641:in
`namespace'
D:/Hemlock/rakefile:51
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1571:in
`in_namespace'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:641:in
`namespace'
D:/Hemlock/rakefile:6
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1940:in `load'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1940:in
`raw_load_rakefile'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1727:in
`load_rakefile'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
`standard_exception_handling'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1726:in
`load_rakefile'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1710:in `run'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
`standard_exception_handling'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run'
D:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
D:/ruby/bin/rake:16:in `load'
D:/ruby/bin/rake:16


The error seems to be on the following line in the Rakefile

task :drawingDemo, [:debug] do |t, args|

I haven't programmed in Ruby, so I don't know its syntax. Maybe it
requires some parameters to build?

Thanks.

Umar

Yi Tan

unread,
Aug 27, 2009, 12:43:13 PM8/27/09
to hem...@googlegroups.com
It seems to me your rake version is out of date.

do:

 gem update --remote rake

to update your rake, then try those commands again.

Regards,

ty

Umar Mustafa

unread,
Aug 27, 2009, 3:26:47 PM8/27/09
to Hemlock
Thanks alot! That worked.. And now I've run into this new problem.

Its giving the following error now

(in D:/Hemlock)
Building DrawingDemo...
Exception in thread "main" java.io.FileNotFoundException: D:
\Flex_SDK_3\bin\mxjar (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
Built com/mintdigital/drawingDemo/containers/DrawingDemoContainer.swf


I tried digging into what this mxjar file is, but didn't find
anything. Perhaps you could help here too?

I really appreciate all this.

Thanks.

Umar

On Aug 27, 10:43 pm, Yi Tan <yi2...@gmail.com> wrote:
> It seems to me your rake version is out of date.
>
> do:
>
>  gem update --remote rake
>
> to update your rake, then try those commands again.
>
> Regards,
>
> ty
>

Yi Tan

unread,
Aug 28, 2009, 4:54:38 AM8/28/09
to hem...@googlegroups.com
No idea about this one. 

It seems to me the SDK can't find the specific java file. But i don't know what mxjar is. 

Would it be something wrong with you java home path? I just guess

Regards,

ty


On Fri, Aug 28, 2009 at 3:26 AM, Umar Mustafa <umarm...@gmail.com> wrote:
mxjar

Umar Mustafa

unread,
Aug 29, 2009, 5:44:35 AM8/29/09
to Hemlock
I couldn't fix the mxjar problem. After a lot of hitting and trying, I
got it compiled manually using Flex's mxmlc command.

Now I'm getting an error while trying to run the Flash policy daemon.
The following command:

rake hemlock:start:policyd

Gives the following error:

(in D:/Hemlock)
rake aborted!
Exec format error - ./script/flashpolicyd.pl --file=public/
crossdomain.xml --port=8040 &
D:/Hemlock/rakefile:88:in `exec'
(See full trace by running task with --trace)


Once again, I'm totally stuck.

Umar

On Aug 28, 2:54 pm, Yi Tan <yi2...@gmail.com> wrote:
> No idea about this one.
> It seems to me the SDK can't find the specific java file. But i don't know
> what mxjar is.
>
> Would it be something wrong with you java home path? I just guess
>
> Regards,
>
> ty
>
>
>
> On Fri, Aug 28, 2009 at 3:26 AM, Umar Mustafa <umarmust...@gmail.com> wrote:
> > mxjar

Yi Tan

unread,
Aug 29, 2009, 10:04:07 AM8/29/09
to hem...@googlegroups.com
The error says it can not execute a perl script, which is flashpolicyd.pl

so you need to install perl.

But if you only run it locally, there is no need to use the rake task. Just start ejabber from the windows start menu, and then launch your app, it will work.


Regards,

ty

Ron DeVera

unread,
Aug 29, 2009, 11:15:14 AM8/29/09
to hem...@googlegroups.com
On Aug 29, 2009, at 5:44 AM, Umar Mustafa <umarm...@gmail.com> wrote:

> I couldn't fix the mxjar problem. After a lot of hitting and trying, I
> got it compiled manually using Flex's mxmlc command.

Interesting; do you remember what exactly you did to compile it?

Cheers,
Ron

Umar Mustafa

unread,
Aug 29, 2009, 5:28:59 PM8/29/09
to Hemlock
Hi Ron,

I looked into the command in the Rakefile which was being executed for
the compilation, and I compiled DrawingDemoContainer.as manually using
the mxmlc command in the command prompt.

Here's the command:

mxmlc -compiler.source-path=D:\Hemlock\src\ -compiler.include-
libraries=D:\Hemlock\bin\HemlockCore.swc -
compiler.fonts.managers=flash.fonts.AFEFontManager D:\Hemlock\src\com
\mintdigital\drawingDemo\containers\DrawingDemoContainer.as

When using the command "rake hemlock:build:drawingDemo", it was saying
that it couldn't find the file D:\Flex_SDK_3\bin\mxjar
I tried searching around about the file but couldn't find out. On some
forums I found that when going from *nix to Windows, we have to change
the forward slash '/' to backslash '\'. But I don't think thats
creating any problem at my end, I tried using both slashes. I'm using
the RC release of Windows 7.

Now that I have a DrawingDemoContainer.swf, I still can't seem to run
it. The Flash policy daemon isn't running, as I've posted above. But
as ty said that its not required if I have to run it locally. So I
just started the ejabberd server and ran the app. When I click the
Register or Sign in button, it stucks at "Registering" or Signing in"
and nothing happens. Now I don't know what can be wrong.

Regards,
Umar

On Aug 29, 9:15 pm, Ron DeVera <ronald.dev...@gmail.com> wrote:

Ron DeVera

unread,
Sep 8, 2009, 9:27:56 PM9/8/09
to hem...@googlegroups.com
> mxmlc -compiler.source-path=D:\Hemlock\src\  -compiler.include-
> libraries=D:\Hemlock\bin\HemlockCore.swc -
> compiler.fonts.managers=flash.fonts.AFEFontManager D:\Hemlock\src\com
> \mintdigital\drawingDemo\containers\DrawingDemoContainer.as

Thanks! We'll work on improving the Rake task's Windows support based
on your findings.

> Now that I have a DrawingDemoContainer.swf, I still can't seem to run
> it. The Flash policy daemon isn't running, as I've posted above. But
> as ty said that its not required if I have to run it locally. So I
> just started the ejabberd server and ran the app. When I click the
> Register or Sign in button, it stucks at "Registering" or Signing in"
> and nothing happens. Now I don't know what can be wrong.

Let's try a couple of things:
- Be sure you've installed the debug version of Flash Player (not just
the version for regular users). Here's the archive for Flash 10:
http://download.macromedia.com/pub/flashplayer/updaters/10/flash_player_update3_flash10.zip
-- look inside the "Debug" folder.
- Be sure you're running DrawingDemoContainer in debug mode; compile
with `rake hemlock:build:drawingDemo[true]`. You'll know you're in
debug mode when you see DebugWidget in the lower-right corner of the
window. If you see it (green text on black background), click it to
expand it.

Set up both of these debug options, then try running
DrawingDemoContainer again. Do you get any runtime error messages?

Cheers,
Ron

Ron DeVera

unread,
Sep 8, 2009, 9:47:35 PM9/8/09
to Hemlock
> - Be sure you're running DrawingDemoContainer in debug mode; compile
> with `rake hemlock:build:drawingDemo[true]`. You'll know you're in
> debug mode when you see DebugWidget in the lower-right corner of the
> window. If you see it (green text on black background), click it to
> expand it.

To clarify, when you compile in debug mode, simply add this switch to
your custom `mxmlc` command:

-compiler.debug=true

Cheers,
Ron

Yi Tan

unread,
Sep 11, 2009, 7:56:27 AM9/11/09
to hem...@googlegroups.com
Just read the following from
http://www.senocular.com/flash/tutorials/as3withmxmlc/

It's a good article about flex compiler. Hope this will be helpful

"The real compiler is a Java jar file located in the lib directory of your Flex Builder/SDK install and not mxmlc.exe itself. Because of this, to work with the compiler you'll A) need to make sure you keep all of those files of which the compiler is dependant (i.e. dont go moving around just mxmlc.exe and expect it to work),"



Regards,

ty

Umar Mustafa

unread,
Sep 14, 2009, 3:00:18 PM9/14/09
to Hemlock
I ran it in debug mode, and here's the error I got:

Error #2044: Unhandled securityError:. text=Error #2048: Security
sandbox violation: file:///D|/Hemlock/src/com/mintdigital/drawingDemo/containers/DrawingDemoContainer.swf
cannot load data from localhost:5222.

I guess my port 5222 is blocked. Please tell me if thats the case, so
I can try to find a solution.

Umar

Ron DeVera

unread,
Sep 19, 2009, 6:13:28 PM9/19/09
to Hemlock
That's right: Hemlock uses port 5222 by default for XMPP data
transfer. You can either open this port in your firewall, or open
`config/environment.as` in your ActionScript source, and modify the
value for `HemlockEnvironment.SERVER_PORTS`. (You might need to
compile with the latest version of Hemlock in the development branch.)
For example, here's the example `environment.as` in the development
branch:

http://github.com/mintdigital/hemlock/blob/development/src/config/environment.as-example

Here, `HemlockEnvironment.SERVER_PORTS` is set to `[5222, 80]` as an
example, meaning that if the Hemlock app fails to connect to port
5222, it will retry on port 80. By default, the HemlockEnvironment
class only tries port 5222.

While you're checking firewall ports, you should also check:
- Port 5280: Ejabberd uses this port for its web admin UI (<http://
localhost:5280/admin>).
- Port 843: The default port for hosting your cross-domain policy
file. You can customize this port in your app's `config/
environment.as` by setting the value for
`HemlockEnvironment.POLICY_PORT`.

After opening these three ports and making any environment changes, do
DebugWidget or Flash Player give any other errors?

Cheers,
Ron
Reply all
Reply to author
Forward
0 new messages