Hashtable proiblem.Please Help

Folks.
I am using a Hashtable with the flwg values:
public class TestHashTable {
public static void main(String[] args){
Hashtable balance = new Hashtable();
Enumeration names;
String str;
balance.put("Entertainment","Video");
balance.put("Settings","Setup");
balance.put("Entertainment","Audio");
balance.put("Entertainment","MidpMan");
balance.put("Pim","Setup");
/* Show the Hashtable contents */
names = balance.keys();
while(names.hasMoreElements()){
str = (String)names.nextElement();
System.out.println(str + ":" + balance.get(str));     
       What I am being displayed is:
Pim:Setup
Entertainment:MidpMan
Settings:Setup
Can a hashtable store duplicate keys? Also what can I do to view all the above elements?
An urgent response is appreciated?

In a Hashtable (and any java.util.Map) a single key object maps to a single value object. So if you add multiple values to the same key (as you did) the earlier values get overwritten.
If you want multiple values per key, then make the key map to a java.util.List, and add to that list. Something like:
import java.util.*;
private void helperMethodAddToList(Map m, String key, String value) {
    List vals = m.get(key);
    if (vals == null) {
        vals = new LinkedList();
        m.put(key, vals);
    vals.add(value);
}That's just a suggestion.

Similar Messages

  • Search problem with ActiveDirectory - please help

    Hi,
    I've tried to get a list of the users out of the Active Directory.
    But I just can't get my code to work. It returns nothing back.
    The problem should be simple. But I can not figure out why.
    Please help!
    Raymond
    import javax.naming.*;
    import javax.naming.event.*;
    import javax.naming.directory.*;
    import javax.naming.ldap.*;
    import java.util.Hashtable;
    import java.util.Vector;
    import java.util.Enumeration;
    public class AdClient {
    public AdClient() {
    getUsers();
    public static void main(String args[]) {
    Client client = new Client();
    private void getUsers() {
    // domain = utest
    String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory";
    String HOST = "ldap://192.168.128.50:389";
    String SEARCHBASE = "ou=Users,dc=utest,dc=com";
    String FILTER = "cn=*";
    try {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    env.put(Context.PROVIDER_URL, HOST);
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, "[email protected]");
    env.put(Context.SECURITY_CREDENTIALS,"admin");
    DirContext ctx = new InitialDirContext(env);
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    NamingEnumeration results;
    // now search for the users
    results = ctx.search(SEARCHBASE, FILTER, constraints);
    while (results.hasMoreElements()) {
    SearchResult sr = (SearchResult)results.nextElement();
    System.out.println(sr.getName());
    ctx.close();
    } catch(Exception e) {
    e.printStackTrace();
    }

    I tried your code...
    There were two issues I saw, when I changed them it worked!
    1) public static void main(String args[]) {
    Client client = new Client();
    should be
    public static void main(String args[]) {
    AdClient client = new AdClient();
    2) String SEARCHBASE = "ou=Users,dc=utest,dc=com";
    env.put(Context.SECURITY_PRINCIPAL, "[email protected]");
    Should be
    String SEARCHBASE = "ou=Users,dc=utest,dc=newcom,dc=com";
    env.put(Context.SECURITY_PRINCIPAL, "[email protected]");

  • _iiopClient.jar is not generated - please help!

    I have an application where an EJB exposes its remote interface to the web application. The web application can ONLY call this EJB from the ejb application, no other. All other EJBs are accessed locally from this EJB (Business Delegate pattern).
    The problem is that normal Java casting fails for the home object returned by the JNDI context lookup. So I am using PortableRemoteObject.narrow() and it predictably fails with the message that _iiopClient.jar is required on the classpath.
    So, on OEM, I enabled IIOP for the target server instance by checking all three options:
    Generate IIOP Client Stubs when Compiling EJBs
    IIOP Wrapper Code Debug Mode
    Keep Generated IIOP Source Code
    Now I am deploying the application, but the iiopClient.jar is nowhere to be seen. Please tell me what I am doing wrong; or what alternatives do I have to get this application working.
    I am using Oracle AS 10.1.3
    This is a bit urgent; please help! TIA.

    Thanks...I would like to see the whole posting I am interested in the InitialContext properties, you can hide the username and pwd for security purposes. What I am trying to say that there should be no problems to access the EJB from your web Application within the same ear.
    Here is an example:
    // Code to look up an EJB object is part of some other J2EE application in the same server
    import java.sql.Connection;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.sql.DataSource;
    //Note :This code assumes EJBHomeInterface and EJBRemoteInterface already exist
    public class Code2{
    public Code2()
         Hashtable env = new Hashtable(); // set the environment properties
         env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.RMIInitialContextFactory");
         env.put(Context.PROVIDER_URL, "ormi:///ejbsample");
         env.put(Context.SECURITY_PRINCIPAL, "admin");
         env.put(Context.SECURITY_CREDENTIALS, "welcome");
         try {
    // create an initial context using the above environment properties
              Context context = new InitialContext(env);
              EJBRemoteInterface ejbObject; // Perform look up using JNDI name of ejb object
              Object boundObject = context.lookup("ObjectName");
    // Narrow the reference of the object returned by lookup() method
              EJBHomeInterface homeInterface = (EJBHomeInterface)PortableRemoteObject.narrow( boundObject, EJBHomeInterface.class);
    // create an EJB instance
              ejbObject =homeInterface.create();
         catch (NamingException e) {
         System.out.println(e.toString());
    } It all depends on the kind of InitialContext Factory you are using. See this link
    Hope this helps.
    Deepak

  • JTA Transaction--please help-----Xid not valid

    HI,
    I am writing a small application which i am posting at the end.This is decription of my application.I am writing a jsp.Later on i will be using in some other way.
    I am using Oracle XA implementation to communicatewith my RM which oracle8.1.7 .
    I am creating two XAConnection with two data instances 'test' and 'test3' .These two reside on my local machine in the same database server.
    With the code which i am sending you i have tried two cases.
    First Case
    1)i use only one XAConnection object of say 'test'.
    2)enlist its XADataSource with my transaction Object
    3) get two connection objects and execute two sql's on themMy code works fine and maintains the transaction.
    Second Case
    1) I use create two XAConnection objects. one of 'test' and other of 'test3'.
    2) enlist their XAResources with transaction object.
    3) Now i take one connection from each of XAConnection and execute two sqls, oneon each of them.
    It gives me exception while enlisting second XAResource with transaction objeectsaying that "The Xid is not valid".
    below is the stackTrace.
    javax.transaction.SystemException: start() failed on resource 'oracle.jdbc.xa.client.OracleXAResource':XAER_NOTA : The XID is not valid
    oracle.jdbc.xa.OracleXAException at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:483)
    at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:190)
    at weblogic.transaction.internal.ServerResourceInfo.start(ServerResourceInfo.java:1165)
    at weblogic.transaction.internal.ServerResourceInfo.xaStart(ServerResourceInfo.java:1108)
    <----------------------CODE------------------------------------------------------>
    <html>
    <body bgcolor=tan>
    <%@page session="true" %>
    <%@page import="java.util.Hashtable,java.sql.*,javax.naming.*,javax.transaction.*,javax.sql.*,oracle.jdbc.xa.client.OracleXADataSource,javax.rmi.PortableRemoteObject,javax.transaction.xa.XAResource" %>
    <%!
    private static XAConnection getFirstXAConnection() throws java.sql.SQLException{
         OracleXADataSource oxadsFirst = new OracleXADataSource();
         String urlFirst = "jdbc:oracle:thin:@70.7.51.80:1521:test";
         oxadsFirst.setURL(urlFirst);
         XAConnection xaConnectionFirst = oxadsFirst.getXAConnection("scott","tiger");
    return xaConnectionFirst;
    private static XAConnection getSecondXAConnection() throws java.sql.SQLException{
              OracleXADataSource oxadsSec= new OracleXADataSource();
              String urlSec = "jdbc:oracle:thin:@70.7.51.80:1521:test3";
              oxadsSec.setURL(urlSec);
              XAConnection xaConnectionSec = oxadsSec.getXAConnection("scott","tiger");
    return xaConnectionSec;
    %>
    <%
    Context ctx = null;
         Hashtable ht = new Hashtable();
         ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
         ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
         try{
              ctx = new InitialContext(ht);
              //javax.transaction.UserTransaction transaction = (javax.transaction.UserTransaction)ctx.lookup("java:comp/UserTransaction");
              System.out.println("Before Lookup JNDI UserTransaction and TransactionManager......................");
              //javax.transaction.UserTransaction userTx = (javax.transaction.UserTransaction)ctx.lookup("javax.transaction.UserTransaction");
              javax.transaction.TransactionManager transactionManager = (javax.transaction.TransactionManager)ctx.lookup("javax.transaction.TransactionManager");
              System.out.println("After Lookup TransactionManager......................");
    try{
                   transactionManager.begin();
                   Transaction transaction = transactionManager.getTransaction();
                   System.out.println("Transaction Object ----------------------------->"+transaction);
    XAConnection xaConFirst = getFirstXAConnection();
    XAResource xaResourceFirst = xaConFirst.getXAResource();
    System.out.println("xaResourceFirst Object ----------------------------->"+xaResourceFirst);
    XAConnection xaConSecond = getSecondXAConnection();
    XAResource xaResourceSecond = xaConSecond.getXAResource();
    System.out.println("xaResourceSecond Object ----------------------------->"+xaResourceSecond);
    if(!xaResourceFirst.isSameRM(xaResourceSecond) )
    System.out.println("<-----------------BOTH THE RESOURCES ARE NOT SAME SMAE SAME----------------------------->");
    boolean firstEnlistBool = transaction.enlistResource(xaResourceFirst);
    System.out.println("firstEnlistBool ----------------------------->"+firstEnlistBool);
    boolean secondEnlistBool = transaction.enlistResource(xaResourceSecond);
    System.out.println("secondEnlistBool -------------------------> "+secondEnlistBool);
    java.sql.Connection firstConn = xaConFirst.getConnection();
    Statement stmt = firstConn.createStatement();
    stmt.executeQuery("insert into dept values(60,'MARKETING','NEW DELHI')");
    java.sql.Connection secondConn = xaConSecond.getConnection();//xaConFirst.getConnection();//
    stmt = secondConn.createStatement();
    //stmt.executeQuery("insert into account values(20,20)");
    stmt.executeQuery("insert into salgrade values(10,10,10)");
    if(Status.STATUS_ACTIVE == transactionManager.getStatus() )
    System.out.println("Before committing status "+transactionManager.getStatus() );
    transactionManager.commit();
    System.out.println("After committing");
              } catch(SQLException sqlE){
                        sqlE.printStackTrace();
                        catch(Exception e){
                                            e.printStackTrace();
         } catch (Exception ex) {
              ex.printStackTrace();
              finally {
                   try {
                        ctx.close();
                        catch (Exception e) {
                             e.printStackTrace();
                   } // close finally
    %>
    <form method="post">
    <input type="submit" name="submit" value="Call Transaction Bean">
    </form>
    </html>
    <-------------------------------------------------------------------------------->
    please help in this..I am stuck with this and dont kow how to move ahead to remove this problem..
    Best Regards
    Akhil Nagpal

    Hi,
    Hi Vicky,
    I think we are in different time zones. I am south
    korea.I have tried your suggestion but it gives me
    the same exception.Yes ,there is a difference of 3.5 hours , I am in India(Mumbai).
    This is what i am trying to achieve.
    My aim is to create some aplication to which i can
    register my XADataSources and this application should
    be able to handle the distributed transactions among
    them.I will be using the TransactionManager of some
    application server.SO i am using weblogic7.0.
    For the testing purpose i have creaed a jsp as i
    i posted the code. I am very new to this JTA and may
    be i am doing wrong.Can you help me this but putting
    insights into your experience may be that will
    increase my enthusiasm :-) ....
    please help me in this.
    I am extracting the following from the docs
    public interface TransactionManager
    The TransactionManager interface defines the methods that allow an application server to manage transaction boundaries.
    public interface UserTransaction
    The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries
    So as per your specs I can understands your application is trying to explicitily control the boundaries of the transaction, so you should use the UserTransction instance to begin the Transaction.My understanding says the TransactionManager will come in picture for declarative transaction and UserTransaction for the your case.I think you have tried that , I would have tried this out here but I dont work on weblogic.Do the things cooly and try to understand the concept.Let me know of the results.
    Regards
    Vicky

  • LDAP + SSL + tomcat- Please help!

    Please help I searched the whole site, i m new to JNDI, Security and E-directory, all I got was confusion, and lots of exception.
    Here's my problem, I trying to run a web application on tomcat web server. I have a login.html, for users to login to my application. Currently all username and password are stored Novell e-directory. Currently I have the following Code.
    <%@page import="javax.naming.*"%>
    <%@page import="javax.naming.directory.*"%>
    <%@page import="java.util.*"%>
    <%@page import=" java.lang.*"%>
    <%@page import="java.security.*"%>
    <%
    String uid = request.getParameter("user");
    // Set up the environment for creating the initial context
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://10.1.1.199:636/o=hcfhe");
    env.put(Context.SECURITY_PRINCIPAL, "cn=ldapbrowse, ou=it, o=hcfhe");
    env.put(Context.SECURITY_CREDENTIALS, "ldapbrowse");
    env.put(Context.SECURITY_PROTOCOL,"ssl");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put("java.naming.ldap.factory.socket","javax.net.ssl.SSLSocketFactory");
    env.put("java.naming.ldap.version","3");
    System.setProperty("javax.net.ssl.keyStore", "c://j2sdk1.4.0//jre//lib//security//cacerts");
    System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
    System.setProperty("javax.net.ssl.trustStore", "c://j2sdk1.4.0//jre//lib//security//cacerts");
    System.setProperty("javax.net.debug","all");
    // Create the initial context
    try {
    DirContext ctx = new InitialDirContext(env);
    System.out.println("Is it binding..................");
    SearchControls ctls = new SearchControls();
    ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    NamingEnumeration results = ctx.search("", "(cn="+ uid +")", ctls);
    SearchResult sr = (SearchResult)results.nextElement();
    String dn = sr.getName();
    //String mycon = ((SearchResult)answer.next()).getName();
    System.out.println("DN" + dn);
    // ... do something useful with ctx
    if(dn != null) {
    response.sendRedirect("index2.html");
    ctx.close();
    } catch (NamingException e) {
    System.err.println("Problem getting attribute:" + e);
    e.printStackTrace();
    %>
    I am trying to authenticate my users over SSL to e-directory, and HERE'S where i am totally lost(BTW i can connect to my LDAP directory without SSL. My Network adminsistrator has given me a certificate from the server called SSLMASTER.DER, which I tried install in file called CACERTS in java_home\jre\lib\security using keytool. An it seems like its there using keytool -list command.
    and edited the server.xml:
    <Connector className="org.apache.tomcat.service.PoolTcpConnector">
    <Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
    <Parameter name="port" value="8443"/>
    <Parameter name="socketFactory" value="org.apache.tomcat.net.SSLSocketFactory"/>
    <!--<Parameter name="keystore" value="C:/jakarta-tomcat-3.2.4/conf/.keystore" />-->
    <Parameter name="keystore" value="C:/j2sdk1.4.0/jre/lib/security/cacerts" />
    <Parameter name="keypass" value="changeit"/>
    <Parameter name="clientAuth" value="true"/>
    </Connector>
    Now I start re-start tomcat, and type in the following URL
    http://localhost:8080/college_register/uk/ac/havering-college/index122.html, then i enter the username and password, when submitted it goes to the above java code or even if i do https://localhost:8443/college_register/uk/ac/havering-college/index122.html. I still get the error below.
    javax.naming.CommunicationException: simple bind failed: 10.1.1.199:636. Root e
    xception is javax.net.ssl.SSLHandshakeException: Couldn't find trusted certifica
    te
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(DashoA62
    75)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
    at com.sun.jndi.ldap.Connection.writeRequest(Connection.java:385)
    at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:309)
    at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:168)
    at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2516)
    at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:263)
    at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.jav
    a:76)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    62)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    at javax.naming.directory.InitialDirContext.<init>
    please tell me what else i need to do.

    Get a copy of your ldap server's public certificate. Use keytool to import (and create) that cert into a truststore. Configure the ssl props to use the new truststore.

  • HI Please Help me with Zoom of a buffered image

    Hi All,
    Please help,
    I want to zoom the buffered image using Affine Transforms, the code shown below can rotate the buffered image now how to zoom the same buffered image using Affine Transforms.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    public class RotationBounds extends JPanel implements ActionListener
        BufferedImage image;
        AffineTransform at = new AffineTransform();
        Rectangle2D.Double bounds = new Rectangle2D.Double();
        double theta = 0;
        double thetaInc = Math.PI / 2;
        public void actionPerformed(ActionEvent e)
            theta += thetaInc;
            setTransform();
            repaint();
        private void setTransform()
            int iw = image.getWidth();
            int ih = image.getHeight();
            double cos = Math.abs(Math.cos(theta));
            double sin = Math.abs(Math.sin(theta));
            double width = iw * cos + ih * sin;
            double height = ih * cos + iw * sin;
            double x = (getWidth() - iw) / 2;
            double y = (getHeight() - ih) / 2;
            at.setToTranslation(x, y);
            at.rotate(theta, iw / 2.0, ih / 2.0);
            x = (getWidth() - width) / 2;
            y = (getHeight() - height) / 2;
            // Set bounding rectangle that will frame the image rotated
            // with this transform. Use this width and height to make a
            // new BuffferedImage that will hold this rotated image.
            // AffineTransformOp doesn't have this size information in
            // the translation/rotation transform it receives.
            bounds.setFrame(x - 1, y - 1, width + 1, height + 1);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            setBackground(Color.gray);
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
            if (image == null)
                initImage();
            g2.drawRenderedImage(image, at);
            // g2.setPaint(Color.blue);
            g2.draw(bounds);
            g2.setPaint(Color.green.darker());
            g2.fill(new Ellipse2D.Double(getWidth() / 2 - 2,
                getHeight() / 2 - 2, 4, 4));
        private void initImage()
            int w = 360, h = 300;
            image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = image.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(new Color(220, 240, 240));
            g2.fillRect(0, 0, w, h);
            g2.setPaint(Color.red);
            g2.drawString("Text for test", 50, 50);
            g2.drawRect(0, 0, w - 1, h - 1);
            g2.dispose();
            g2.setTransform(at);
    //        setTransform();
        private JPanel getLast()
            JButton rotateButton = new JButton("Rotate");
            rotateButton.addActionListener(this);
             JButton zoomButton = new JButton("Zoom");
            JPanel panel = new JPanel();
            panel.add(rotateButton);
            panel.add(zoomButton);
            return panel;
        public static void main(String[] args)
            RotationBounds test = new RotationBounds();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test);
            f.getContentPane().add(test.getLast(), "North");
            f.setSize(400, 400);
            f.setLocation(0, 0);
            f.setVisible(true);
    }Message was edited by:
    New_to_Java

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.util.Hashtable;
    import javax.swing.*;
    import javax.swing.event.*;
    public class RotationZoom extends JPanel {
        AffineTransform at = new AffineTransform();
        Point2D.Double imageLoc = new Point2D.Double(100.0, 50.0);
        Rectangle2D.Double bounds = new Rectangle2D.Double();
        BufferedImage image;
        double theta = 0;
        double scale = 1.0;
        final int PAD = 20;
        public RotationZoom() {
            initImage();
        public void addNotify() {
            super.addNotify();
            setTransform();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            g2.drawRenderedImage(image, at);
            g2.setPaint(Color.red);
            g2.draw(bounds);
        public Dimension getPreferredSize() {
            return new Dimension((int)(imageLoc.x + Math.ceil(bounds.width))  + PAD,
                                 (int)(imageLoc.y + Math.ceil(bounds.height)) + PAD);
        private void update() {
            setTransform();
            revalidate();
            repaint();
        private void setTransform() {
            int iw = image.getWidth();
            int ih = image.getHeight();
            double cos = Math.abs(Math.cos(theta));
            double sin = Math.abs(Math.sin(theta));
            double width  = iw*cos + ih*sin;
            double height = ih*cos + iw*sin;
            at.setToTranslation(imageLoc.x, imageLoc.y);
            at.rotate(theta, scale*iw/2.0, scale*ih/2.0);
            at.scale(scale, scale);
            double x = imageLoc.x - scale*(width - iw)/2.0;
            double y = imageLoc.y - scale*(height - ih)/2.0;
            bounds.setFrame(x, y, scale*width, scale*height);
        private void initImage() {
            int w = 240, h = 180;
            int type = BufferedImage.TYPE_INT_RGB;
            image = new BufferedImage(w,h,type);
            Graphics2D g2 = image.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setBackground(new Color(220,220,240));
            g2.clearRect(0,0,w,h);
            g2.setPaint(Color.red);
            g2.draw(new CubicCurve2D.Double(0, h, w*4/3.0, h/4.0,
                                            -w/3.0, h/4.0, w, h));
            g2.setPaint(Color.green.darker());
            g2.draw(new Rectangle2D.Double(w/3.0, h/3.0, w/3.0, h/3.0));
            g2.dispose();
        private JPanel getControls() {
            JSlider rotateSlider = new JSlider(-180, 180, 0);
            rotateSlider.setMajorTickSpacing(30);
            rotateSlider.setMinorTickSpacing(10);
            rotateSlider.setPaintTicks(true);
            rotateSlider.setPaintLabels(true);
            rotateSlider.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    int value = ((JSlider)e.getSource()).getValue();
                    theta = Math.toRadians(value);
                    update();
            rotateSlider.setBorder(BorderFactory.createTitledBorder("theta"));
            int min = 50, max = 200, inc = 25;
            JSlider zoomSlider = new JSlider(min, max, 100);
            zoomSlider.setMajorTickSpacing(inc);
            zoomSlider.setMinorTickSpacing(5);
            zoomSlider.setPaintTicks(true);
            zoomSlider.setLabelTable(getLabelTable(min, max, inc));
            zoomSlider.setPaintLabels(true);
            zoomSlider.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    int value = ((JSlider)e.getSource()).getValue();
                    scale = value/100.0;
                    update();
            zoomSlider.setBorder(BorderFactory.createTitledBorder("scale"));
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            panel.add(rotateSlider, gbc);
            panel.add(zoomSlider, gbc);
            return panel;
        private Hashtable getLabelTable(int min, int max, int inc) {
            Hashtable<Integer,JComponent> table = new Hashtable<Integer,JComponent>();
            for(int j = min; j <= max; j += inc) {
                JLabel label = new JLabel(String.format("%.2f", j/100.0));
                table.put(new Integer(j), label);
            return table;
        public static void main(String[] args) {
            RotationZoom test = new RotationZoom();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(test));
            f.getContentPane().add(test.getControls(), "Last");
            f.setSize(500,500);
            f.setLocation(200,100);
            f.setVisible(true);
    }

  • OC4J Hanging!!!! Urgent Please help

    Hi,
    We have deployed EJB's on OC4J 1.0.2.2. And the Java Client would be invoked from UNIX schedular, which intrun work with EJB. The UNIX schedular would invoke many Java client based on the time at given point it could be around 20 clients making request to EJB. But after few hours say(2 hrs), the OC4J stops responding and HANGS!!!!!!!!!.
    We get following error if I try to invoke any client.
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Operation timed out: connect; nested exception is
    java.net.ConnectException: Operation timed out: connect
    at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:125)
    at javax.naming.InitialContext.lookup(Unknown Source)
    I am able to get InitialContext but not able to lookup the EJB. OC4J is either dead or not serving any request.
    Can anyone help, why OC4J still listens on RMI port when it can not service the look-up? Or there is no relationship with LISTEN on port and Service.
    This is done on the production server... Request please
    help....
    Regards
    Arun

    Avi,
    Please find snippet of my ServiceLocator---
    private BatchServiceLocator() throws ServiceLocatorException
              System.out.println("Getting into the constructor...:" );
              String fileLocation = null;
              FileInputStream fis = null;
              try
                   // Instanciates Logger
                   log = Logger.getLogger(getClass());
                   // Instanciates cache which will store home interfaces of EJB's
              hm = new HashMap();
              // Load JNDI properties file
                   fileLocation = System.getProperty(BATCH_PROPERTIES_FILE_LOCATION);
                   log.debug("FileLocation :" + fileLocation);
                   fis = new FileInputStream(fileLocation);
                   batchproperties = new Properties();
                   batchproperties.load(fis);
                   if(log.isDebugEnabled())
                        log.debug("Properties file loaded.");     
                   Getting InitialContextFactory
                   System.out.println(batchproperties);
                   String InitialContextFactory = batchproperties.getProperty("INITIALCONTEXTFACTORY");
                   String URL = batchproperties.getProperty("URL");
                   String USER_NAME = batchproperties.getProperty("USER");
                   String PASSWORD = batchproperties.getProperty("PASSWORD");
                   Hashtable env = new Hashtable();
                   env.put(Context.INITIAL_CONTEXT_FACTORY, InitialContextFactory);
                   env.put(Context.SECURITY_PRINCIPAL, USER_NAME);
                   env.put(Context.SECURITY_CREDENTIALS, PASSWORD);
                   env.put(Context.PROVIDER_URL, URL);
                   System.out.println("hashtable = " + env);
                   ctx = new InitialContext(env);
                   System.out.println("ctx:"+ ctx);
              catch(Exception e)
                   e.printStackTrace();
                   throw new ServiceLocatorException("Context properties file could not be loaded");
              finally
                   if (fis != null)
                   try
                        fis.close();
                        fis = null;
                   catch(Exception e)
                        log.warn("File Input stream not closed");
         public static BatchServiceLocator getInstance() throws ServiceLocatorException
              System.out.println("getInstance:BatchServiceLocator");
              if (instance == null)
                   instance = new BatchServiceLocator();
              return instance;
    This is singleton but not thread safe. This should not matter beacuse we invoke the Batch Client from UNIX shell script using "java -jar <module>BatchClient.jar". This essentially means ServiceLocator is for this client and JVM is different. Another client will invoke with another JVM, once end of the execution the Context is removed.
    But I got solution when I made ServiceLocator thread safe using Synchronization. I am not clear on the Thread playing spoil sport in Client JVM.
    Any thoughts are welcome.
    Regards
    Arun

  • URGENT: Jsp:Useben Not working with HashMap : Please HELP!

    Hi,
    I have a bean called DocBean (name, id - properties);
    another bean called DocListBean (in that add() will put the DocBean to a hashtable- hashtable is created in its constructor.
    the servlet creates the DocList & Doc Beans and by using add method, put all the doc in the doclist bean.
    then, i put that in the request
    req.setAttribute("doclistbean", doclistbean);
    I use System.out.println for counting the no.of docbeans in the doclist. in java file it displays
    System.out.println(docList.count() );
    (displays .. : 5)
    I have a jsp file, which has
    <jsp:useBean id="docList" class="docListBean" scope="request"/>
    then i display,
    System.out.println(docList.count() );
    this displays - 0
    I don't understand why the bean has no(size=0) docBeans(hashtable) in JSP file ; but the servlet file displays all the docBeans(hashtable) with size 5.
    Please help me..

    Probably because your servlet put it into the session with the name of "doclistbean", but your JSP tries to use it with the name of "docList".

  • Keyword Filtering please help !!!!!

    Hi all,
    I am doing my program which is a web browser with filtering funciton, it's running properly now but it have some problem with the keyword filtering function, it still not work properly. I try out a target webpage but that page still displaying...
    I suppose to save a webpage into the 'Website.txt' (I use BufferReader and BufferWritter), and compare it with the content of 'Keyword.txt'. IF the keyword are match more than 5 times then the website will be blocked.
    I set the keyword in my Keyword.txt with this word "car" and then try to access this webpage:
    http://db.gamefaqs.com/console/ps2/...t_auto_sa_h.txt
    which content a lot of word "car" ( I checked already). But at the end the page still displaying...
        String B;
        String K = null;
        String W;
        BufferedReader in = new BufferedReader(new FileReader("Banned.txt"));
        BufferedReader in0 = new BufferedReader(new FileReader("Website.txt"));
        BufferedReader in1 = new BufferedReader(new FileReader("Keyword.txt"));
        boolean found = false;
        boolean found1 = false;
    ///////// Recognize the URL Address  //////////////   
        while ((B = in.readLine()) != null) {
         if (urlText.equals(B)) {
          found = true;
          break;            
        if (found) {
         JOptionPane.showMessageDialog(null,"Website Blocked !");   
        else {
         chautaripane.go(url);
    //////// Recognize the keyword  /////////////////   
        BufferedReader inR = new BufferedReader(new InputStreamReader(url.openStream()));
        BufferedWriter buffWrite=null;
        String str;
        buffWrite=new BufferedWriter(new FileWriter("Website.txt"));
        while ((str = inR.readLine()) != null) {
              buffWrite.write(str);
                    buffWrite.flush();
                    buffWrite.close();
                    inR.close();
       int count = 0;
       int lastindex = 0;
    ////Try to compare and search the keyword
        while ((K = in1.readLine()) != null) {
            while ((W = in0.readLine()) != null) {
            if(W.indexOf(K,lastindex)!=-1)
                count++;
                lastindex=W.indexOf(K,lastindex);
      /////////// If the Keyword appear more than 5 times //////////
        if (count>=5) {
         JOptionPane.showMessageDialog(null,"Website Blocked !");
          System.out.println("found"+found1);
        else {
         chautaripane.go(url);
         System.out.println("not found"+found1);
      ///////////////// Catch exception ////////////////////// 
       } catch (MalformedURLException urlException) {
        System.out.println("Error in ActionListener for URL... ");
        urlException.printStackTrace();
       catch (FileNotFoundException e) {
       catch (IOException e) {
    );The content of my 'Keyword.txt' are
    car
    gun
    I implement this function in my 'dcToolBar' class, I have no idea why it's not working because the code seems very logic already....
    Can someone please teach me some solution, I really cry out due to this problem, PLEASE HELP ME !!!

    You may want to store that words that you want to block in memory, maybe using a patricia trie or a hashtable. I created a sample blocker application to demostrate a solution to the issue posted. Refer to 'main' on usage.
    rashid mayes
    www.astrientlabs.com
    public class WordChecker
        public static final int MAX_ALLOWED = 5;
        private Map blockedWords = new HashMap();
        public WordChecker()
        public void addBlockedWord(String text)
            HitCounter hitCounter = new HitCounter();
            hitCounter.text = text.toLowerCase();
            blockedWords.put(hitCounter.text,hitCounter);
        public void checkWord(String w) throws TooManyInstancesFoundException
            HitCounter hitCounter = (HitCounter)blockedWords.get(w.toLowerCase());
            if ( hitCounter != null )
                hitCounter.hits++;
                if ( hitCounter.hits > MAX_ALLOWED )
                    throw new TooManyInstancesFoundException(hitCounter);
        public void addBlockedWordsFromFile(File f) throws IOException
            BreakIterator bi = BreakIterator.getWordInstance();
            BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
            String line;
            int start = 0;
            int end = 0;
            while ( (line = br.readLine() ) != null )
                bi.setText(line);
                start = 0;
                end = 0;
                while ( (end = bi.next()) != BreakIterator.DONE )
                    addBlockedWord( line.substring(start,end) );
                    start = end;
        public void checkFile(File f) throws IOException, TooManyInstancesFoundException
            BreakIterator bi = BreakIterator.getWordInstance();
            BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
            String line;
            int start = 0;
            int end = 0;
            while ( (line = br.readLine() ) != null )
                bi.setText(line);
                start = 0;
                end = 0;
                while ( (end = bi.next()) != BreakIterator.DONE )
                    checkWord( line.substring(start,end) );
                    start = end;
        public static void main(String[] args)
            try
                WordChecker blocker = new WordChecker();
                blocker.addBlockedWordsFromFile(new File("g:blocked.txt"));
                blocker.checkFile(new File("g:in2.html"));           
            catch (Exception e)
                e.printStackTrace();
            System.exit(0);
    class HitCounter
        protected String text;
        protected int hits;
    class TooManyInstancesFoundException extends Exception
        public TooManyInstancesFoundException(HitCounter hitCounter)
            super("Too many instances of '" + hitCounter.text + "' have been found.");
    }

  • OUT OF MEMORY ERROR!!!! Please Help

    In my program I have to store a large amount of objects and values into a hashtable (at least 500,000), but after only 400 values are stored I get the error:
    Exception in thread "main" java.lang.OutOfMemoryErrorCan you please help me with this, its very important that I get this right
    Thank you

    I suspect that you are going to find your solution unworkable, unless you have a few Gb of RAM to spare.
    By default, the VM doesn't use all available RAM. Use the -Xmx VM switch to set the maximum heap size. Check the tooldocs that come with the SDK for greater detail.

  • Again my question: please help me!

    Win2000 JDEV902, no application server, no database just W2000 and JDEV902:
    When I follow the tutorial "OTNDeptEmpStub" and run the class:
    Example 1 - Department numbers
    [SOAPException: faultCode=SOAP-ENV:IOException; msg=Connection refused: connect; targetException=java.net.ConnectException: Connection refused: connect]
    void org.apache.soap.SOAPException.<init>(java.lang.String, java.lang.String, java.lang.Throwable)
    void oracle.soap.transport.http.OracleSOAPHTTPConnection.send(java.net.URL, java.lang.String, java.util.Hashtable, org.apache.soap.Envelope, org.apache.soap.encoding.SOAPMappingRegistry, org.apache.soap.rpc.SOAPContext)
    org.apache.soap.rpc.Response org.apache.soap.rpc.Call.invoke(java.net.URL, java.lang.String)
    java.lang.String[] IOTNDeptEmpStub.getDeptNoArray()
    void Class1.main(java.lang.String[])
    Process exited with exit code 0.
    ======================================
    What's wrong??
    Please help, thanks Stephan

    This unfortunately is another problem ... the Web service is up but the re-deployment resulted in the incorrect WSDL being deployed. If you look in your stub, you will see a line that looks like the following:
    public String endpoint = "http://otn.oracle.com:7790/ws/deptemp"
    If you replace this URL with the following:
    public String endpoint = "http://otn.oracle.com/ws/deptemp"
    it should work fine.
    Today I just am in the midst of putting out the WSDL fixes and have updated the tutorial(s) to use a correct version of the WSDL. These changes will be out tonight or early tomorrow.
    Apologies for the inconvenience.
    Mike.

  • JNDI Error Please help any one..Urgent

    Hi
    I'm new to Websphere. I deployed a session bean in Websphere. I have written a client program too. Client is unable to connect to the server.
    Is there any particular sequence of steps which we should folllow so that the client program can connect to server successfully. If anybody knows those steps please help me.
    I'm pasting the Client code below.
    thanx
    Ramu
    package naveen;
    import java.io.*;
    import java.util.*;
    import javax.naming.*;
    public class HelloClient{
    public static void main(String a[]) throws Exception{
    System.out.println("Hello Client Main Method Called...");
    Hashtable h=new Hashtable();
    h.put(Context.PROVIDER_URL,"iiop:///");
    h.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
    System.out.println("Hello Client before context intialization...");
    Context ctxt=new InitialContext(h);
    System.out.println("Hello Client after context initialization...");
    Object o=ctxt.lookup("HelloJndi");
    HelloHome hh=(HelloHome)o;
    HelloRemote hr=hh.create();
    System.out.println(hr.sayHello());
    This program's output is it's printing "Before context intialization"
    After that error message
    I am giving that error message also:
    WSCL0100E: Exception received: java.lang.reflect.InvocationTargetException: java
    x.naming.CommunicationException: Caught CORBA.COMM_FAILURE when resolving initia
    l reference=WsnNameService. Root exception is org.omg.CORBA.COMM_FAILURE: min
    or code: 3 completed: No
    at com.ibm.CORBA.iiop.HTTPConnection.send(HTTPConnection.java:439)
    at com.ibm.CORBA.iiop.HTTPConnection.locate(HTTPConnection.java:659)
    at com.ibm.CORBA.iiop.GIOPImpl.locate(GIOPImpl.java:172)
    at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1
    016)
    at com.ibm.CORBA.iiop.InitialNamingClient.resolve(InitialNamingClient.ja
    va:372)
    at com.ibm.CORBA.iiop.InitialNamingClient.cachedInitialReferences(Initia
    lNamingClient.java:591)
    at com.ibm.CORBA.iiop.InitialNamingClient.resolve_initial_references(Ini
    tialNamingClient.java:355)
    at com.ibm.CORBA.iiop.ORB.resolve_initial_references(ORB.java:1753)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInit
    CtxFactory.java:566)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCt
    xFactory.java:328)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtx
    Factory.java:200)
    at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(W
    snInitialContextFactory.java:80)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    69)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:199)
    at naveen.HelloClient.main(HelloClient.java:18)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.ibm.websphere.client.applicationclient.launchClient.createContain
    erAndLaunchApp(launchClient.java:430)
    at com.ibm.websphere.client.applicationclient.launchClient.main(launchCl
    ient.java:288)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158)

    hi,
    I havent worked with WebSphere but I think you are not giving the url and port number when you mentioned the ProviderURL...

  • 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

  • Problem with threads and simulation: please help

    please help me figure this out..
    i have something like this:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DrawShapes extends JApplet{
         private JButton choices[];
         private String names[]={"line", "square", "oval"};
         private JPanel buttonPanel;
         private DrawPanel drawingArea;
         private int width=300, height=200;
         public void init(){
              drawingArea=new DrawPanel(width, height);
              choices=new JButton[names.length];
              buttonPanel=new JPanel();
              buttonPanel.setLayout(new GridLayout(1, choices.length));
              ButtonHandler handler=new ButtonHandler();
              for(int i=0; i<choices.length; i++){
                   choices=new JButton(names[i]);
                   buttonPanel.add(choices[i]);
                   choices[i].addActionListener(handler);
              Container c=getContentPane();
              c.add(buttonPanel, BorderLayout.NORTH);
              c.add(drawingArea, BorderLayout.CENTER);
         }//end init
         public void setWidth(int w){
              width=(w>=0 ? w : 300);
         public void setHeight(int h){
              height=(h>=0 ? h : 200);
         /*public static void main(String args[]){
              int width, height;
              if(args.length!=2){
                   height=200; width=300;
              else{
                        width=Integer.parseInt(args[0]);
                        height=Integer.parseInt(args[1]);
              JFrame appWindow=new JFrame("An applet running as an application");
              appWindow.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              DrawShapes appObj=new DrawShapes();
              appObj.setWidth(width);
              appObj.setHeight(height);
              appObj.init();          
              appObj.start();
              appWindow.getContentPane().add(appObj);
              appWindow.setSize(width, height);
              appWindow.show();
         }//end main*/
         private class ButtonHandler implements ActionListener{
              public void actionPerformed(ActionEvent e){
                   for(int i=0; i<choices.length; i++){
                        if(e.getSource()==choices[i]){
                             drawingArea.setCurrentChoice(i);
                             break;
    }//end class DrawShapes
    class DrawPanel extends JPanel{
         private int currentChoice=-1;
         private int width=100, height=100;
         public DrawPanel(int w, int h){
              width=(w>=0 ? w : 100);
              height=(h>=0 ? h : 100);
         public void paintComponent(Graphics g){
              super.paintComponent(g);
              switch(currentChoice){
                   case 0:     g.drawLine(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 1: g.drawRect(randomX(), randomY(), randomX(), randomY());
                             break;
                   case 2: g.drawOval(randomX(), randomY(), randomX(), randomY());
                             break;
         public void setCurrentChoice(int c){
              currentChoice=c;
              repaint();          
         private int randomX(){
              return (int) (Math.random()*width);
         private int randomY(){
              return (int) (Math.random()*height);
    }//end class drawPanel
    That one's from a book. I used that code to start with my applet. Mine calls different merthod from the switch cases. Say I have:
    case 0: drawStart(g); break;
    public void drawStart(Graphics g){
      /* something here */
    drawMain(g);
    public void drawMain(graphics g){
    g.drawString("test", x, y);
    //here's where i'm trying to pause
    //i've tried placing Thread.sleep between these lines
    g.drawLine(x, y, a, b);
    //Thread.sleep here
    g.drawRect(x, y, 50, 70);
    }I also need to put delays between method calls but I need to synchronize them. Am I doing it all wrong? The application pauses or sleeps but afterwards, it still drew everything all at once. Thanks a lot!

    It is. Sorry about that. Just answer any if you want to. I'd appreciate your help. Sorry again if it caused you anything or whatever. .n_n.

  • Apple Mini DVI to Video Adapter is not working. Please Help...

    I bought an Apple Mini DVI to Video Adapter to connect my Macbook to a TV using normal video cable. When I connect the cable, my Laptop DIsplay gives a flickr once and then it shows nothing. I checked Display in the system preference where I don't get a secondary monitor option. My TV is panasonic and it's an old one. I work on Final Cut Pro and it's very very important to see my videos on a TV. What am I doing wrong with the connection? Anyone Please Please help...

    Your probably not doing anything wrong. There are thousands of users with Similar issues and it seems to be with many different adapters.
    We have Mini DP to VGA (3 different brands) and they all fail most of the time. This seems more prevalent with LCD Projectors. I've tested some (50+) with VGA Monitor (HP) and they all worked, LCD Projector (Epson, Hitachi, and Sanyo) and they all fail, DLP Projector (Sanyo) and one worked.
    My Apple Mini DP to DVi works most of the time. My Mini DP to HDMI (Generic non Apple) works every time.
    The general consensus is that Apple broke something in the OS around 10.6.4 or 10.6.5 and its not yet fixed. As we are a school we have logged a case with the EDU Support group so will see what happens.
    Dicko

Maybe you are looking for

  • Mail interface now in German language, not English

    Hi, As of this morning Mail has decided to make everything in German (all menus, dialogue boxes, windows etc.). All other programs are in English as they should be. In my System Prefs I have English set as the top language in the International pane.

  • Text_IO.put_Line

    Hi, Forms 6i. I used: Text_IO.put_Line(out_file,'blablabla...'); Text_IO.put_Line(out_file,'blablabla...'); Always that i used "Text_IO.put_Line" it creates caracter new line. How I make it not to create this to caracter in the end? Regards Jomar

  • Insert and delete same record from database immediately

    Hi, I am using Tomcat 4.1.12 and Oracle 9i. Since there is no transaction management in tomcat, except via third party tools, i have to do the following to simulate transaction management :- insert a particular record <some other problem occured so m

  • Aperture  migration file size limit?

    I have been able to load a library of 19gb into Lightroom. However I have several libraries of over 100gb and I can't load them. After Lightroom analyzes the film to be imported it doesn't come up with the photo count. Without the count it gives an e

  • Organise Music in itunes

    I have just bought a new laptop and transferred all my music from the old computer by copying the "My music" folder and then pasting it in the same folder in the new laptop. I was using itunes in my old computer but the music was very unorganised and