JNBridge configuration problem with .NET

User c9f8286385

04-04-2007 10:14:59

hi all,


We are facing some configuration problems of JNBridge with .NET 2.0


The downloaded files are:


1) marvin4.1.6_JnbProxies_2.0.dll


2) jnbrt_3_0.zip


We are able to import marvin libraries in .NET. But, can not instatiate MSketch.





Exception: "The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception." at mSketch = new MSketchAdapter();





Also, there is a .config warning:


Could not find schema information for the element 'jnbridge'





Please suggest the solution. Thanks in adv.

ChemAxon aa7c50abf8

04-04-2007 11:09:02

Please, could you post the content of your .config file?

User c9f8286385

04-04-2007 11:35:15

<configuration>


<configSections>


<sectionGroup name="jnbridge">


<section name="dotNetToJavaConfig"


type="System.Configuration.SingleTagSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />


</sectionGroup>


</configSections>





<jnbridge>


<dotNetToJavaConfig


scheme="sharedmem"


jvm="C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll"


jnbcore="jnbcore.jar"


bcel="bcel-5.1-jnbridge.jar"


classpath="jnbtools.jar;MarvinBeans.jar"/>


</jnbridge>


</configuration>

ChemAxon aa7c50abf8

04-04-2007 13:13:31

Do you get, perhaps, an error message dialog box with a "Details" button? If so, please, could you copy and paste here what's in the expanded Details panel of the error dialog box?





Thanks


Peter

ChemAxon aa7c50abf8

04-04-2007 18:39:58

Also, I suggest to copy the jawt.dll from your Java installation into the current directory of the GUI application.





Let me know if this helps.





Peter

User c9f8286385

05-04-2007 05:37:50

Sir, Thanks for quick response.


We have already imported jawt.dll in AppDomain. But, It doesn't work.





Problem is more about .config file.


<jnbridge>


<dotNetToJavaConfig


scheme="sharedmem"


jvm="C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll"


jnbcore="jnbcore.jar"


bcel="bcel-5.1-jnbridge.jar"


classpath="jnbtools.jar;MarvinBeans.jar"/>


</jnbridge>





Problem is:


"Could not find schema information for element/attribute - jnbridge, dotNetToJavaConfig, jvm, jnbcore, bcel, classpath"





Should there be any schema information file for the configuration settings?

ChemAxon aa7c50abf8

05-04-2007 06:14:32

You can ignore the warning about the config file.





Please extract the InnerException from the TypeInitializationException and post it. (If the InnerException is also a TypeInitializationException, continue down the chain until you get an exception that isn't.) Please, post the InnerException's type, message, and stack trace.





Thanks


Peter

User c9f8286385

05-04-2007 07:32:57

System.TypeInitializationException: {"The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception."}


InnerException: {"The type initializer for 'com.jnbridge.jnbcore.ObjectHelper' threw an exception."}


Data: {System.Collections.ListDictionaryInternal}


InnerException: {"The type initializer for 'com.jnbridge.jnbproxy.JavaSides' threw an exception."}


Message: "The type initializer for 'com.jnbridge.jnbcore.ObjectHelper' threw an exception."


Source: "JNBShare"


TypeName: "com.jnbridge.jnbcore.ObjectWrapper"


TargetSite: {Void .ctor()}


StackTrace: " at com.jnbridge.jnbcore.ObjectWrapper..cctor()"


at com.jnbridge.jnbcore.ObjectWrapper..ctor()


at java.lang.Object..ctor()


at java.awt.Component..ctor()


at java.awt.Container..ctor()


at java.awt.Window..ctor()


at java.awt.Frame..ctor()


at javax.swing.JFrame..ctor()


at chemaxon.marvin.jnbadapters.MSketchAdapter..ctor()


at MSketchApp.MSketchControl.getMSketch() in C:\Documents and Settings\snaik\My Documents\Visual Studio 2005\Projects\MSketchApp\MSketchApp\MSketchControl.cs:line 111


at MSketchApp.MSketchControl.OnPaint(PaintEventArgs e) in C:\Documents and Settings\snaik\My Documents\Visual Studio 2005\Projects\MSketchApp\MSketchApp\MSketchControl.cs:line 93


at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)


at System.Windows.Forms.Control.WmPaint(Message& m)


at System.Windows.Forms.Control.WndProc(Message& m)


at System.Windows.Forms.ScrollableControl.WndProc(Message& m)


at System.Windows.Forms.ContainerControl.WndProc(Message& m)


at System.Windows.Forms.UserControl.WndProc(Message& m)


at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)


at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)


at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)


at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)


at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)


at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)


at System.Windows.Forms.Application.Run(Form mainForm)


at MSketchApp.Program.Main() in C:\Documents and Settings\snaik\My Documents\Visual Studio 2005\Projects\MSketchApp\MSketchApp\Program.cs:line 38


at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)


at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)


at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()


at System.Threading.ThreadHelper.ThreadStart_Context(Object state)


at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)


at System.Threading.ThreadHelper.ThreadStart()

ChemAxon aa7c50abf8

05-04-2007 07:50:09

From all what I can see here the InnerException is a type initializer exception again. Is this correct? If so, please, could you retrieve the InnerExceptions recursively, until you find one which is not a TypeInitializationException and post the name, message and stack trace of that non-TypeInitializationException exception.





Thanks


Peter

User c9f8286385

05-04-2007 12:29:56

Sir,


Please find the attached image file of exception snapshot.


It contains actual problem that we are facing, while instantiating MSketch.


MSketchAdapter mSketch = new MSketchAdapter();





The bottom 3rd line of image of StackTrace is huge. We have already put it in forum.

ChemAxon aa7c50abf8

05-04-2007 12:45:38

Where does this jpg come from?

