suse singularity

Greenhorn
+ Follow
since Apr 29, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by suse singularity



Is this the right way to add suffix S to all the entries in my ldap directory?
15 years ago
How can I modify all the entries in my ldap directory using JNDI API.
I want to update the cn attribute of all the entries in my directory. I am going to add a suffix Z to all the entries in my ldap directory.
How can I do this.
Thanks
15 years ago
please see my code to modify an attribute. It doesn't seem to have any errors but it does not produce the result as indicated in the error message.
My directory has 50 users.

[code] import java.util.Hashtable;
import java.util.Date;
import javax.naming.*;
import javax.naming.directory.*;
class Modattrs {
public static void main(String[] args) {
Hashtable env = new Hashtable(5, 0.75f);

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
/* Specify host and port to use for directory service */
env.put(Context.PROVIDER_URL, "ldap://localhost:389/cn=Doug Smith,dc=test,dc=com");
/* specify authentication information */
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "cn=Manager,dc=test,dc=com");
env.put(Context.SECURITY_CREDENTIALS, "openldap");
try {
/* get a handle to an Initial DirContext */
DirContext ctx = new InitialDirContext(env);
/* construct the list of modifications to make */
ModificationItem[] mods = new ModificationItem[2];
Attribute mod0 = new BasicAttribute("mail", "doug2.02@test.com");
// Update mail attribute
mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, mod0);
// Add another value to description attribute
Attribute mod1 =
new BasicAttribute("description",
"This entry was modified with the Modattrs program on " +
(new Date()).toString());
mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE, mod1);
/* Delete the description attribute altogether */
/*
Attribute mod1 = new BasicAttribute("description");
mods[2] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, mod1);
*/
/* make the change */
ctx.modifyAttributes("cn=Doug Smith,dc=test,dc=com", mods);
System.out.println( "modification was successful." );
} catch (NamingException e) {
System.err.println("modification failed. " + e);
}
}
}
[/code]


Errors:
modification failed. javax.naming.OperationNotSupportedException: [LDAP: error code 53 - no global superior knowledge]; remaining name 'cn=Doug Smith,dc=test,dc=com'

PLease let me know where I am wrong and what I need to do to remove the error.
15 years ago

Kees Jan Koster wrote:Dear suse,

Check tomcat's log file for errors (logs/catalina.out) to see if it started all-right.

Once Tomcat started, check with netstat that it is actually listening to the port. Also, if you are using IE, switch off the 'friendly' error messages to see what the real error is.



Hi, I have the following log files. I am not able to interpret it properly,
Would you please have a look at it:


May 7, 2009 11:42:53 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.14.
May 7, 2009 11:42:53 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [false], sendfile [true], accept filters [false], random [true].
May 7, 2009 11:42:54 AM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
May 7, 2009 11:42:54 AM org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
May 7, 2009 11:42:54 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1416 ms
May 7, 2009 11:42:54 AM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 1 column 40: Invalid encoding name "cp1252".
org.xml.sax.SAXParseException: Invalid encoding name "cp1252".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.createReader(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager$ScannedEntity.setReader(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.setEncoding(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanXMLDeclOrTextDecl(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$XMLDeclDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:316)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
May 7, 2009 11:42:54 AM org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
org.xml.sax.SAXParseException: Invalid encoding name "cp1252".
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:316)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
May 7, 2009 11:42:54 AM org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans
SEVERE: Exception processing Global JNDI Resources
javax.naming.NamingException: Invalid encoding name "cp1252".
at org.apache.naming.NamingContext.lookup(NamingContext.java:805)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
May 7, 2009 11:42:54 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 7, 2009 11:42:54 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
May 7, 2009 11:42:54 AM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 1 column 40: Invalid encoding name "cp1252".
org.xml.sax.SAXParseException: Invalid encoding name "cp1252".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.createReader(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager$ScannedEntity.setReader(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.setEncoding(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanXMLDeclOrTextDecl(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$XMLDeclDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:316)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:253)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
May 7, 2009 11:42:54 AM org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
org.xml.sax.SAXParseException: Invalid encoding name "cp1252".
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:316)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:253)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
May 7, 2009 11:42:54 AM org.apache.catalina.realm.UserDatabaseRealm start
SEVERE: Exception looking up UserDatabase under key UserDatabase
javax.naming.NamingException: Invalid encoding name "cp1252".
at org.apache.naming.NamingContext.lookup(NamingContext.java:805)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:253)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
May 7, 2009 11:42:54 AM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
LifecycleException: No UserDatabase component found under key UserDatabase
at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:261)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
May 7, 2009 11:42:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 225 ms
15 years ago
I have successfully set up Tomcat 6.0 on my windows machine. I can start/stop the service from windows task bar and services.msc console.
However when I try to run Tomcat in browser by typing http://localhost:8080 the page does not load. It shows me in the task bar(Waiting for http://localhost:8080) but in reality nothing appears. I tried changing ports from 8080 to 80 , 8080 to 8081, but still the same issue.
Can you please tell me what I am missing.
Thanks for the replies.
15 years ago
Hi,
I have Eclipse 3.2, Tomcat 6, openldap directory/server and Jdk 6 Installed on my machine. I have ldap and Tomcat plugins installed in Eclipse.
When I try to create a new connection, I am able to establish a connection with tomcat, but when I try to browse the ldap directory or add an entry. It seems that I am not connected to directory.
Am I missing some thing.

I think I have put a wrong passowrd. I am also not sure whether I have to connect to ldap server rather than Tomcat.
I am new in this concept.

Can you please help me to configure this issue.
Thanks for the replies.
15 years ago