Thread: [jnc-users] LDAP with jnc
Status: Beta
Brought to you by:
soapy
From: <no...@sm...> - 2007-10-15 13:48:20
|
Hello, i am using the JNDI-Classes coming with the sun-jre/jdk to do some LDAP-Querys. Obviously (and most understandable) this class is not implemented in the gcj. Is there a simmilar class to use or some other means to get this running in a JNC binary? The exception to whom it may concern: java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} at java.net.URLClassLoader.findClass(LdapInfo) at gnu.gcj.runtime.SystemClassLoader.findClass(LdapInfo) at java.lang.ClassLoader.loadClass(LdapInfo) at java.lang.ClassLoader.loadClass(LdapInfo) at java.lang.Class.forName(LdapInfo) at javax.naming.spi.NamingManager.getInitialContext(LdapInfo) at javax.naming.InitialContext.getDefaultInitCtx(LdapInfo) at javax.naming.InitialContext.getURLOrDefaultInitCtx(LdapInfo) at javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(LdapInfo) at javax.naming.directory.InitialDirContext.search(LdapInfo) at ldapinfo.LdapQuery.getDirContext(LdapInfo) at ldapinfo.LdapInfo.main(LdapInfo) Regards Norman |
From: Marco T. <ma...@mt...> - 2007-10-15 13:57:52
|
Hey Norman Norman Rieß wrote: > Hello, > > i am using the JNDI-Classes coming with the sun-jre/jdk to do some > LDAP-Querys. Obviously (and most understandable) this class is not > implemented in the gcj. Is there a simmilar class to use or some other > means to get this running in a JNC binary? Either extract the Sun implementation and compile it into the project or search another LDAP library (JLDAP for example). Hope that helps Marco > > The exception to whom it may concern: > > java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not > found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], > parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} > at java.net.URLClassLoader.findClass(LdapInfo) > at gnu.gcj.runtime.SystemClassLoader.findClass(LdapInfo) > at java.lang.ClassLoader.loadClass(LdapInfo) > at java.lang.ClassLoader.loadClass(LdapInfo) > at java.lang.Class.forName(LdapInfo) > at javax.naming.spi.NamingManager.getInitialContext(LdapInfo) > at javax.naming.InitialContext.getDefaultInitCtx(LdapInfo) > at javax.naming.InitialContext.getURLOrDefaultInitCtx(LdapInfo) > at > javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(LdapInfo) > at javax.naming.directory.InitialDirContext.search(LdapInfo) > at ldapinfo.LdapQuery.getDirContext(LdapInfo) > at ldapinfo.LdapInfo.main(LdapInfo) > > Regards > Norman > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > javaCompiler-users mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/javacompiler-users |
From: <no...@sm...> - 2007-10-15 17:13:55
|
Marco Trudel schrieb: > Hey Norman > > > Either extract the Sun implementation and compile it into the project > or search another LDAP library (JLDAP for example). > > > Hope that helps > Marco > Hi, that is kind of a Problem, too. reating "LdapInfo" for Linux - processing rt.jar com/sun/accessibility/internal/resources/accessibility.java:7: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. failed... |
From: Marco T. <ma...@mt...> - 2007-10-16 15:45:41
|
Norman Rieß wrote: > Marco Trudel schrieb: >> Hey Norman >> >> >> Either extract the Sun implementation and compile it into the project >> or search another LDAP library (JLDAP for example). >> >> >> Hope that helps >> Marco >> > Hi, > > that is kind of a Problem, too. > > reating "LdapInfo" for Linux > - processing rt.jar > com/sun/accessibility/internal/resources/accessibility.java:7: > internal compiler error: Segmentation fault > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://gcc.gnu.org/bugs.html> for instructions. What is rt.jar? Did you add the complete runtime from Sun? What was the result on using another LDAP library? Marco |
From: <no...@sm...> - 2007-10-16 16:13:45
|
Marco Trudel schrieb: > Norman Rieß wrote: >> Marco Trudel schrieb: >>> Hey Norman >>> >>> >>> Either extract the Sun implementation and compile it into the >>> project or search another LDAP library (JLDAP for example). >>> >>> >>> Hope that helps >>> Marco >>> >> Hi, >> >> that is kind of a Problem, too. >> >> reating "LdapInfo" for Linux >> - processing rt.jar >> com/sun/accessibility/internal/resources/accessibility.java:7: >> internal compiler error: Segmentation fault >> Please submit a full bug report, >> with preprocessed source if appropriate. >> See <URL:http://gcc.gnu.org/bugs.html> for instructions. > > What is rt.jar? Did you add the complete runtime from Sun? > What was the result on using another LDAP library? > > > Marco > rt.jar is the Runtime from Sun, yes. I set JNC only to comile the needed sources. I unpacked rt.jar, too and only included the needed parts, but this did not work either, because of dependencies. This were dependencies, which are not included in the rt.jar. So why it suddenly asked for them, i do not know. Then i portet to JLDAP. This lib however suddenly asks for org.apache.commons.XXX stuff while compiling in JNC. My first thought was WTH commons-net!!! Ok, so i included that too..., but this .jar wants some org.apache.*somethingtotallydifferent*. At this time i resinged for today. I will post the exact error messages tomorrow. Regards Norman |
From: Marco T. <ma...@mt...> - 2007-10-16 17:46:05
|
Norman Rieß wrote: > Marco Trudel schrieb: >> Norman Rieß wrote: >>> Marco Trudel schrieb: >>>> Hey Norman >>>> >>>> >>>> Either extract the Sun implementation and compile it into the >>>> project or search another LDAP library (JLDAP for example). >>>> >>>> >>>> Hope that helps >>>> Marco >>>> >>> Hi, >>> >>> that is kind of a Problem, too. >>> >>> reating "LdapInfo" for Linux >>> - processing rt.jar >>> com/sun/accessibility/internal/resources/accessibility.java:7: >>> internal compiler error: Segmentation fault >>> Please submit a full bug report, >>> with preprocessed source if appropriate. >>> See <URL:http://gcc.gnu.org/bugs.html> for instructions. >> What is rt.jar? Did you add the complete runtime from Sun? >> What was the result on using another LDAP library? >> >> >> Marco >> > rt.jar is the Runtime from Sun, yes. I set JNC only to comile the needed > sources. Well, you can't compile the whole rt.jar. You will confuse the compiler because most classes will be there twice (java.lang.Object, ...). > I unpacked rt.jar, too and only included the needed parts, but this did > not work either, because of dependencies. This were dependencies, > which are not included in the rt.jar. So why it suddenly asked for > them, i do not know. You have to fill the dependences. I had to do the same when importing AWT/Swing from Sun. I wrote a little tool that does this automatically :-) > Then i portet to JLDAP. This lib however suddenly asks for > org.apache.commons.XXX stuff while compiling in JNC. My first thought > was WTH commons-net!!! These are dependencies that would lead to a "ClassNotFoundException" if run into while using the library in a Sun JRE. You can avoid having to solve all reference when compiling with JNC by adding "-findirect-dispatch" as custom GCJ flag. It will then search dependencies at runtime. Marco > Ok, so i included that too..., but this .jar > wants some org.apache.*somethingtotallydifferent*. At this time i > resinged for today. > > I will post the exact error messages tomorrow. > > Regards > Norman |
From: <no...@sm...> - 2007-10-17 07:06:50
|
Marco Trudel schrieb: > > These are dependencies that would lead to a "ClassNotFoundException" > if run into while using the library in a Sun JRE. You can avoid having > to solve all reference when compiling with JNC by adding > "-findirect-dispatch" as custom GCJ flag. It will then search > dependencies at runtime. > > Ok, thank you. That helped with the dependencies. Now there is an error in the main compilation step. creating "LdapInfo" for Linux - processing ldap.jar - processing LdapInfo.jar - main compilation step /tmp/ccUywGVz.o: In function `main':ccIKMEUi.i:(.text+0x30): undefined reference to `JvRunMainName' collect2: ld returned 1 exit status failed... Seems like you encountered this error before. That's what google said, anyway :-) Regards Norman |
From: Marco T. <ma...@mt...> - 2007-10-17 08:16:59
|
Norman Rieß wrote: > Marco Trudel schrieb: >> >> These are dependencies that would lead to a "ClassNotFoundException" >> if run into while using the library in a Sun JRE. You can avoid having >> to solve all reference when compiling with JNC by adding >> "-findirect-dispatch" as custom GCJ flag. It will then search >> dependencies at runtime. >> >> > > Ok, thank you. That helped with the dependencies. Now there is an error > in the main compilation step. > > creating "LdapInfo" for Linux > - processing ldap.jar > - processing LdapInfo.jar > - main compilation step > /tmp/ccUywGVz.o: In function `main':ccIKMEUi.i:(.text+0x30): > undefined reference to `JvRunMainName' > collect2: ld returned 1 exit status > > failed... > > Seems like you encountered this error before. That's what google said, > anyway :-) Is this a clean compilation or are there some precompiled non indirect-dispatch objects used (from the jars)? It looks like this is the case here... Marco |
From: Marco T. <ma...@mt...> - 2007-10-17 08:19:03
|
Marco Trudel wrote: > Norman Rieß wrote: >> Marco Trudel schrieb: >>> These are dependencies that would lead to a "ClassNotFoundException" >>> if run into while using the library in a Sun JRE. You can avoid having >>> to solve all reference when compiling with JNC by adding >>> "-findirect-dispatch" as custom GCJ flag. It will then search >>> dependencies at runtime. >>> >>> >> Ok, thank you. That helped with the dependencies. Now there is an error >> in the main compilation step. >> >> creating "LdapInfo" for Linux >> - processing ldap.jar >> - processing LdapInfo.jar >> - main compilation step >> /tmp/ccUywGVz.o: In function `main':ccIKMEUi.i:(.text+0x30): >> undefined reference to `JvRunMainName' >> collect2: ld returned 1 exit status >> >> failed... >> >> Seems like you encountered this error before. That's what google said, >> anyway :-) > > Is this a clean compilation or are there some precompiled non > indirect-dispatch objects used (from the jars)? It looks like this is > the case here... Sorry, I assumed you're compiling for Windows. Now I see it's Linux ;-) As you said already, I run into this problem before. Just follow the discussion google shows you. It's something about editing libgcj.spec, but I don't remember it exactly now. Marco |
From: <no...@sm...> - 2007-10-17 10:00:44
|
Marco Trudel schrieb: > Marco Trudel wrote: >> Norman Rieß wrote: >>> Marco Trudel schrieb: >>>> These are dependencies that would lead to a >>>> "ClassNotFoundException" if run into while using the library in a >>>> Sun JRE. You can avoid having to solve all reference when compiling >>>> with JNC by adding "-findirect-dispatch" as custom GCJ flag. It >>>> will then search dependencies at runtime. >>>> >>>> >>> Ok, thank you. That helped with the dependencies. Now there is an >>> error in the main compilation step. >>> >>> creating "LdapInfo" for Linux >>> - processing ldap.jar >>> - processing LdapInfo.jar >>> - main compilation step >>> /tmp/ccUywGVz.o: In function `main':ccIKMEUi.i:(.text+0x30): >>> undefined reference to `JvRunMainName' >>> collect2: ld returned 1 exit status >>> >>> failed... >>> >>> Seems like you encountered this error before. That's what google >>> said, anyway :-) >> >> Is this a clean compilation or are there some precompiled non >> indirect-dispatch objects used (from the jars)? It looks like this is >> the case here... > > Sorry, I assumed you're compiling for Windows. Now I see it's Linux ;-) > As you said already, I run into this problem before. Just follow the > discussion google shows you. It's something about editing libgcj.spec, > but I don't remember it exactly now. > > > Marco > Yes, i applied *lib: %{s-bc-abi:} -lgcj -lm -lpthread -lrt -ldl %(libgcc) %(liborig) instead of *lib: %{static-libgcj:-non_shared} %{s-bc-abi:-lgcj_bc;:-lgcj} %{static-libgcj:-call_shared} -lm -lpthread -lrt -ldl %(libgcc) %(liborig) It compiles now. Now i have to work on those dependencies. Thank you. Norman |
From: Marco T. <ma...@mt...> - 2007-10-17 10:43:34
|
Norman Rieß wrote: > Marco Trudel schrieb: >> Marco Trudel wrote: >>> Norman Rieß wrote: >>>> Marco Trudel schrieb: >>>>> These are dependencies that would lead to a >>>>> "ClassNotFoundException" if run into while using the library in a >>>>> Sun JRE. You can avoid having to solve all reference when compiling >>>>> with JNC by adding "-findirect-dispatch" as custom GCJ flag. It >>>>> will then search dependencies at runtime. >>>>> >>>>> >>>> Ok, thank you. That helped with the dependencies. Now there is an >>>> error in the main compilation step. >>>> >>>> creating "LdapInfo" for Linux >>>> - processing ldap.jar >>>> - processing LdapInfo.jar >>>> - main compilation step >>>> /tmp/ccUywGVz.o: In function `main':ccIKMEUi.i:(.text+0x30): >>>> undefined reference to `JvRunMainName' >>>> collect2: ld returned 1 exit status >>>> >>>> failed... >>>> >>>> Seems like you encountered this error before. That's what google >>>> said, anyway :-) >>> >>> Is this a clean compilation or are there some precompiled non >>> indirect-dispatch objects used (from the jars)? It looks like this is >>> the case here... >> >> Sorry, I assumed you're compiling for Windows. Now I see it's Linux ;-) >> As you said already, I run into this problem before. Just follow the >> discussion google shows you. It's something about editing libgcj.spec, >> but I don't remember it exactly now. >> >> >> Marco >> > Yes, i applied > *lib: %{s-bc-abi:} -lgcj -lm -lpthread -lrt -ldl %(libgcc) > %(liborig) instead of > *lib: %{static-libgcj:-non_shared} %{s-bc-abi:-lgcj_bc;:-lgcj} > %{static-libgcj:-call_shared} -lm -lpthread -lrt -ldl %(libgcc) > %(liborig) > It compiles now. > Now i have to work on those dependencies. Not necessarily. If you don't run into a "ClassNotFoundException", these dependencies are never needed. So there's no sense in bloating up your binary for something that is never needed... Marco > Thank you. > > Norman > > > > |
From: <no...@sm...> - 2007-10-17 13:38:48
|
Marco Trudel schrieb: > > Not necessarily. If you don't run into a "ClassNotFoundException", > these dependencies are never needed. So there's no sense in bloating > up your binary for something that is never needed... > > > Marco > Hm, apparently Classes, that are in the .jar-File (i checked) are not found in the binary. Even if i activate the checkbox in "Step 1" screen. Exception in thread "main" java.lang.NoClassDefFoundError: com.novell.ldap.LDAPAttributeSet at java.lang.Class.initializeClass(LdapInfo) at com.novell.ldap.LDAPSearchResult.getEntry(LdapInfo) at com.novell.ldap.LDAPSearchResults.getBatchOfResults(LdapInfo) at com.novell.ldap.LDAPSearchResults.resetVectors(LdapInfo) at com.novell.ldap.LDAPSearchResults.hasMore(LdapInfo) at ldapinfo.PrintLdapInfo.printSet(LdapInfo) at ldapinfo.LdapInfo.main(LdapInfo) Caused by: java.lang.IllegalAccessError: com.novell.ldap.LDAPAttributeSet can't access class com.novell.ldap.util.SAXEventMultiplexer at java.lang.Class.initializeClass(LdapInfo) ...6 more |
From: Marco T. <ma...@mt...> - 2007-10-18 16:39:48
|
Norman Rieß wrote: > Marco Trudel schrieb: >> >> Not necessarily. If you don't run into a "ClassNotFoundException", >> these dependencies are never needed. So there's no sense in bloating >> up your binary for something that is never needed... >> >> >> Marco >> > Hm, apparently Classes, that are in the .jar-File (i checked) are not > found in the binary. Even if i activate the checkbox in "Step 1" screen. Does the same work in a Sun JRE? > Exception in thread "main" java.lang.NoClassDefFoundError: > com.novell.ldap.LDAPAttributeSet > at java.lang.Class.initializeClass(LdapInfo) > at com.novell.ldap.LDAPSearchResult.getEntry(LdapInfo) > at com.novell.ldap.LDAPSearchResults.getBatchOfResults(LdapInfo) > at com.novell.ldap.LDAPSearchResults.resetVectors(LdapInfo) > at com.novell.ldap.LDAPSearchResults.hasMore(LdapInfo) > at ldapinfo.PrintLdapInfo.printSet(LdapInfo) > at ldapinfo.LdapInfo.main(LdapInfo) > Caused by: java.lang.IllegalAccessError: > com.novell.ldap.LDAPAttributeSet can't access class > com.novell.ldap.util.SAXEventMultiplexer That doesn't look like a ClassNotFoundException. It looks more like problems with XML. XML is known to be problematic with JNC. Please check the archives on how to add all XML objects into your binary. Marco > at java.lang.Class.initializeClass(LdapInfo) > ...6 more > |