Janeva Frequently Asked Questions

Question Index

General

General questions on Janeva

  1. What is Janeva?
  2. Where can I get Janeva?
  3. Tell me more about Janeva and what it does?
  4. How do I access .NET components from CORBA using Janeva?
  5. Is it possible to access a .NET server from a Java client, besides accessing CORBA or J2EE server from a .NET client ?

Using Tools

Questions on using Janeva tools

  1. What development IDEs does Janeva support?

Setup and Configuration

Issues pertaining to setup, prerequisites, and configuring your environment to use Janeva

  1. Does Janeva require a Java VM?
  2. Do I have to install BES (Borland Enterprise Server) in order to use Janeva?
  3. How do I use WebLogic Server with Janeva?
  4. How do I use WebSphere Server with Janeva?
  5. How do I use Oracle 9i Server with Janeva?
  6. How do I enable failover when using a Visibroker naming service with clustering turned on?
  7. How does Janeva authenticate with WebLogic?

Programming

Questions regarding programming with Janeva

  1. My Java class implements the toString() method. Why doesn't Janeva use this implementation when it generates code for it?
  2. Janeva can consume JARs and IDLs, can it consume EARs?
  3. Can I use Janeva with the Naming Service (tnameserv) from J2SE 1.3? If so, how??

Runtime

Questions regarding runtime behavior and use of Janeva APIs

  1. How does Janeva handle Collections? How does Janeva handle Collections of complex types?
  2. How can Janeva be clustered, failed-over, ...? Is it IOR level?
  3. Can we do secured IIOP? via SSL? How?
  4. How does Janeva handle NULL between .Net and J2EE (eg NULL Double, dates, ...)?
  5. How do I resolve the error message "Can't Load Borland.Janeva.Runtime Type..."?
  6. When I try to access a Janeva ASP.NET Web Forms Application the controls doesn't show up. Why? ?
  7. When I try to access a Janeva ASP.NET application, I get "Server Application Unavailable" from IIS. How do I fix this?

Type Mapping

Questions related to mapping types to .NET

  1. What types are supported by the java2cs compiler?

Licensing Issues

Questions about licensing

  1. What do the different licenses let me do?
  2. How do I obtain a valid license?

Janeva NLS related issues

Questions related to localised versions of Janeva

  1. The setup scripts for ASP.NET examples in Janeva 6.0 Japanese fail?

Answers to Frequently Asked Questions

General

1. What is Janeva? Top

Borland® Janeva™ enables seamless connectivity between applications built for the Microsoft® .NET platform and those built for the J2EE™ platform or the Common Object Request Broker Architecture®(CORBA®). An ideal way to lower development and integration costs in mixed IT environments, Janeva allows client- or server-based Microsoft .NET applications to access heterogeneous J2EE and CORBA server-side components—no extra bridges, hubs, or translators are needed; no extra programming knowledge is required.

2. Where can I get Janeva? Top

Go to the Borland Janeva Web Site to download Janeva

3. Tell me more about Janeva and what it does? Top

Read this document to understand the value proposition of Janeva.

4. How do I access .NET components from CORBA using Janeva? Top

Janeva supports accessing of .NET components from CORBA. Please try out the CORBA examples from the Janeva installation. Make sure Janeva is installed and resides where your .NET components are. Please see the below link(s) for more information on Janeva.

Related questions:

5. Is it possible to access a .NET server from a Java client, besides accessing CORBA or J2EE server from a .NET client ? Top

Janeva 6 provides full, two-way interoperability. You can access CORBA- or J2EE-based servers from a .NET client, and you can also implement a server in .NET and access it from either a CORBA and/or a Java client.

Please see the examples from the Janeva installation for details and/or the below link(s) for more information on Janeva.

Related questions:

Using Tools

1. What development IDEs does Janeva support? Top

Janeva supports the following .NET IDEs:

  • Borland C#Builder
  • Microsoft Visual Studio .NET 2002
  • Microsoft Visual Studio .NET 2003

Setup and Configuration

1. Does Janeva require a Java VM? Top

The Janeva Runtime does NOT require a Java VM to run. However, java2cs is a tool that introspects on Java byte code and therefore requires the Java VM to run.

2. Do I have to install BES (Borland Enterprise Server) in order to use Janeva? Top

You don't have to install BES, unless, you want to run the Janeva examples that use the BES utililties. Janeva also comes with examples that inter-operate with WebLogic or WebSphere.

