You are viewing a plain text version of this content. The canonical link for it is here.
Posted to juice-dev@xml.apache.org by "Dittmann, Werner" <we...@siemens.com> on 2006/02/13 14:05:59 UTC

Problems to setup Juice with Windows

All,

to get Juice running on Windows I need some help from Windows / Java
gurus.

The tests with a first version of Juice on Linux where successful. I
tried to bring Juice onto a Windows Box as well, but I encoutered a
strange problem. Here is what I did:

- using cygwin I was able to setup the autoconf stuff, create a
  configure script, and compiled the native sources into a DLL. Before
  the compile was sucessful I copied the files "jni.h" and "jni_md.h"
  from the Java include directory to /usr/include of cygwin. Then I
  changed the "typedef __int64 jlong" to "typedef long long jint" to
  be compliant with gcc.

- after creating the shared lib I extended PATH to point to the lib's
  directory and started a test. During System.load("openSSL4Java") I
  got no problems.

Then I got an internal JVM error. See the code snippet that
initializes the whole stuff (extracted from
JCEBlockCipherOpenSSL.java):

....
static {
    try {
        System.loadLibrary("openSSL4Java");
    } catch (SecurityException se) {
        openSSLLoaded = false;
        if (log.isFatalEnabled()) {
            log.fatal("Security Exception while loading native
library.", se);
        }
    } catch (UnsatisfiedLinkError le) {
        openSSLLoaded = false;
        if (log.isFatalEnabled()) {
            log.fatal("Unsatisfied Linke error while loading native
library.", le);
        }
    }
    if (openSSLLoaded) {
        openSSL4Ready = InitializeOpenSSL.initialize();
    }
}
...

The error happens during the call
"InitializeOpenSSL.initialize()". Note that InitializeOpenSSL is a
java class, not part of the shared lib. At that point in time no
method of the shared lib was called from Juice's java code (except
maybe internally during loading the lib).

Here is the error text:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d71ac12, pid=4008,
tid=1380
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_03-b07 mixed mode)
# Problematic frame:
# V  [jvm.dll+0x6ac12]
#
# An error report file with more information is saved as
hs_err_pid4008.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

I already tried to rename some methods and files because I thought the
problem is because of name clashes or so - but no success.

A more detailled info (the detailled error log) can be provided if
necessary. All sources are in the SVN, also a signed juice.jar in the
dist directory.

Any ideas? Any help is appreciated.

Regards,
Werner

---------------------------------------------------------------------
To unsubscribe, e-mail: juice-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: juice-dev-help@xml.apache.org


Re: Problems to setup Juice with Windows

Posted by Raul Benito <ra...@apache.org>.
I have compiled a long ago the juice dll for windows using mingw. It
has work OK, after changing the jni*.h like you do.
I don't have access to my environment, but perhaps you can try with mingw....

Regards,

Raul

On 2/13/06, Scott Cantor <ca...@osu.edu> wrote:
> > - using cygwin I was able to setup the autoconf stuff, create a
> >   configure script, and compiled the native sources into a DLL. Before
> >   the compile was sucessful I copied the files "jni.h" and "jni_md.h"
> >   from the Java include directory to /usr/include of cygwin. Then I
> >   changed the "typedef __int64 jlong" to "typedef long long jint" to
> >   be compliant with gcc.
>
> Is cygwin the way people would want to use this? I somehow doubt it. Most
> people on Windows don't wish to pull in the cygwin DLLs, they want proper
> Windows builds.
>
> > Any ideas? Any help is appreciated.
>
> Regardless of the previous point, is there actual proof that the JVM can
> load native code built with cygwin? Maybe it just works, but I'd try and
> verify that independently before I went looking for root causes.
>
> -- Scott
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: juice-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: juice-dev-help@xml.apache.org
>
>


--
http://r-bg.com

---------------------------------------------------------------------
To unsubscribe, e-mail: juice-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: juice-dev-help@xml.apache.org


Re: Problems to setup Juice with Windows

Posted by Berin Lautenbach <be...@wingsofhermes.org>.
Having played with getting things running under Cygwin - I think I'd 
tend to agree with Scott.  It adds some extra complications into the 
build/run process that could well trip you up.

Is it possible to get the stuff to compile on VC++?  Are you open for me 
to have a look to see if I can get it up and running?

Cheers,
	Berin

Scott Cantor wrote:
>>- using cygwin I was able to setup the autoconf stuff, create a
>>  configure script, and compiled the native sources into a DLL. Before
>>  the compile was sucessful I copied the files "jni.h" and "jni_md.h"
>>  from the Java include directory to /usr/include of cygwin. Then I
>>  changed the "typedef __int64 jlong" to "typedef long long jint" to
>>  be compliant with gcc.
> 
> 
> Is cygwin the way people would want to use this? I somehow doubt it. Most
> people on Windows don't wish to pull in the cygwin DLLs, they want proper
> Windows builds.
> 
> 
>>Any ideas? Any help is appreciated.
> 
> 
> Regardless of the previous point, is there actual proof that the JVM can
> load native code built with cygwin? Maybe it just works, but I'd try and
> verify that independently before I went looking for root causes.
> 
> -- Scott
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: juice-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: juice-dev-help@xml.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: juice-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: juice-dev-help@xml.apache.org


RE: Problems to setup Juice with Windows

Posted by Scott Cantor <ca...@osu.edu>.
> - using cygwin I was able to setup the autoconf stuff, create a
>   configure script, and compiled the native sources into a DLL. Before
>   the compile was sucessful I copied the files "jni.h" and "jni_md.h"
>   from the Java include directory to /usr/include of cygwin. Then I
>   changed the "typedef __int64 jlong" to "typedef long long jint" to
>   be compliant with gcc.

Is cygwin the way people would want to use this? I somehow doubt it. Most
people on Windows don't wish to pull in the cygwin DLLs, they want proper
Windows builds.

> Any ideas? Any help is appreciated.

Regardless of the previous point, is there actual proof that the JVM can
load native code built with cygwin? Maybe it just works, but I'd try and
verify that independently before I went looking for root causes.

-- Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: juice-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: juice-dev-help@xml.apache.org