This section describes common errors you may experience during execution.
Sybase CEP Studio produces an error similar to:
In workspace 'Default', top module 'PassThrough': Error: Cannot find user_output_c8adapter_initialize in library sdk_adapter_lib. Error C8_SERVER-3601: Module 'Default/PassThrough/PassThrough_SDKOutputTutorialCsvFileAdapter' execution failed.
This means that Sybase CEP Server cannot find the entry point in the adapter library. This error also is printed in the Sybase CEP Server log. Please review the following questions to see if any of them might be causing your problem.
Has the library been copied to the bin subdirectory of the Sybase CEP Server directory?
Is the entry point name spelled correctly? These names are case sensitive.
Are you debugging with Visual Studio? If so, the debug and release versions may be in different directories.
Have you copied the adapter files to the correct plugins directories?
Have you copied the adapter library files to the correct bin directory?
Note also that the API is in C, not C++, so make sure that the user routines have been properly externed.
You get an error message similar to one of the following:
Error: Function or library not found (function_name='my_initialize_func', library_name='my_managed_adapter_lib')').
Error: Cannot find my_initialize_func in library MyManagedInputAdapter.
Error: Failed to start program (program_path=
'C:/Documents and Settings/jsmith/My Documents/SybaseC8Repository/5.2.0/ccx/Default_SDKDemo.ccx',
reason='Request processing failed: Server returned: Exception Error C8_SERVER-4404: Could not execute register command on container 'http://localhost:6789/Container'. Request processing failed: Server returned: Sender Invalid Request: Error parsing XML: Error: Function or library not found. Library: avgbool Function: avgbool.Error C8_SERVER-4101: Could not execute register command for workspace 'Default'.', server='http://localhost:6789/', workspace_name='Default')
Errors: 1----- ERROR: Module 'SDKDemo' in workspace 'Default' was not started (05/09/06 09:27:29) -----
Possible causes include:
Your .adl file might not specify the same library name and function name as the .dll/.so file use.
The case (for example, upper case vs. lower case) for the C function in the C-language source file might not match the case of the name in the .adl file.
You may not have copied the .dll/.so file to the correct directory. Copy it to the bin directory of the server, for example,
C:\Program Files\SybaseC8\Server\bin
or
/home/<userID>/sybasec8/server/bin
Your .udf file might not specify the same library name and function name as what the .dll/.so file uses.
The "case" (for example, upper case vs. lower case) for the C function in the C-language source file might not match the case of the name in the UDF file. In your UDF file, look for a line similar to:
Function Name="weightedAvg3"
and make sure that the name there matches the name of the function in the C source code.
You may have omitted the "extern C" section of your C file, which specifies that the function names should be externally visible. You should have a section similar to the following:
extern "C" { USER_FUNCTION_EXPORT void my_func(C8Udf* ctx); }; // extern "C"
If you will be compiling and executing on both Microsoft Windows and other platforms, your section should look more like the following:
// Ensure functions are "exported" properly from dll. #if defined(_MSC_VER) #define USER_ADAPTER_EXPORT __declspec( dllexport ) #else // defined(_MSC_VER) #define USER_ADAPTER_EXPORT #endif // defined(_MSC_VER) // forward declarations of callback functions for the // in-process adapter #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ USER_ADAPTER_EXPORT C8Bool initialize(C8Adapter *adapter_ptr); USER_ADAPTER_EXPORT C8Bool execute(C8Adapter *adapter_ptr); USER_ADAPTER_EXPORT void shutdown(C8Adapter *adapter_ptr); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */
You are using a UDF that you compiled on Microsoft Windows and you see an error message similar to the following:
Error: failed to start program
(program_path='C:/Documents and Settings/<username>/My Documents/SybaseCEPRepository/5.2.0/UserDefinedAggregators/Xconcat/xconcat.ccx',
reason='Request processing failed: Server returned: Exception Error C8_SERVER-4404: Could not execute a command in container 'http://<nodename>:<port>/Container'.
Request processing failed: Server returned: Client Invalid Request: Error parsing XML: Error: Can not load library 'xconcat' with path 'C:/Program Files/SybaseC8/Server/bin\xconcat.dll'. (nspr_error='error 126', system_error='The operation completed successfully. ').
Error C8_SERVER-4101: Could not execute loader command for workspace 'Default'.', server='http://localhost:<port>/', workspace_name='Default')
Possible causes include:
You may not have put the .dll file into the server bin directory.
When you compile your .dll file, you may have turned on debugging. As a result, your .dll may reference the debug version of the C runtime library (for example, MSVCR8D.dll) rather than the non-debug version (for example, MSVCR8.dll). If you don't have a copy of the referenced file, you'll get this error.
You may have compiled your UDF with project settings that indicate that you want your .dll file to use functions in MFC (Microsoft Foundation Classes).
Possible solutions:
Put the .dll file into the server bin directory.
Turn off debugging. In the Microsoft Visual C compiler, you can turn off debugging by performing the following steps:
Check whether you're using the debug version of the run-time library.
Build->Project->Properties-
Click on "C/C++".
Click on "Code Generation".
For the Runtime library, you should have
"Multi-threaded DLL (/MDd)".
If you see "Multi-threaded Debug DLL (/MDd)", then switch to
the non-debug version, which "Multi-threaded DLL (/MDd)"
Check the preprocessor settings
Click on "Preprocessor".
In the Preprocessor Definitions section, you will probably see
"WIN32;_WINDOWS;_DEBUG;_USRDLL".
Remove "_DEBUG;".
You may need to modify or re-create your project and specify that you want to create a DLL that does not depend upon the Microsoft Foundation Classes.
Rebuild the .dll, copy it to the server bin directory then stop and restart the server.
You are using an in-process adapter that you compiled on Microsoft Windows and you see an error message similar to the following:
Error: failed to start program
(program_path='C:/Documents and Settings/<username>/My Documents/SybaseCEPRepository/5.2.0/UserDefinedAggregators/Xconcat/xconcat.ccx',
reason='Request processing failed: Server returned: Exception Error C8_SERVER-4404: Could not execute a command in container 'http://<nodename>:<port>/Container'.
Request processing failed: Server returned: Client Invalid Request: Error parsing XML: Error: Can not load library 'xconcat' with path 'C:/Program Files/SybaseC8/Server/bin\xconcat.dll'. (nspr_error='error 126', system_error='The operation completed successfully. ').
Error C8_SERVER-4101: Could not execute loader command for workspace 'Default'.', server='http://localhost:<port>/', workspace_name='Default')
Possible causes include:
You may not have put the .dll file into the server bin directory.
When you compile your .dll file, you may have turned on debugging. As a result, your .dll may reference the debug version of the C runtime library (for example, MSVCR8D.dll) rather than the non-debug version (for example, MSVCR8.dll - note the missing "D" before the period). If you don't have a copy of the referenced file, you'll get this error.
You may have compiled with project settings that indicate that you want your .dll file to use functions in MFC (Microsoft Foundation Classes).
Possible solutions:
Put the .dll file into the server bin directory.
Turn off debugging. In the Microsoft Visual C compiler, you can turn off debugging by performing the following steps:
Check whether you're using the debug version of the run-time library.
Build->Project->Properties-
Click on "C/C++".
Click on "Code Generation".
For the Runtime library, you should have
"Multi-threaded DLL (/MDd)".
If you see "Multi-threaded Debug DLL (/MDd)", then switch to
the non-debug version, which is "Multi-threaded DLL (/MDd)"
Check the preprocessor settings
Click on "Preprocessor".
In the Preprocessor Definitions section, you will probably see
"WIN32;_WINDOWS;_DEBUG;_USRDLL".
Remove "_DEBUG;".
You may need to modify or re-create your project and specify that you want to create a DLL that does not depend upon the Microsoft Foundation Classes.
Rebuild the .dll, copy it to the server bin directory; then stop and restart the server. If you are using Microsoft Windows, you must make sure that the initialize(), execute(), and shutdown() functions are exported from your .dll.
When you run your out-of-process adapter, you see one or more error messages similar to one of the following:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/EngineConfiguration Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/Service
The exact name of the missing class may vary.
The most likely cause is that your CLASSPATH environment variable is not set properly. Make sure that you include each of the .jar files in the directory
C:\Program Files\SybaseC8\Server\sdk\java5\lib
See Setting Up Your Environment, which lists the .jar files that should be in your CLASSPATH.
When you run the program, you get a message similar to the following:
Could not send tuple: java.io.IOException: Could not resolve url 'ccl://localhost:6789/Stream/Default/JavaInputAdapter1/InStream': Info: Can not resolve uris
The exact URL may be different.
The possible causes include the following:
The server is not running.
The server is running but the query module is not executing.
The URL is incorrect.
Make sure that the server is running and the query is running. After you start the server, you should start the components in the following order:
The output adapter (if it is an out-of-process adapter).
The query module.
The input adapter (if it is an out-of-process adapter)
Make sure that the URL is correct. In Sybase CEP Studio, you can see the URL by clicking on the stream and then clicking on the "Properties" tab for that stream.
C8OpenStreamConnForReading() or C8OpenStreamConnForWriting() returns a value other than C8_OK.
Possible causes include:
The URI is spelled incorrectly. Remember that the URI is case-sensitive.
Sybase CEP Server is not running or is inaccessible from the test client machine.
The Sybase CEP Studio has not initialized the stream. If Sybase CEP Studio is not running, or if the query module has not been loaded into Sybase CEP Studio, then the stream will not be initialized and the adapter will not be able to connect to it.
If a file is specified, the permissions have not been set correctly to allow reading and writing?
You try to use a TitleRow (in other words, a list of the column names in the stream schema) and parts of the title row are processed as though they were data. Remove the TitleRow from the input to resolve this issue.
You see a message similar to:
error while loading shared libraries: libstlport.so.5.1: cannot open shared object file: No such file or directory
or
Can not load library 'library_name' with path 'some_path'. (Reason='Failure to load dynamic library (-5977,0)')
If you are on a Unix-like operating system, and if you are trying to compile and register a query, then you may not have set the LD_LIBRARY_PATH environment variable to include the directory the library file is in.
To solve the problem, update your LD_LIBRARY_PATH and then restart the server. Also check that your PATH is correct.
You see a message similar to the following when you try to compile a CCL module that uses a UDF:
CCLC2036: Error: Unknown operator 'MyFunc( long )'. MyFunc(x)
The error indicates that the compiler did not recognize the function named MyFunc with parameters of the specified types (the type "long" in this example).
Possible causes include:
You may not have created the .udf file.
The contents of the .udf file may be incorrect. For example, you might have the wrong values for the Function Name, Library, or CclName, or you might have the wrong data types specified for the input and output parameters. Check that you used the correct values.