cancel
Showing results for 
Search instead for 
Did you mean: 

Java Connectivity - No classes appearing in the Java Beans Classes dropdown

Former Member
0 Kudos

Hi,

VERY NEW user to Crystal Reports. I am trying to create a report using a java class as a datasource. I have updated the setting in the CRConfig.xml file, and can get the Java Beans Connectivity screen to appear, but is shows none of my classes in the dropdown. I found a knowlege base entry that indicated this problem was caused by the JavaBeansClassPath value in the CRConfig.xml file being invalid. But I've verified the location and it is pathed directly to the classes.

Not sure what I am missing, but any help is greatly appreciated.

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

There's multiple possible causes as to why this is happening:

1. The signature of the method in your Java code that returns the ResultSet is incorrect.

2. The Java class was compiled using JDK 1.5 or 1.6, that cannot be run using the default JRE 1.4.2 defined in the CRConfig.xml file.

3. Do you see java.exe start up when you try opening a JavaBeans connection? It may be that it can't find the java.exe to start the Java Server.

4. Connection is via CORBA TCP/IP connections - any firewalls?

Sincerely,

Ted Ueda

Former Member
0 Kudos

Ted,

Thanks for the reply. I checked out each of your suggestions, but haven't had any luck thus far. Here's what I found:

1. We created a simple method in an existing public class to return a ResultSet. The method looks like this:

public ResultSet GetAllMediaTypesRS()

{

String strFuncName = "ScsXDMDatabase::GetAllMediaTypesRS : ";

ScsDebug coutDebug = new ScsDebug();

String strSqlStmt;

String strMediaType;

ScsStringList sslReturnList = new ScsStringList();

//----


// Create the SQL to get all the Displayable Media Types.

//----


strSqlStmt =

"SELECT DISTINCT mt.Media_Type_Name "

+ "FROM dbo.Media_Type mt "

+ "WHERE mt.Media_Type_Rqst_Display_Ind = 1 "

+ "ORDER BY mt.Media_Type_Name";

coutDebug.println(strFuncName + "SQL Statement: " + strSqlStmt);

//----


// Run the Query

//----


Statement stmt = null;

ResultSet SQLResult = null;

try

{

stmt = GetConnection().createStatement();

SQLResult = stmt.executeQuery(strSqlStmt);

} //End of Try

catch (SQLException sqle)

{

if (sqle.getErrorCode() != 0)

{

coutDebug.println(

"Error in ExecuteQuery: "

+ "Error code - "

+ sqle.getErrorCode());

coutDebug.println("Message - " + sqle.getMessage());

}

}

return SQLResult;

}

The signature, and the method look fine to us, but maybe we are missing something obvious.

2. We do use JDK 1.5 to compile the classes, but my JavaDir setting in the CRConfig.xml file points to jre1.6.0_02. I assume this is OK.

3. We do see java.exe start up when opening the JavaBeans connection.

4. No firewall issues as we are inside our corporate network.

Any other thoughts or ideas? I did see a knowledge base entry that indicated the cause of this particular problem is that the JavaBeansClassPath in CRConfig.xml is incorrect or invalid. I've validated the path takes me right to the classes, so I believe that is OK. Is there some way that we can see the actual path that is searched when the JavaBeans connection is opened?

Thanks for your help.

--john davies

Former Member
0 Kudos

I think JavaBeans currently only supports Java JVM 1.4.2.

I do know of issues where JavaBeans compiled with JDK 1.5 didn't appear in the drop-down.

I don't know if the method has to start with get rather than Get.

You may want to run Filemon:

http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx

to ensure that the java.exe process is correctly loading your jar files.

Sincerely,

Ted Ueda