Problem with JNDI and JSP in Tomcat
Hi,
Basically, what I've done is to use the Tomcat administration web
application to create the DataSource, which looks like it populated the
server.xml (see below). I then try to access the testconn.jsp, and am
getting that "Name java:comp is not bound in this Context" error.
I was wondering if anyone could tell me what I'm doing wrong?
Thanks,
Feri
My Configuration:
- Tomcat 5.0.19
- MySQL 4.0.18-nt
- mysql-connector-java-3.0.15-ga-bin.jar
server.xml:
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
<!--Feri test JNDI-->
<Context crossContext="true" debug="5" docBase="injury" path="/injury" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_injury_log." suffix=".txt" timestamp="true"/>
<Resource name="jdbc/injury" auth="Container"
type="javax.sql.DataSource">
</Resource>
<ResourceParams name="jdbc/injury">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>root</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/injury</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
</ResourceParams>
</Context>
<!--Feri test JNDI end-->
</GlobalNamingResources>
\webapps\injury\WEB-INF\web.xml:
<resource-ref>
<description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>
<res-ref-name>jdbc/injury</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
\webapps\injury\testconn.jsp
<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ taglib prefix="ct" uri="/injury" %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<h1>Connection test</h1>
<ct:connection name="jdbc/injury">
<%
Statement stmt= conn.createStatement();
ResultSet rs;
rs = stmt.executeQuery("select * from user");
while (rs.next()){
%><%=rs.getString(1)%><%=rs.getInt(2) %><br><%
rs.close();
stmt.close();
%>
</ct:connection>
ConnectionTag.java
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import javax.naming.*;
import javax.sql.*;
import javax.sql.DataSource;
public class ConnectionTag extends TagSupport implements TryCatchFinally {
private Connection conn;
// JNDI name of the connection
private String name;
public void setName(String name)
this.name = name;
public int doStartTag()
throws JspException
try {
Context env = (Context) new InitialContext().lookup("java:comp/env");
DataSource ds = (DataSource) env.lookup(name);
if (ds != null)
conn = ds.getConnection();
} catch (Exception e) {
throw new JspException(e);
if (conn == null)
throw new JspException("can't open connection " + name);
pageContext.setAttribute("conn", conn);
return EVAL_BODY_INCLUDE;
public void doCatch(Throwable t)
throws Throwable
throw t;
public void doFinally()
try {
Connection conn = this.conn;
this.conn = null;
pageContext.removeAttribute("conn");
conn.close();
} catch (Exception e) {
Tomcat 5.0\conf\Catalina\localhost\injury.xml
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="Injury" docBase="E:\Tomcat 5.0\webapps\injury" path="/injury" className="org.apache.catalina.core.StandardContext"
cachingAllowed="true" charsetMapperClass="org.apache.catalina .util.CharsetMapper" cookies="true" crossContext="false" debug="0"
mapperClass="org.apache.catalina.core.StandardContextMapper" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper" >
<Resource auth="Container" description="Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file." name="jdbc/injury" type="javax.sql.DataSource"/>
<ResourceLink global="jdbc/injury" name="injury" type="javax.sql.DataSource"/>
</Context>
Hi,
First of all, you can find alot of information about this in the forum about jsp's.
I think a good thing to do is not to put your context tag directly into the server.xml file.
What you should do is create a context.xml file with the context-tag in it, and put it in the META-INF directory of your .war file. Upon deployment to tomcat5 this file will be extracted from the war, copied to the conf\enginename\hostname directory, and it will be renamed to contextName.xml.
I think you are developing directly into the webapps directory, and I believe you should avoid that and use the deployment feature of the manager web-app or you should use the deployertool from you ide or standalone ant.
anyway, for starters try to remove the context tag from the server.xml file as described above, and check out the jsp / jdbc forums for simular problems and answers.
good luck
Similar Messages
-
Please Help me!!!!!! Problems with JNDI and datasouces
Hello Friends.
I'm new in JNDI, sorry for my english
I am working wit java,jsp,struts and connect to Oracle 8i database but with the traditional way.
In this moment i can connect to datasouce with JNDI from jsp or java servlet of this way without problems.
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:comp/env/");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection C = ds.getConnection();
But, When i try to connect from java class compiled out of tomcat is does'nt work, the program show trobles like
"javax.naming.NameNotFoundException: java:comp/env/"
whit this java code:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
try {
Context ctx = new InitialContext(env);
Context envContext = (Context)ctx.lookup("java:comp/env/");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection conn = ds.getConnection();
} catch (NamingException e) {
System.err.println(e.getMessage());
i have the jar's file fscontext.jar, providerutil.jar, jndi alocated in WEB-INF/lib/
Please Help me!!!Results using
try{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
Context initContext = new InitialContext(env);
Context envContext = (Context)initContext.lookup("java:comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection C = ds.getConnection();
}catch(Exception E){
System.out.println(E.getMessage()+E.getClass());
Result : Cannot connect to ORBclass javax.naming.CommunicationException -
Problems with JNDI between JSP and EJB
Good morning:
I've got a problem related to EJB and JNDI.
I want to run methods of an EJB that is in Weblogic, from a JSP that runs IPlanet. When I try to execute getInitialContext() I catch a NamingException. The error description is :Cannot instantiate class: weblogic.jndi.T3InitialContextFactory
I have this code in the JSP:
Context initialCtx;
initialCtx = getInitialContext();
private InitialContext getInitialContext() throws NamingException
Properties p = new Properties();
(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.T3InitialContextFactory");
(Context.PROVIDER_URL,"t3://atlas:7001");
InitialContext ctx = null;
ctx = new InitialContext(p);
return ctx;
Configuration:
JSP runs in IPlanet 4.1 SP7
EJB runs in a Weblogic 5.1. Atlas it's the server name
IPlanet and Weblogic runs on differents machines.
Can anybody help me?
Thanks in advance
DavidI have two weblogic jars (weblogicaux.jar and one service pack of weblogic) in the iplanet classpath.
I don't know if I have to configure Weblogic with any special parameter (RMI/IIOP) or something similar in IPlanet.
Can anybody help me?
Thanks. -
PROBLEMS WITH JNDI AND NAMEPARSER/URGENT
Hi all,
i am experiencing lot of problems in accessing an LDAP under
NetscapeDirectory Server using WLS.
i can connect to the LDAP (using a delegate provider, the one from Sun),
however, when
i try to get the NameParser from the context, i always got the exception
Exception in thread "main" java.io.IOException: Class
com.sun.jndi.ldap.LdapName
Parser with code=123 does not implement Serializable, Externalizable or
WLSerial
izable
at
weblogic.common.internal.WLObjectOutputStreamBase.writeObjectBody(WLO
bjectOutputStreamBase.java:895)
at
weblogic.common.internal.WLObjectOutputStreamBase.writeObject(WLObjec
tOutputStreamBase.java:1011)
at
weblogic.common.internal.WLObjectOutputStreamBase.writeObjectWL(WLObj
ectOutputStreamBase.java:166)
at
weblogic.rmi.extensions.AbstractOutputStream2.writeObject(AbstractOut
putStream2.java:82)
at
weblogic.jndi.remote.DirContextWrapper_WLSkel.invoke(DirContextWrappe
r_WLSkel.java:299)
at
weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
jectAdapter.java, Compiled Code)
at
weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
tHandler.java:69)
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
Compiled Code)
--------------- nested within: ------------------
weblogic.rmi.MarshalException: error marshalling return
- with nested exception:
[java.io.IOException: Class com.sun.jndi.ldap.LdapNameParser with
code=123 does
not implement Serializable, Externalizable or WLSerializable]
at
weblogic.jndi.remote.DirContextWrapper_WLSkel.invoke(DirContextWrappe
r_WLSkel.java:301)
at
weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
jectAdapter.java, Compiled Code)
at
weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
tHandler.java:69)
at
weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
Compiled Code)
--------------- nested within: ------------------
weblogic.rmi.ServerException: A remote exception occurred while
executing the me
thod on the remote object
- with nested exception:
[weblogic.rmi.MarshalException: error marshalling return
- with nested exception:
[java.io.IOException: Class com.sun.jndi.ldap.LdapNameParser with
code=123 does
not implement Serializable, Externalizable or WLSerializable]]
at
weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.j
ava:76)
at
weblogic.jndi.remote.DirContextWrapper_WLStub.getNameParser(DirContex
tWrapper_WLStub.java:929)
at
javax.naming.InitialContext.getNameParser(InitialContext.java:499)
at
com.nokia.nsg.admintool.model.DelegateTest.main(DelegateTest.java:43)
--------------- nested within: ------------------
weblogic.rmi.extensions.RemoteRuntimeException: Undeclared checked
exception - w
ith nested exception:
[weblogic.rmi.ServerException: A remote exception occurred while
executing the m
ethod on the remote object
- with nested exception:
[weblogic.rmi.MarshalException: error marshalling return
- with nested exception:
[java.io.IOException: Class com.sun.jndi.ldap.LdapNameParser with
code=123 does
not implement Serializable, Externalizable or WLSerializable]]]
at
weblogic.jndi.remote.DirContextWrapper_WLStub.getNameParser(DirContex
tWrapper_WLStub.java:954)
at
javax.naming.InitialContext.getNameParser(InitialContext.java:499)
Has anyone ever find this exception???
can anyone help me???
thanx in advance and regards
marcoFriend, In LAN the network speed is high so you don't feel the problem. But on real network the speeds becomes slow and when one thread on the reading process is suspended and the other on write is executed the results are ostensible to be unreliable.
One alternative is use synchronization or some synchronization flag, but I suggest you to have one thread for both the task. Though you have a thread for each client connected.
Single thread model will help you to avoid synchronization headches and also the access won't be simultaneous.
You have to change the design a little.
Hope that works,
Ashish -
Problems with filters and jsp pages.
I have the following simple filter that checks if there is user information in the session object and redirects accordingly:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginFilter implements Filter
public void init(FilterConfig filterConfig) {}
public void destroy() {}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
System.out.println("filter");
HttpSession session = ((HttpServletRequest)request).getSession();
String action = request.getParameter("action");
if(action != null && !action.equals("login") && !action.equals("wronglogin"))
if(session.getAttribute("username") == null)
((HttpServletResponse)response).sendRedirect("index.jsp?action=wronglogin");
System.out.println("User not OK, kicking out...");
else
chain.doFilter(request, response);
System.out.println("User OK, letting in...");
else
chain.doFilter(request, response);
}The filter is mapped to an admin page with the name index.jsp. However, I get an error for every <% and %> tag in the file (there are quite a few) when I use the filter with the page. The page works fine without the filter, and the filter seems to work with pages without scriptlets (without the <% and %> tags). Here is the beginning of the error report:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on tokens, AnnotationName expected instead
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on tokens, delete these tokens
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on token ";", [ expected
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on token ";", [ expected
An error occurred at line: 6 in the jsp file: /admin/index.jsp
Generated servlet error:
Syntax error on token ";", [ expected
Jasper gives me many errors per <% and %> tag. As you can see there is a <% tag on line 6. Any idea, why this does not work?
Thanks!
Message was edited by:
chincillyaWhat is the JSP scriptlet code at line 6 ?
By looking at the code we can identify if there are any syntax errors, otherwise we can't really guess what might be the problem. -
Problem with JavaBeans in JSP.IT'S URGENT!!!
Hi, i have problems with JavaBeans in JSP.
In a jsp file( locating in ROOT directory of tomcat 4.0.6 :jakarta-tomcat-4.0.6\webapps\root ) i have this code:
<jsp:useBean id="paramBean" class="licentza.ParamBean" />
<jsp:setProperty name="paramBean"
property="nume"
value='<%= request.getParameter("numeUser") %>' />
where ParamBean it's a "bean" class locating in jakarta-tomcat-4.0.6\webapps\examples\web-inf\classes\licentza (licentza is the package i'm using).
And i get this error:
Generated servlet error:
D:\jakarta-tomcat-4.0.6\work\Standalone\localhost\_\dora\intrare2$jsp.java:67: Class licentza.ParamBean not found.
ParamBean paramBean = null;
What is the problem?Thank you.Hi,
Put the class file or the package under :jakarta-tomcat-4.0.6\webapps\root\WEB-INF\classes.
Rajesh -
Problems with JSF and included subviews
Hi everybody,
I' ve got a problem with JSF and included subviews which makes me going
crazy. I've got no clue why my web-pages are represent wrongly. The only
tip I've got is that it must be connected with the kind I do include my JSF-pages.
When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
my pages are represent wrongly.
The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
My environment is the following:
JAVA JDK 1.5 Update 4
Tomcat 5.5.9
JSLT 1.1
Sun JSF 1.1
Win 2K
Here's my code:
Main.jsp
<%@ page language="java"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="stil.jsp" type="text/css" />
</head>
<body>
<f:view>
<h:form>
<div class="table">
<div class="tr">
<h:outputText styleClass="tdleft" value="value 1"/>
<h:outputText styleClass="tdinfo" value="value 2"/>
</div>
<div class="tr">
<h:outputText styleClass="tdleft" value="value 3"/>
<h:outputText styleClass="tdinfo" value="value 4"/>
</div>
</div>
</h:form>
<jsp:include page="Sub.jsp" />
</f:view>
</body>
</html>Sub.jsp
<%@ page language="java"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<f:subview id="subview">
<h:form>
<div class="table">
<div class="tr">
<h:outputText styleClass="tdleft" value="value 11"/>
<h:outputText styleClass="tdinfo" value="value 22"/>
</div>
<div class="tr">
<h:outputText styleClass="tdleft" value="value 33"/>
<h:outputText styleClass="tdinfo" value="value 44"/>
</div>
</div>
</h:form>
</f:subview>stil.jsp
<%@page contentType="text/css"%>
<%
String schwarz = "#000000",
grau1 = "#707070",
grau2 = "#c0c0c0",
grau3 = "#e0e0e0",
grau4 = "#e8e8e8",
grau5 = "#fdfdfd",
blau = "#0000dd",
tuerkis = "#00cfff";
String liniendicke = "1px",
linienart = "solid";
String allgemeineTextFarbe = schwarz;
String allgemeineHintergrundFarbe = grau3;
String infoTextFarbe = blau;
String fieldsetRandFarbe = blau;
String fieldsetRandDicke = liniendicke;
String fieldsetRandArt = linienart;
String hrLinienFarbe = blau;
String hrLinienDicke = liniendicke;
String hrLinienArt = linienart;
String inputAktivHintergrundFarbe = grau5;
String inputReadonlyHintergrundFarbe = grau4;
String inputPassivHintergrundFarbe = grau4;
String inputPassivFarbe = schwarz;
String inputRandFarbe1 = grau1;
String inputRandFarbe2 = grau5;
String inputRandDicke = liniendicke;
String inputRandArt = linienart;
String inputButtonHintergrundFarbe = grau3;
String legendenFarbe = blau;
String linkFarbe = blau;
String linkAktivFarbe = tuerkis;
String linkBesuchtFarbe = blau;
String linkFocusFarbe = tuerkis;
String objectGitterFarbe = grau5;
String objectGitterDicke = liniendicke;
String objectGitterArt = linienart;
String tabellenGitterFarbe = grau5;
String tabellenGitterDicke = liniendicke;
String tabellenGitterArt = linienart;
%>
<%-- ----------------------------------------------- --%>
<%-- Textdarstellung mittels der Display-Eigenschaft --%>
<%-- in den Tags div und span --%>
<%-- ----------------------------------------------- --%>
*.table {
display:table;
border-collapse:collapse;
*.tbody {
display:table-row-group;
*.tr {
display:table-row;
*.td,*.tdright,*.tdleft,*.tdinfo,*.th {
display:table-cell;
padding:3px;
vertical-align:middle;
*.td,*.th {
text-align:center;
*.tdright {
text-align:right;
*.tdleft {
text-align:left;
*.tdinfo {
color:<%=infoTextFarbe%>;
text-align:right;
*.th {
color:<%=infoTextFarbe%>;
font-weight:bold;
}thanks in advance
benjaminHello Zhong Li,
many thanks for your post, but it didn't work.
My problem is that the JSF-Components im my included or imported
JSP-Pages does not accept any kind of style or styleClass for
designing. The components take over the informations for colors
but not for alignment.
When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
it seems that the resulting HTML-page would be presented correctly.
But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
In my example I create a simple grid with 2 rows and 2 columns.
Both columns contains JSF-Outtext-Components and are included with div-tags.
The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
Any clue?
Many thanks Benjamin
Here is the html-code from Firefox:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="http://polaris21:8080/webtest/">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="stil.jsp" type="text/css" />
</head>
<body>
<form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
<div class="table">
<div class="tr">
<span class="tdleft">value 1</span>
<span class="tdinfo">value 2</span>
</div>
<div class="tr">
<span class="tdleft">value 3</span>
<span class="tdinfo">value 4</span>
</div>
</div>
<input type="hidden" name="_id0" value="_id0" />
</form>
<form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
<span class="tdleft">value 11</span>
<span class="tdinfo">value 22</span>
<span class="tdleft">value 33</span>
<span class="tdinfo">value 44</span>
<input type="hidden" name="SUB:_id5" value="SUB:_id5" />
</form>
<div class="table">
<div class="tr">
</div>
<div class="tr">
</div>
</div>
</body>
</html> -
Problem with ADS and LDAP
I have installed Win2000 + sp1 and ADS on a computer. This computer is PDC.
After connection via LDAP I cann't get any object ( users or goups etc. ).
I try connect to ADS by java ( JNDI ).
When I use another clients of LDAP ( eg. Maxware Directory Explorer) I have
the same problem - no objects.
Can anybody help me?
Grzegorz Pszona
my e-mail: [email protected]Thanks a lot.
Softerra's browser is really good.
Thanks
Rashmi
"Anant Kadiyala" <[email protected]> wrote:
>
I used Softerra's LDAP browser. The browser is free. There is also a
java baded
LDAP browser from Univ of Michigan. I found the Softerra browser to be
more easier
to use.
-anant
"rashmi" <[email protected]> wrote:
Hi,
Can you please let me know which exact ADS tool that you used to examine
the
DN. I have Active Directory Users and Computers, Sites and Servicesand
Domain
and Trusts installed on my machine but I am not able to figure out how
to get
the DN?
Thanks
Rashmi
for Stephen Davies <[email protected]> wrote:
Grzegorz,
I have had WLS6.1 & ADS working ok using LDAP V2. Mind you it did take
a
fair bit of messing around to get it going. MS does have a few oddities,
for example the Administrators DN might look something like this:
cn=Administrator,cn=Users,dc=eglobal,dc=net
One tool that I found invaluable came with the additional support tools
for Windows 2000. The 'Active Directory Administration Tool' made it
easy to list the directory contents and examine the DNs.
Regards,
Steve
Stephen Davies
Principal Consultant
eGlobal Services Pty. Ltd.
Sydney, Australia
Ph. +61 2 9283 1033
http://www.eglobal.net/ -
Problem with Frameset and page session
All,
I am having a problem with Framesets and page session attributes. I
have a client who's application uses a three frame frameset. They
have a requirement on several pages that when a button is pushed two
different pages load into the right and left frames. The way they
are accomplishing this is that on the pages were this is required,
they are adding target="_top" to the form declaration in their JSP.
Then they store the page names they want to display in session,
forward the request to the frameset, the frameset then determines
which pages to display based on the session variables. This works
exactly how they want it to.
Here is our problem. We need to store some information in page
session attributes. We have tried to get a handle to the desired
view bean and call the setPageSessionAttribute method. However,
since we are forwarding to the frame and the frame handles displaying
the desired JSP, that view bean we had the handle to is not the one
that is created to hand the display of the JSP.
The next thing I tried was to use the request object. In the
handleBtnRequest method, I set an attribute in the request object. I
then query the request object in the beginDisplay event of the view
bean. When the frame is reset the request object does not contain
the attribute that I have set. I'm confused by this because I
thought the request object would be available to me throughout the
life of the request.
Given the above information, does anyone have any suggestions? Also,
am I going about this in the wrong manner.
The client had been storing this information in user session, which
seemed to work. However, since the data being stored dealt
specifically with data for the requested page, we felt that storing
it as page session was more appropriate.
Thanks,The script on your page web page has some obvious bugs.. Best
fix those
first before looking to blame Flash.
Jeckyl -
Problem with JNDI in WLS 5.1
Hi all,
i have a problem with JNDI in WLE 5.1.
i am accessing an LDAP on another machine running Netscape Directory Server.
The host URL is ldap://myhost:65535/o=marco, c=fi
i am always getting back the following exception:
javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.
WLInitialContextFactory. Root exception is java.lang.ClassCastException: weblog
ic.jndi.WLInitialContextFactory
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
58)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242
at javax.naming.InitialContext.init(InitialContext.java:218)
at javax.naming.InitialContext.<init>(InitialContext.java:194)
and my code is this:
Hashtable _environment = new Hashtable();
try {
environment.put(Context.INITIALCONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
environment.put(Context.PROVIDERURL, "ldap://myhost:65535");
if ((principal!=null) || (credentials!=null)) {
environment.put(Context.SECURITYAUTHENTICATION, "simple");
environment.put(Context.SECURITYPRINCIPAL, principal);
environment.put(Context.SECURITYCREDENTIALS, credentials);
context = new InitialContext(environment);
parser = context.getNameParser(initialCtxFactory);
} catch(Exception e) {
e.printStackTrace();
can anyone help me please??
thanx in advance
marcoTake out the "weblogic.jndi.WLInitialContextFactory" and add the respective factory NAME..
environment.put(Context.INITIALCONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
Cheers,
Naggi
Senthil Kumar S wrote:
http://weblogic.com/docs51/classdocs/API_jndi.html#delegate
Marco wrote:
Hi all,
i have a problem with JNDI in WLE 5.1.
i am accessing an LDAP on another machine running Netscape Directory Server.
The host URL is ldap://myhost:65535/o=marco, c=fi
i am always getting back the following exception:
javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.
WLInitialContextFactory. Root exception is java.lang.ClassCastException: weblog
ic.jndi.WLInitialContextFactory
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
58)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242
at javax.naming.InitialContext.init(InitialContext.java:218)
at javax.naming.InitialContext.<init>(InitialContext.java:194)
and my code is this:
Hashtable _environment = new Hashtable();
try {
environment.put(Context.INITIALCONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
environment.put(Context.PROVIDERURL, "ldap://myhost:65535");
if ((principal!=null) || (credentials!=null)) {
environment.put(Context.SECURITYAUTHENTICATION, "simple");
environment.put(Context.SECURITYPRINCIPAL, principal);
environment.put(Context.SECURITYCREDENTIALS, credentials);
context = new InitialContext(environment);
parser = context.getNameParser(initialCtxFactory);
} catch(Exception e) {
e.printStackTrace();
can anyone help me please??
thanx in advance
marco--
http://www.net4tech.com -
Problem with JFrame and busy/wait Cursor
Hi -- I'm trying to set a JFrame's cursor to be the busy cursor,
for the duration of some operation (usually just a few seconds).
I can get it to work in some situations, but not others.
Timing does seem to be an issue.
There are thousands of posts on the BugParade, but
in general Sun indicates this is not a bug. I just need
a work-around.
I've written a test program below to demonstrate the problem.
I have the problem on Solaris, running with both J2SE 1.3 and 1.4.
I have not tested on Windows yet.
When you run the following code, three JFrames will be opened,
each with the same 5 buttons. The first "F1" listens to its own
buttons, and works fine. The other two (F2 and F3) listen
to each other's buttons.
The "BUSY" button simply sets the cursor on its listener
to the busy cursor. The "DONE" button sets it to the
default cursor. These work fine.
The "SLEEP" button sets the cursor, sleeps for 3 seconds,
and sets it back. This does not work.
The "INVOKE LATER" button does the same thing,
except is uses invokeLater to sleep and set the
cursor back. This also does not work.
The "DELAY" button sleeps for 3 seconds (giving you
time to move the mouse into the other (listerner's)
window, and then it behaves just like the "SLEEP"
button. This works.
Any ideas would be appreciated, thanks.
-J
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class BusyFrameTest implements ActionListener
private static Cursor busy = Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR);
private static Cursor done = Cursor.getDefaultCursor();
JFrame frame;
JButton[] buttons;
public BusyFrameTest (String title)
frame = new JFrame (title);
buttons = new JButton[5];
buttons[0] = new JButton ("BUSY");
buttons[1] = new JButton ("DONE");
buttons[2] = new JButton ("SLEEP");
buttons[3] = new JButton ("INVOKE LATER");
buttons[4] = new JButton ("DELAY");
JPanel buttonPanel = new JPanel();
for (int i = 0; i < buttons.length; i++)
buttonPanel.add (buttons);
frame.getContentPane().add (buttonPanel);
frame.pack();
frame.setVisible (true);
public void addListeners (ActionListener listener)
for (int i = 0; i < buttons.length; i++)
buttons[i].addActionListener (listener);
public void actionPerformed (ActionEvent e)
System.out.print (frame.getTitle() + ": " + e.getActionCommand());
if (e.getActionCommand().equals ("BUSY"))
frame.setCursor (busy);
else if (e.getActionCommand().equals ("DONE"))
frame.setCursor (done);
else if (e.getActionCommand().equals ("SLEEP"))
frame.setCursor (busy);
try { Thread.sleep (3000); } catch (Exception ex) { }
frame.setCursor (done);
System.out.print (" finished");
else if (e.getActionCommand().equals ("INVOKE LATER"))
frame.setCursor (busy);
SwingUtilities.invokeLater (thread);
else if (e.getActionCommand().equals ("DELAY"))
try { Thread.sleep (3000); } catch (Exception ex) { }
frame.setCursor (busy);
try { Thread.sleep (3000); } catch (Exception ex) { }
frame.setCursor (done);
System.out.print (" finished");
System.out.println();
Runnable thread = new Runnable()
public void run()
try { Thread.sleep (3000); } catch (Exception ex) { }
frame.setCursor (done);
System.out.println (" finished");
public static void main (String[] args)
BusyFrameTest f1 = new BusyFrameTest ("F1");
f1.addListeners (f1);
BusyFrameTest f2 = new BusyFrameTest ("F2");
BusyFrameTest f3 = new BusyFrameTest ("F3");
f2.addListeners (f3); // 2 listens to 3
f3.addListeners (f2); // 3 listens to 2I've had the same problems with cursors and repaints in a swing application, and I was thinking of if I could use invokeLater, but I never got that far with it.
I still believe you would need a thread for the time consuming task, and that invokeLater is something you only need to use in a thread different from the event thread. -
Problem with installing and running some applications or drivers
When installing and installing some items, towards the end of the installation I get this message:
/System/Library/Extensions/comcy_driver_USBDevice.kext
*was installed improperly and cannot be used. Please try reinstalling it or contact product's vendor for update*
The end result is that some things do not seem to work properly, such as my HP printer. Would anybody have any ideas on how to fix this problem?Thank you for your response. Originally, I had a problem with Airport and ended up reinstalling Snow Leopard. Since then, when downloading upgrades etc, such as HP printer drivers, iTunes etc., towards the end of the download when its running the script, I get this message: /System/Library/Extensions/comcy_driver_USBDevice.kext
+was installed improperly and cannot be used. Please try reinstalling it or contact product's vendor for update+
Sometimes, the download hangs and is unable to complete. The main problem I've encountered so far with an application is when I use the printer to scan an image via Preview, it's blank: there's nothing there. -
Problems with outlook and address book contacts: my outlook contacts had around 3,000 entries. Outlook duplicated entries and have now 340,000. I reinstalled microsoft office and, thus, outlook, and reinstalled mac OS X system and applications. While I managed to delete outlook contacts so that I can re-sync with my blackberry, the contacts at Mac Address Book were not deleted and still have over 340,000 entries. I do not mind deleting all contacts since I have back up, but I have not been able to delete them. Also, when I go at Address Book and try to delete or merge duplicated entries, the system takes forever and never ends because of such large amount of entries. Worse, when I do so I run out of RAM memory.
My Macbook pro is just 2 months old.
What should I do? Is there a way to delete my Mac Address Book without having the problem above?
Many thanks
Regiszlatan24 wrote:
For solving out troubles connected with corrupted or lost address book you may use address book recovery. It owns various features such as restoring wab files, it working under any Windows OS. The utility has modern and easy to use interface due to almost every experienced users.
If it is a windows problem it's not going to run on the OP's MacBook Pro -
Problems with Safari and Firefox (HTTP?)
Problems with Safari and Firefox (HTTP?)
On a laptop G4, 10.5.8 and Safari 5.02 I experience the following:
On the account of my oldest daughter everything works fine, i.e. wireless internet works and no problems with mail or safari.
On the same laptop, on the account of my other daughter, the wireless is OK, she can mail etc. But safari nor firefox works. It says: can’t find server (whatever site) and in the activity window it looks if safari tries to open files (in the safari preferences-folder) in stead of http. Same applies to Firefox, so maybe it has more to do with HTTP in general?
What goes wrong? What to do? I tried the following on the host terminal (tips from Apple)
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
and
defaults delete com.apple.safari WebKitDNSPrefetchingEnabled
but that did not help,
NanneI'm still wondering why it happens now at this moment in time...
PC does seem to be a bit odd & inconsistent, the few times I've tested with it, at least so far as we content filtering goes; and if I remember rightly, you're not the first to report previously ok settings suddenly preventing some or all internet until pc is switched off altogether.
It may work when re-enabled -
Haven't been able to use pages for a while. Keep getting following message. Have tried reinstalling iWork, but no luck. Same problems with Keynote and Numbers/
Have you moved Pages from its installed location? Or just dragged a copy to your current system?
It can't find some of its resources apparently.
Peter
Maybe you are looking for
-
I got my iphone replaced how do i sync my icloud data
today i got my phone replaced and i skipped through the setup because i was in a hurry now i need to back up my iclod data.. how do i do that
-
Problem with backlight on keyboard. Mountain Lion.
Hi 2all. I have some problem. I have MacBook Pro (early 2011), i7. Some days ago I upgrade my MacBook OS to Mountain Lion (clean install). In Snow Leopard I can turn off the backlight of keyboard, and then it will be off. If I need it, I turn it on.
-
New General Activation in ECC 6.0
Hi We are using ECC 6.0 and New General Ledger is not activated. What is the purpose of activating New General Ledger? Regards Jai
-
Hello gurus, In the system when i tick mark the delivery completed indicator in the Purchase order than also system allow me to Create the GRN against the remaining quantity of Purchase order.
-
EJB Control not working with methods that contain arguments
Hi, I have created an EJB control on a stateless session bean. For some reason when I attempt to call a method on my control that takes any number of arguments I get a java.lang.IllegalArgumentException yet if I call a method that takes no arguments