3. How do I use WebLogic Server with Janeva? Top

  • No special configuration is usually required as the RMI-over-IIOP protocol is on by default
  • If the RMI-over-IIOP protocol was turned off, turn it on as follows
    1. In the browser, open the WebLogic Administration Console at http://localhost:7001/console
    2. Login as an admin user (weblogic/weblogic by default)
    3. In the left pane of the Administration Console, expand the Servers folder
    4. Click on a server
    5. In the right pane, select the Protocols tab. Then select the IIOP tab
    6. Enable the IIOP protocol by checking the Enable IIOP check box
    7. Click Apply
    8. Restart the server
  • Janeva Client

    To be able to connect to the WebLogic Naming Service, pass the following line as initial arguments to the Janeva ORB:

                 -ORBInitRef NameService=corbaloc::localhost:7001/NameService
              

    Specify different host and port of your WebLogic server if necessary.

4. How do I use WebSphere Server with Janeva? Top

  • No special configuration is required as WebSphere enables the RMI-over-IIOP protocol by default
  • Janeva Client

    To be able to connect to the WebSphere Naming Service, pass the following line as initial arguments to the Janeva ORB

                 -ORBInitRef NameService=corbaname:iiop:localhost:2809/NameServiceServerRoot
              

    Specify different host and port of your server if necessary.

5. How do I use Oracle 9i Server with Janeva? Top

  • When running the Oracle OC4J Server, it is necessary to enable the RMI-over-IIOP protocol. For details how to do it, please refer to the online manual.
  • Janeva Client

    To be able to connect to the Oracle OC4J Naming Service, pass the following line as initial arguments to the Janeva ORB:

                -ORBInitRef NameService=corbaloc::localhost:4444/NameService
              

    Specify different host and port of your server if necessary

6. How do I enable failover when using a Visibroker naming service with clustering turned on? Top

Janeva should certainly support failover using a Visibroker NS (w/ clustering turned on).  You have to add <vbroker vbroker.naming.enableClusterFailover="true"/> to the Janeva section of the config file of your client.

7. How does Janeva authenticate with WebLogic? Top

Make sure to name your realm. The default realm that Janeva uses is "default". Make sure it matches with what WLS expecting.

In the case of WLS, the realm name exported by WLS (as shown below in the security component of the object reference):

CompoundSecMech:
Requires =
Transport =: TAG_NULL_TAG
AS Mech =: AS_ContextSec =:
target_supports =: 64
target_requires =: 0
client_authentication_mech =: 2.23.130.1.1.1
target_name =: weblogicDEFAULT

SAS Mech =: SAS_ContextSec =:
target_supports =: 0
target_requires =: 0
supported_naming_mechs = { }
supported_identity_types: {}
privilege_authorities =:

The realm is represented here by the target_name, which as you see is set to 'weblogicDEFAULT'. This appears to be the case even though the realm is named something else in your weblogic configuration . So, when specifying the realm, please use weblogicDEFAULT.

Below is a part of the Janeva config to successfully authenticate against WLS(more importantly changing the password here, successfully fails to authenticate).

<security enabled="true">
      <identity>
        <username>weblogic</username>
        <password>weblogic</password>
        <realm>weblogicDEFAULT</realm>
      </identity>
 </security>

Note: using the API should exhibit the same behavior.

Programming

1. My Java class implements the toString() method. Why doesn't Janeva use this implementation when it generates code for it? Top

Janeva makes no attempt to "port" your business logic from Java to C#.In fact, the Janeva compilers do not even keep track of what methods are defined in your value types. It is up to the user to implement a value type in C# that corresponds to the Java class and telling the compiler about it. This is typically done by specifying a hint file, and indicating the name of the C# class that corresponds to the Java class. For example:

<?xml version="1.0"?>
<!-- hint.xml -->
<hints>
  <hint>
    <java-class>acme.MyJavaClass</java-class>
    <cs-impl-type>Acme.MyCsharpClass</cs-impl-type>
    <mode>automatic</mode>
  </hint>
</hints>

You then provide this hint file to the compiler using the -hint_file command line argument. This tells the Janeva compiler name of your C# class, and indicates (through the "automatic" mode that your C# class has members or properties corresponding to the field names on your Java object.

You can alternately use the "custom" mapping mode if your C# object has different method names/types from your Java object.

NOTE: that you must implement the Acme.MyCsharpClass and include it in your project. Otherwise, the generated code will not compile, as it refers to this type.

The Janeva compiler will not transfer any user logic from the original Java type to the C# type. This must be done by you.

2. Janeva can consume JARs and IDLs, can it consume EARs? Top

