Q: Is it possible to build 32-bit proxy (w/proxygen) on x64 Windows?

876 views
Skip to first unread message

Michael Zarlenga

unread,
May 27, 2013, 7:11:15 PM5/27/13
to jni...@googlegroups.com
We deploy and run an x86 JVM even on x64 systems.

I'm running into a roadblock where proxygen reports an error when JAVA_HOME points to our deployed 32-bit JVM:

 jni4net.proxygen - Copyright (C) 2009 Pavel Savara - licensed under GPLv3
 
  net.sf.jni4net.jni.JNIException: Can't initialize jni4net. (32bit vs 64bit JVM vs CLR ?)
  CLR architecture: 64bit
  JAVA_HOME: C:\Program Files (x86)\Java\jre6 ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)


Is it possible to direct proxygen to build for x86 instead of x64?

Pavel Šavara

unread,
May 28, 2013, 3:34:59 AM5/28/13
to jni...@googlegroups.com
corflags bin\proxygen.exe /32BIT+ /force




--
--
You received this message because you are subscribed to jni...@googlegroups.com
http://groups.google.com/group/jni4net?hl=en-GB?hl=en-GB
http://jni4net.sf.net/
 
---
You received this message because you are subscribed to the Google Groups "jni4net" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jni4net+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Zarlenga

unread,
May 28, 2013, 12:00:08 PM5/28/13
to jni...@googlegroups.com

> corflags bin\proxygen.exe /32BIT+ /force
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

corflags : warning CF011 : The specified file is strong name signed.  Using /Force will invalidate the signature of this
 image and will require the assembly to be resigned.

Michael Zarlenga

unread,
May 28, 2013, 12:01:27 PM5/28/13
to jni...@googlegroups.com
Ignoring the error reported by CorFlags for now, it appears to have worked ... still testing ... thank you!

Michael Zarlenga

unread,
May 28, 2013, 3:49:22 PM5/28/13
to jni...@googlegroups.com
The modified proxygen.exe (corflags bin\proxygen.exe /32BIT+ /force) runs without error however, my java test code throws the following exception on the
execution of Bridge.LoadAndRegisterAssemblyFrom(new java.io.File("IclNativeNew.j4n.dll"));

Exception in thread "main" System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Assembly.GetTypes()
   at net.sf.jni4net.utils.Registry.RegisterAssembly(Assembly assembly, Boolean bindJVM, ClassLoader classLoader)
   at net.sf.jni4net.Bridge.RegisterAssembly(Assembly assembly, ClassLoader classLoader)
   at net.sf.jni4net.Bridge.LoadAndRegisterAssemblyFromClassLoader(File assemblyFile, ClassLoader classLoader)
   at net.sf.jni4net.Bridge.LoadAndRegisterAssemblyFrom(File assemblyFile)
   at net.sf.jni4net.__Bridge.LoadAndRegisterAssemblyFrom3(IntPtr __envp, JniLocalHandle __class, JniLocalHandle assembl
yFile)
        at net.sf.jni4net.Bridge.LoadAndRegisterAssemblyFrom(Native Method)
        at TestIclNativeNew.main(TestIclNativeNew.java:19)

The C# project that generates the .dll is being built for Platform target: x86.

Michael Zarlenga

unread,
May 28, 2013, 3:51:14 PM5/28/13
to jni...@googlegroups.com
And java -version reports the correct JVM: 1.6 32-bit

> java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode)
Reply all
Reply to author
Forward
0 new messages