hi everybody,
can anybody explain me what is the significant of this error?:
Exception UnsatisfiedLinkError al inicializar el servlet Controlador:
/home/alonso/curro/XalanC_Engine/dist/Debug/GNU-Linux-x86/libXalanC_Engine.so:
/home/alonso/curro/XalanC_Engine/dist/Debug/GNU-Linux-x86/libXalanC_Engine.so:
undefined symbol: _ZN11xalanc_1_1014XalanDOMString7s_emptyE
it happens when i try to load the .so and google doesnt know anything.
the java class with native method:
package es.yell.frontlite.mvc.View;
//import java.io.ByteArrayOutputStream;
/**
*
* @author alonso
*/
public class RenderizarVistaXalanC {
//public native ByteArrayOutputStream renderView(String xml,
javax.xml.transform.Transformer transletXSL);
public native void renderView(String xml, String xsl);
}
the header file generated via javah
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class es_yell_frontlite_mvc_View_RenderizarVistaXalanC */
#ifndef _Included_es_yell_frontlite_mvc_View_RenderizarVistaXalanC
#define _Included_es_yell_frontlite_mvc_View_RenderizarVistaXalanC
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: es_yell_frontlite_mvc_View_RenderizarVistaXalanC
* Method: renderView
* Signature: (Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL
Java_es_yell_frontlite_mvc_View_RenderizarVistaXalanC_renderView
(JNIEnv *env, jobject obj, jstring xml, jstring xsl);
#ifdef __cplusplus
}
#endif
#endif
the implementation c file:
#include "../../es_yell_frontlite_mvc_View_RenderizarVistaXalanC.h"
#include <xalanc/Include/PlatformDefinitions.hpp>
#if defined(XALAN_CLASSIC_IOSTREAMS)
#include <iostream.h>
#include <strstream.h>
#include <fstream.h>
#else
#include <iostream>
#include <strstream>
#include <fstream>
#endif
#include <xercesc/util/PlatformUtils.hpp>
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
JNIEXPORT void JNICALL
Java_es_yell_frontlite_mvc_View_RenderizarVistaXalanC_renderView
(JNIEnv *env, jobject obj, jstring xml, jstring xsl) {
jboolean blnIsCopy;
XALAN_USING_STD(cerr)
XALAN_USING_STD(cout)
XALAN_USING_STD(endl)
XALAN_USING_STD(istrstream)
XALAN_USING_STD(ofstream)
XALAN_USING_STD(ostrstream)
#if defined(XALAN_STRICT_ANSI_HEADERS)
using std::strlen;
#endif
XALAN_USING_XERCES(XMLPlatformUtils)
XALAN_USING_XALAN(XalanTransformer)
// Call the static initializer for Xerces.
XMLPlatformUtils::Initialize();
// Initialize Xalan.
XalanTransformer::initialize();
// Create a XalanTransformer.
XalanTransformer theXalanTransformer;
const char* const theInputXmlDocument
=env->GetStringUTFChars(xml,&blnIsCopy);
printf("xml: %s\n",theInputXmlDocument);
const char* const theInputXslDocument =
env->GetStringUTFChars(xsl,&blnIsCopy);
printf("xml: %s\n",theInputXslDocument);
// Our input streams...
istrstream theXMLStream(theInputXmlDocument,
strlen(theInputXmlDocument));
istrstream theXSLStream(theInputXslDocument,
strlen(theInputXslDocument));
XALAN_USING_XALAN(XalanDOMString)
XALAN_USING_XALAN(XSLTInputSource)
XSLTInputSource inputSource(&theXSLStream);
inputSource.setSystemId(XalanDOMString("foo").c_str());
// Do the transform.
int theResult = theXalanTransformer.transform(&theXMLStream,
inputSource, cout);
if(theResult != 0)
{
cerr << "StreamTransform Error: \n" <<
theXalanTransformer.getLastError()
<< endl
<< endl;
}
// Terminate Xalan...
XalanTransformer::terminate();
// Terminate Xerces...
XMLPlatformUtils::Terminate();
// Clean up the ICU, if it's integrated...
XalanTransformer::ICUCleanUp();
}
i already tried to load the .so setting LD_LIBRARY_PATH like this:
[EMAIL PROTECTED]:~$ export
LD_LIBRARY_PATH=/home/alonso/curro/XalanC_Engine/dist/Debug/GNU-Linux-x86/
[EMAIL PROTECTED]:~$ echo $LD_LIBRARY_PATH
/home/alonso/curro/XalanC_Engine/dist/Debug/GNU-Linux-x86/
where /home/alonso/curro/XalanC_Engine/dist/Debug/GNU-Linux-x86/ is a
directory which contains the .so
[EMAIL PROTECTED]:~$ cd $LD_LIBRARY_PATH
[EMAIL PROTECTED]:~/curro/XalanC_Engine/dist/Debug/GNU-Linux-x86$ ls
libXalanC_Engine.so
this is how i try to load the .so file giving me UnsatisfiedLinkError
System.load("/home/alonso/curro/XalanC_Engine/dist/Debug/GNU-Linux-x86/libXalanC_Engine.so");
if i try to load the .so like this:
Exception UnsatisfiedLinkError al inicializar el servlet Controlador:
Expecting an absolute path of the library: libXalanC_Engine
this is the output when i did System.out.println("java.library.path:" +
System.getProperty("java.library.path"));
java.library.path:/usr/java/jdk1.6.0_04/jre/lib/i386/client:/usr/java/jdk1.6.0_04/jre/lib/i386:/usr/java/jdk1.6.0_04/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
i think this is the problem but i m not sure, pls help me!
Alonso
--
View this message in context:
http://www.nabble.com/problems-loading-library-tp15203564p15203564.html
Sent from the Xalan - C - Users mailing list archive at Nabble.com.