Yes. It consumes .idl, .class, .jar and .ear files. When consuming JAR and EAR files, it can either code gen for all specified classes, or it can introspect through the archive and code gen for all datatypes that are Serializable or Externalizable. E.g., it can automatically locate and code gen for anything that the J2EE server is capable of returning.

3. Can I use Janeva with the Naming Service (tnameserv) from J2SE 1.3? If so, how?? Top

The J2SE 1.3 Naming Service is not compliant with the CORBA 2.3 specifications and hence needs special handling. Janeva 6.5 has support for the J2SE 1.3 Naming Service. Prior releases of Janeva will not work with that version of the Naming Service. In order to use the JDK 1.3 Naming Service, you will have to take into consideration the following:

  • The corbaloc URL to use for the naming service is special cased to have the key tnameserv instead of NameService.
  • The J2SE 1.3 Naming Service does not negotiate CodeSets correctly. So, Janeva must be instructed to account for it.
  • The J2SE 1.3 Naming Service supports only the CosNaming.NamingContext interface and not the CosNaming.NamingContextExt interface. So, you can use only the NamingContext interface to communicate with it.

If you were using a configuration file, the entries to support the J2SE Naming Service will look like:

   <janeva>
     <naming url="corbaloc::localhost:900/tnameserv"/>
     <vbroker vbroker.orb.negotiateCodeSet="false"/>
   </janeva>

And of course, you will have to program to the CosNaming.NamingContext interface

Runtime

1. How does Janeva handle Collections? How does Janeva handle Collections of complex types? Top

Janeva has very comprehensive support for collections. And note that we map from the .NET collection types to the Java collection types automatically. So, if a J2EE component returns an instance of java.util.HashMap, it is transparently converted to an instance of System.Collections.Hashtable. We currently support a very large set of JDK/.NET types, including all collection types (even inner collection types).

2. How can Janeva be clustered, failed-over, ...? Is it IOR level? Top

Janeva has a full implementation of Visibroker under the covers, so any clustering/fail-over that can be done in Visibroker can be done in Janeva. At present, these capabilities are limited to interactions with the Borland Enterprise Server, as each Application Server does this a little differently.

3. Can we do secured IIOP? via SSL? How? Top

Not yet. Security will be supported in a future release very soon.

4. How does Janeva handle NULL between .Net and J2EE (eg NULL Double, dates, ...)? Top

NULL handling is important when getting data sets from RDBMS via J2EE when the data can be NULL.This works quite nicely in Janeva.

The following simple examples will illustrate Janeva's support for nulls.

There are two ways that nulls might need to be mapped from Java to .NET (and vice versa). Let's say that in Java, if I create an instance of java.util.ArrayList, and put three elements into it.

  • the string "hi"
  • the double 3.14 (e.g., new Double(3.14))
  • a null

In C# (or any other .NET language) I will receive an instance of System.Collections.ArrayList containing:

  • the string "hi"
  • the double 3.14 (note that this is not the wrapper type Double, but the .NET valuetype "double".)
  • a null

So, you can see we fully support nulls as the contents of collection types, etc. This makes for a very .NET friendly mapping, when using collection-valued types, etc. In fact, it makes using collections much easier in .NET than it is in Java (where one has to keep converting back and forth between the real types, such as "double", and the wrapper types, such as "java.lang.Double").

Things are done a little differently when there is a method (defined in Java) that returns a type that is optionally null (e.g., java.lang.Double). Let's say I have such a type in a Java signature:

    java.lang.Double getValue();
    

In C#, this would correspond to the following signature:

    J2EE.Lang.Double GetValue();
    

The type J2EE.Lang.Double is a type that Janeva introduces for the purpose of representing a value that is either null or a double. If the value is null, then the returned value is null (as you would expect). If the valuie is not null, then we return a non-null value of J2EE.Lang.Double, which can then be assigned to a double. So, I can do this:

    J2EE.Lang.Double doubleWrapper = obj.GetValue();
    if(doubleWrapper == null) {
        // handle null case
    }
    else {
        double doubleValue = doubleWrapper;
        // handle non null case
    }
    

Or, if you are confident that the value returned is never null (which is often the case) you can simply do this:

    double doubleValue = obj.GetValue();
    

This will actually throw a System.NullReferenceException is the returned value is null. So another way to write the above (particularly if null values are rare) is:

    try {
        double doubleValue = obj.GetValue();
        // handle non null case
    }
    catch(NullReferenceException) {
        // handle null case
    }
    