ChemAxon aa7c50abf8

05-04-2007 16:25:04

Please, could you place a try/catch block around the line where the exception occurs (e.g. MSketchControl.cs:line 111). Make the catch block look like:





Code:
            catch (TypeInitializationException tie)


            {


                Exception excp = tie.InnerException;


                while (excp.GetType().Equals(typeof(TypeInitializationException)))


                {


                    excp = ((TypeInitializationException)excp).InnerException;


                }


                TextBox tb = new TextBox();


                tb.Size = new Size(200, 200);


                tb.Multiline = true;


                tb.WordWrap = false;


                tb.Text =


                    "TYPE:\r\n" + excp.GetType()


                        + "\r\nMESSAGE:\r\n" + excp.Message


                        + "\r\nSTACK TRACE:\r\n" + excp.StackTrace;


                Form f = new Form();


                f.Controls.Add(tb);


                f.ShowDialog();


            }


.


Please, run your application again, copy the text from the dialog box which pops up for the exception and paste it here.

User c9f8286385

06-04-2007 04:14:43

TYPE:


System.ApplicationException





MESSAGE:


.NET-side configuration information is missing.


Should be in application configuration file, jnbproxy.config, or supplied programmatically.


See the Users' Guide for more information.





STACK TRACE:


at com.jnbridge.jnbproxy.JNBRemotingConfiguration.Configure()


at com.jnbridge.jnbproxy.JavaSides..cctor()





We don't have config file named "jnbproxy.config". Is it mandatory?


If yes, what will be its content?

ChemAxon aa7c50abf8

06-04-2007 06:23:28

Quote:
We don't have config file named "jnbproxy.config". Is it mandatory?
You shouldn't need it. I guess the authors simply forgot to update this error message from earlier JNBridge versions where "jnbproxy.config" was the default configuration file.





I would speculate that the application cannot find the <application-name>.exec.config file. Are you sure it is in the current working directory of the application? If you're starting the application from within an IDE, chances are that the current working directory is not where you would naively think it is (i.e. not in the source directory). For example, if you use Visual Studio, the working directory is, I believe, Projects\<appname>\<appname>\bin\Debug or Projects\<appname>\<appname>\bin\Release depending on whether your run the application in Debug mode or not. The safest way to determine the current working is to have the application display it. Are you capable to work out how to display the current working directory in a .NET application, or should I provide sample code for that as well?

User c9f8286385

06-04-2007 10:35:19

Thanx it worked...


But still problem is coming during initialization.





"Your proxies were generated with an SE-licensed proxy generator. They cannot be used with an EE-licensed runtime."





Does it mean that i need to change my JRE version?


If so, can you give me the link of exact java installation version?


We are currently using jdk1.6.0.

ChemAxon aa7c50abf8

06-04-2007 10:52:25

Quote:
Does it mean that i need to change my JRE version?
Not at all. You have to change the JNBridge runtime from EE mode to SE mode.





Try starting the registration tool attached to this posting. It should allow you to toggle between EE and SE mode during the evaluation period. Let me know if it works.

User c9f8286385

06-04-2007 11:18:46

Yes. Finally it's done!!! thanks a lot Peter. u r gr8 :)


Here, I would like to mention my mistake. I had given path of jvm.dll in client folder, since server folder wasn't there. But, It should be from server folder only.





Thanks


Swapnil Naik


IGKV


User 466e5a6816

13-09-2007 12:29:29

Hello Group ,


Please help us , we are trying to use marvin tool in .Net we are getting following runtime exception :





1 . The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception.





2. jInN.javacomponent : Class Not Found Exception





please experts tell us how to solve these problems


Waiting for your reply ASAP.

User 466e5a6816

13-09-2007 12:30:30

Hello Group ,


Please help us , we are trying to use marvin tool in .Net we are getting following runtime exception :





1 . The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception.





2. jInN.javacomponent : Class Not Found Exception





please experts tell us how to solve these problems


Waiting for your reply ASAP.

ChemAxon aa7c50abf8

13-09-2007 15:07:43

ashishshukla38 wrote:
Hello Group ,


Please help us , we are trying to use marvin tool in .Net we are getting following runtime exception :





1 . The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception.





2. jInN.javacomponent : Class Not Found Exception





please experts tell us how to solve these problems


Waiting for your reply ASAP.
What do you mean by "marvin tool"?





Have you managed to setup the MSketch sample application with JNBridge (in examples\ChemAxon.NET\GUI\MSketchApp) and make it work?

User 466e5a6816

14-09-2007 06:58:42

Hi,





Yes, wee tried to setup MSketch Sample application with JNBridge ..





But It is giving run time error :





"The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception."





The above exception screen is attached with this reply..





Another probem is with example given in JNBridge examples named J_IN_N_Embeding , in this example we are getting run time exception :





"Class Not Found Exception was unhandeled."


jInN.JavaComponent








This exception screen is also attached with reply.





Please see the details and if possible help me.





Thanks.

User 466e5a6816

14-09-2007 07:13:57

Hi,


This is detailed exception info about above two example.

ChemAxon aa7c50abf8

14-09-2007 09:27:00

Hi,
Quote:
"The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception."





The above exception screen is attached with this reply..
Please, do what the error message says: "Check the InnerException property for more information".
Quote:
Another probem is with example given in JNBridge examples named J_IN_N_Embeding , in this example we are getting run time exception :





"Class Not Found Exception was unhandeled."


jInN.JavaComponent
We support JNBridge only in the context of integrating ChemAxon products with it. We don't support unrelated products/samples.

User 50e1572e8c

09-04-2013 12:39:25

The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception.

ChemAxon bd13b5bd77

09-04-2013 22:23:34

As far as I know jnBridge is not supported anymore. Company switched to ikvm java dotnet compilation.