5. How do I resolve the error message "Can't Load Borland.Janeva.Runtime Type..."? Top

The problem here is that .NET is not able to find the assembly in question, the Borland.Janeva.Runtime DLL. There are two ways to resolve the problem.

a) Use local reference to an assembly. Copy the Borland.Janeva.Runtime.dll to the bin directory of your web app. Please make sure that the <configSections> in your config file has the reference to Borland.Janeva.Runtime DLL file. See below

<!-- Enable Janeva configuration section. -->
<configSections>
  <section name="janeva" type="Janeva.Settings, Borland.Janeva.Runtime"/>
</configSections>

OR

b) Use strongly named reference to an assembly. In this case, you will need to use the 'full name' of the assembly in your config file, that is, the <configSections> in the config file. See below. The full name for Borland.Janeva.Runtime.dll, for example, of version 6.0.0.20 is "Borland.Janeva.Runtime, Version=6.0.0.20, Culture=neutral, PublicKeyToken=f451cb1407ec555e".

<!-- Enable Janeva configuration section. -->
<configSections>
  <section name="janeva" type="Janeva.Settings, Borland.Janeva.Runtime,
    Version=6.0.0.20, Culture=neutral, PublicKeyToken=f451cb1407ec555e"/>
</configSections>

NOTES:

(1) Janeva assemblies are strongly named and are registered in the GAC.

(2) You can use the .NET tool ildasm.exe on the Borland.Janeva.BES.dll assembly, that is, 'ildasm Borland.Janeva.BES.dll', to get the 'Version' and 'PublicKeyToken' of the Borland.Janeva.Runtime.dll assembly. (The assembly Borland.Janeva.BES.dll references the assembly Borland.Janeva.Runtime.dll.) Once the ildasm GUI is displayed, double-click on the 'MANIFEST' section, and you will see the below. Again, this is an example of the Janeva 6.0.0.20 release.

.assembly extern Borland.Janeva.Runtime
{
  .publickeytoken = (F4 51 CB 14 07 EC 55 5E )   // .Q....U^
  .ver 6:0:0:20
}

6. When I try to access a Janeva ASP.NET Web Forms Application the controls doesn't show up. Why? ? Top

Most likely reason for this error is ASP.NET not being registered with IIS. Run the command "aspnet_regiis -i".This tool ships with the .NET framework.

7. When I try to access a Janeva ASP.NET application, I get "Server Application Unavailable" from IIS. How do I fix this? Top

There is a bug in on Windows XP platforms with .NET 1.0 which needs a simple patch. See Knowledge Base Article ID 827641 for details.

Type Mapping

1. What types are supported by the java2cs compiler? Top

The java2cs compiler supports all types that are supported by RMI, J2EE, etc. That is, it supports all serializable and all remotable types in Java (plus all primitives, and arrays of all supported types, which are implicitly serializable), which is all that is accessible from remote clients (whether via Janeva or from any other client, including Java clients).

Licensing Issues

1. What do the different licenses let me do? Top

The Janeva developer license is currently free of charge but users must register with Borland to acquire a license. More details on our licensing model can be found at http://info.borland.com/new/janeva/key.html. Once there, click on the version you want. Then click on the "Getting started" then the "Licensing" link.

2. How do I obtain a valid license? Top

To activate the product and develop applications using Janeva, you will need to register the product and obtain a license activation file. The following steps describe this process:

  1. Visit http://info.borland.com/new/janeva/key.html and register your copy of Janeva. (You will be reminded of this URL at the conclusion of the Borland Janeva installation.)
  2. You will promptly receive an email from Borland with the subject "Borland Product Registration." Attached to the email as a .txt file is the activation key required to fully enable your installation of Janeva.
  3. IMPORTANT NOTE: You must change the name of the file to borland.txt which is different than the filename on the file you will receive.
  4. Save the activation file with the new filename borland.txt to the directory in which you installed Janeva. If you did not change it, the default location is C:\Program Files\Borland\Janeva.

Deployment License

You must purchase deployment licenses from Borland prior to deploying Borland Janeva.

Janeva NLS related issues

1. The setup scripts for ASP.NET examples in Janeva 6.0 Japanese fail? Top

This is a bug in the Japanese version of these scripts. There is one string in the scripts that needs to be localized, but is not. To fix this problem, replace the text "Default Web Site" in the line:

    set webSite = findWeb("localhost", "Default Web Site")
with the appropriate equivalent string in Japanese. This string can be located using the Internet Services Manager (Control Panel/Administrative Tools) under the local host node.