New to Sun and Solaris

Hello all. I am currently a Sr. System Administrator right now for IBM AIX and SCO UNIX OS systems and I am wanting to start learning the Sun Solaris OS and getting familiar with that in hopes to become a System Administrator for those OS as well. I know zero about Solaris or Sun right now other than what I have read about.
Anybody have suggestions on how I start learning Sun Solaris? I see Solaris 10 is a free download for x86 platforms. I was going to install that on my laptop as a dual boot for Solaris 10 and my current laptop Windows XP OS. Would that be a good start in learning Sun Solaris system? Would anybody recommend taking the training courses that Sun provides or would that be a waste of time? Most of the AIX and SCO UNIX OS I come to know and master is from learning on my own and later on taking some advanced admin courses in that.
My company is thinking changing to Sun Solaris OS and servers to replace the SCO UNIX servers so I just wanted to know any suggestions on how to get familiar with where I can get to the point of install, setup, admin Solaris servers. Thanks!

hi " mmitguy "
while I can't comment on
in hopes to become a System Administrator for those OS as well
part but I would like to respond on dual boot part, as I've installed Solaris 10 with Win XP recently on a single HD of my Dell 9150 Desktop. First I backed up all my data & tried to resize (using Partition Magic 8) existing Win XP partition (there was only one) & create new partition but it failed & I had to re-install Win XP.
So I would recommend first to make sure that u have Win XP installation disk & driver / utility installation disk available. And after backing all ur data from ur laptop re-install Win XP & while re-installing create 2 partitions. Install Win XP & install display / graphics card, modem, network etc drivers.
Installing Solaris 10: I downloaded Solaris 10 11/06 from Sun & burnt a DVD & ran into lots of problems so i posted this:
http://forum.java.sun.com/thread.jspa?threadID=5137821&tstart=15
After that, some one from this same forum suggested to install Solaris Express Developers Edition 02/07 instead. ( http://developers.sun.com/solaris/downloads/solexpdev/download.jsp )
I re-installed Solaris, this time Dev Edition 02/07 and that was very, very simple compare to Solaris 10 11/06.
Good Luck!
- Jags Desai

Similar Messages

  • How can i identyfy the Versions of Sun and Solaris

    is it Sun OS 5.5.1 equveleant solaris 8. What i would like to know is if a patch is released for solaris 8 operating system from sun alerts do they have to be applied to sun os 5.5.1. Is the Sun OS 5.5.1 still supported and the patches been released.
    How do i find the equvalent version a document on the web says Sun OS 5.5.1 is equvalant to solaris 2.5.1 , how is it related. Please advice.
    Thanks
    Ravi

    InfoDoc #46808 from the Archived Collection lists the versions of Solaris/SunOS and kernel (unfortunately starting with Solaris 2.6).
    This InfoDoc contains a pointer to InfoDoc #21202 for further explanation.
    http://sunsolve.sun.com/search/document.do?assetkey=1-9-46808-1&searchclause=%22Solaris%20version%22
    I forwarded a more complete list as a PDF file to SunSolve about 1 1/2 years ago. Unfortunately they weren't able to process PDF files ...
    Robert, if your email account @....edu.au is still valid, I can forward the file (about 50K) to you. In the meantime I added Solaris 9 0/05 upto Solaris 10 6/06 to my list. The listed initial kernel patch revisions are only for SPARC (like in the original InfoDoc).
    MAAL

  • Sun Crypto 1000 and Solaris 10

    hi,
    I have some "Sun Crypto Accelerator 1000" cards.
    Is it possible to run it on Solaris 10 w/ Web servers 6 or 7 ???
    --mpech                                                                                                                                                                                                                                                               

    Sun PCI 3 runs fine with Solaris 10 - running on SB2500 with PCI3. Running Win2K and RH Linux.
    I cannot recall any problem with the exception that the driver files were not there for solaris 10. Resolved by the following (google news groups for SunPCI and Solaris 10).
    1) install the SunPCI software
    2) Create the following links with the "ln -s" command(as root) for solaris 10.
    lrwxrwxrwx 1 root root 13 Mar 8 2005 sunpcidrv.2100 ->
    sunpcidrv.290*
    lrwxrwxrwx 1 root root 16 Mar 8 2005 sunpcidrv.2100.64
    -> sunpcidrv.290.64*
    The links are in /opt/SUNWspci3/drivers/solaris directory. My existing SUNPCI3 PC+Linux file systems moved over from Solaris 9 with no issues when starting up with Solaris 10.
    As for upgrading to Solaris 10 from 9, 10 seems to have a bigger filesystem space requirement. I re-partioned my disks with a larger root partion and did a clean install rather than perform the upgrade.
    Also note on the Solaris 10 upgrade you need to get to grips with the new SMF. A man of inetconv(1M) will get you going and there is lots of help on the news groups.
    Best of Luck.
    Jon.

  • Vista and Solaris 10, are they compatible?

    I have attempted to follow dual boot guides found everywhere, but none tailor specifically to (or eve mention) Vista. This is a problem, because Vista does not use the same method of boot as previous versions of NT.
    So far, in my many failed attempts at creating a Vista dual boot, I have experienced this:
    When I install Solaris 10 on any partition (Solaris installs correctly and works great), and then attempt to install Windows Vista, Vista says all of my partitions do not meet its requirements for installation (that the drive is NTFS and at least 12 GB is all it tells me). Even after formatting, deleting, recreating, and reformatting a drive, the drive is still unusable. Only after deleting ALL drives, including Solaris 10, and recreating and brand new first partition does Vista allow me to install. If I create a partition that Vista allows me to use, and also a partition to use with Solaris, and THEN install Solaris, the partition that Vista liked can no longer be used!
    When I install Windows Vista first (and it works fine) (which is what I tried first and reasoned is what I should be doing), and then install Solaris 10 on a partition (it installs correctlt and works great), I load up my computer and go into the GRUB bootloader. I can select Windows. However, when attempting to load windows, I get an error (in the Vista font by the way) that says my operating system cannot be loaded. When I load my Vista install disc, it cannot find any installations of windows, and it cannot repair the master boot record, saying something like the filesystem is corrupt. However, just as an experiment, I loaded Vista onto the former Solaris drive, and looked at my first partition. Every file was there, intact.
    I have attempted this with Windows Home Premium 32 bit, Windows Business 32 bit, and Vista Ultimate x64. I don't want to believe that it's impossible to load Vista and Solaris simultaneously, I've seen as much stating its impossibility as I've seen documents telling me how to do it (<- cold irony).
    As long as I can get AN INSTALLATION of Solaris 10 on my machine at the same time I have Vista able to boot, I'm fine, but I seem to have lost on all fronts.
    Edited by: ZetaZeta on Sep 19, 2007 12:30 AM

    In Solaris Express, this is not an issue, according to this weblog:
    http://blogs.sun.com/moinakg/entry/solaris_vista_dual_boot_conclusion
    For versions of Solaris Express prior to buid 70, this method was described for creating a dual-boot with the oh-too-picky Windows Vista:
    http://linux.wordpress.com/2007/02/17/vista-and-solaris-express-dual-boot/
    I am going to assume that setting up a dual-boot with Solaris 10 is similar to, if not the same as, Solaris Express, since the only steps specific to Solaris are the files I copy from Solaris.
    I hope this helps anyone else with a problem similar to mine.

  • Broken pipe - Sun T2000, Solaris 10

    Hi,
    I have some problems..
    So, there's one system I'm working with. It's made of 2 parts (both written in Java):
    - "normal" application, that works as a business logic server,
    - web application (build on Turbine framework, running on a Resin Application Server) - it works as a presentation layer,
    These 2 parts are connected via TCP/IP socket connection - we use an ObjectOutputStream.
    It normally works just fine (it's running on several different systems), but recenlty it has been installed on a new server machine and it's started to throw strange exceptions. Below there are informations about server machine, exceptions and code making connections.
    We think, that It may be a problem with configuration of Solaris kernel or TCP/IP stack, but have no idea how to fix it.
    SERVER CONFIGURATION:
    Machine: Sun T2000
    System: Solaris 10
    JVM: 1.4 or 1.5 (both were tested)
    EXCEPTION:
    ERROR 2006-11-28 11:28:59,377 [pl.com.ttsoft.vixen.currentday.server.ClientServiceThread] - IOException while sending data to the client. Closing output stream.
    java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1682)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1591)
    at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1401)
    at java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:371)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.sendMessageToClient(ClientServiceThread.java:679)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.sendModificationData(ClientServiceThread.java:432)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.serveDataModification(ClientServiceThread.java:308)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.run(ClientServiceThread.java:185)
    ERROR 2006-11-28 11:28:59,400 [pl.com.ttsoft.vixen.currentday.server.ClientServiceThread] - IOException while closing client connection.
    java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1682)
    at java.io.ObjectOutputStream$BlockDataOutputStream.flush(ObjectOutputStream.java:1627)
    at java.io.ObjectOutputStream.flush(ObjectOutputStream.java:666)
    at java.io.ObjectOutputStream.close(ObjectOutputStream.java:687)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.closeClientConnection(ClientServiceThread.java:706)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.sendMessageToClient(ClientServiceThread.java:691)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.sendModificationData(ClientServiceThread.java:432)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.serveDataModification(ClientServiceThread.java:308)
    at pl.com.ttsoft.vixen.currentday.server.ClientServiceThread.run(ClientServiceThread.java:185)
    STANDALONE APPLICATION CODE:
    /* i've simplified it */
    /* OPENING CONNECITON */
              Socket socket = = new Socket(hostName, hostPort);
              ObjectOutputStream outStream = new ObjectOutputStream( socket.getOutputStream() );
              ClientDescriptor clientDescriptor =
                new ClientDescriptor(socket, outStream, info.getLogin(), info.getSystem(),
                    info.getDay(), info.getCurrentDaySessionId());
    /* SENDING DATA */
         private boolean sendMessageToClient( MessageDTO messageDTO, ClientDescriptor clientDescriptor )
              throws CurrentDayException {
              logger.info( "sendMessageToClient " + messageDTO.getClientId() );
              ObjectOutputStream outputStream = clientDescriptor.getOutputStream();
              try {
                  outputStream.writeUnshared( messageDTO ); // THIS WRITE THROWS EXCEPTIONS
                  outputStream.flush();
              } catch ( IOException exc ) {
                logger.error( " IOException while sending data to the client. Closing output stream. ", exc );
                // close client connection
                closeClientConnection( clientDescriptor );
                return false;
            return true;       
        private void closeClientConnection( ClientDescriptor clientDescriptor ) {
            try {
                synchronized ( clientDescriptorMap ) {
                    clientDescriptor.setState( ClientDescriptor.TO_REMOVE );           
                    clientDescriptor.getOutputStream().close();
                    clientDescriptor.getSocket().close();
            } catch ( IOException exc ) {
                logger.error( " IOException while closing client connection. ", exc );
    /* WEB APPLICATION */
    /* RECIEVING DATA */
    /* it routes this data to 3-rd party applet */
            SocketChannel vixenSocket = (SocketChannel)key.channel();
            Socket clientSocket = (Socket)objClientServers.get(key);
            // read the information from the socket....
            ByteBuffer buffer = ByteBuffer.allocate(16 * 1024);
            while (vixenSocket.read(buffer) > 0) {
                buffer.flip();
                byte[] bytespassed = new byte[buffer.remaining()];
                logger.debug("buffer.remaining() (1)=" + buffer.remaining());
                buffer.get(bytespassed, 0, bytespassed.length);
                clientSocket.getOutputStream().write(bytespassed);
                buffer.compact();
            buffer.flip();
            while (buffer.hasRemaining()) { // make sure the buffer is fully readed.
                byte[] bytespassed = new byte[buffer.remaining()];
                logger.debug("buffer.remaining() (2)=" + buffer.remaining());
                buffer.get(bytespassed, 0, bytespassed.length);
                clientSocket.getOutputStream().write(bytespassed);
            buffer.clear();We think, that It may be a problem with configuration of Solaris kernel or TCP/IP stack, but have no idea how to fix it.
    Thanks for help,
    Ziemek Obel.

    Hi,
    well I'm not sure if it isn't a hardware problem - you see, this system works just fine on a Solaris 10 working on the other servers, but tends to throw exceptions on Sun T2000 machine - so I guess It may be hardware issue and someone here could help me.
    Ziemek.

  • EM 12c and Solaris Zone Monitoring

    Hi all,
    I am using Oracle EM 12c to monitor Oracle database server which run on Solaris zone, which is capped to run using only 4 cores.
    BUT the Host management home page is still showing "Total Cores" of 8 (I am using Sun T4-1).
    Is there some configuration which required to be done to reflect the number of capped CPU.
    Also is there a way to isolate the CPU, Memory, Filesystem and Network utilization to only look at the local zone?
    I suspect what I see now represent the resource utilization of the physical machine.
    Thank you.
    -Joel

    Loc,
    I've opened quite a few SRs, some handled well, some not. My biggest issue perhaps is that SRs are needed at all. We are a small shop that relied on OEM 10.2 for a long time, skipped over 11G and went right to 12R2. It was a culture shock, and I'm not sure if skipping the version added to our woes.
    There are 3 DBAs here, with Oracle experience between 13 and 18 years, we are not newbies. I took the em12c class from Oracle.
    But still, acceptance of its use has not been high, mostly because it's no longer the quick, targeted place we 'go to'. It's a huge product now, with much built-in. We are finding we need a mind adjustment to use it and the transition period related to how much time we can spend on that. Our intent, though, was to make things easier, not harder.
    Case in point is our implementation of DataGuard. This project was new to us and I made EM12C upgrade as a predecessor project because I needed its help. I ultimately abandoned it, we hired a consultant, we learned manual steps, and that's what we use today. Everything is homegrown.
    I feel as through the purpose for EM moved from a DBA monitoring tool. Remember OEM 10.2 and its initial summary page that showed the overall health of everything on one shot? I can't do that in em12c, or at least haven't found that.
    Here are some SRs:
    SR 3-6392247151
    Sr 3-7159111371
    SR 3-6645421051
    * SR 3-6608820051
    SR 3-6667182071
    * Covers "invalid objects" missing, something we previously relied on.
    Back to the original question of this post - I understand now that if we use EM to switch our databases, the role reversal will show. We would have loved to rely on EM for everything. Now that we must do everything manually, I have to then manually drop the target being monitored and re-add it. Again, something that should make our jobs easier is now harder.
    Thanks for listening. Am I really the only DBA that says EM12C is harder to use for basic functionality?
    Sherrie

  • How to add new system call in solaris ?

    Hi,
    I want to add new system call in solaris. please inform me steps for adding new system call in solaris.
    Thanks in advance,
    Mahantesh.

    Here's a Solaris 7 example I know there are others ...
    http://access1.sun.com/cgi-bin/rinfo2html?267899.faq
    I haven't seen a good example of how to support both the 32 and 63-bit environment.

  • Wu-ftpd installable for solaris 10 and solaris 9

    Hi,
    I could see only "proftpd" is available http://www.sun.com/software/solaris/freeware
    But I am looking for the "wu-ftpd" server which is compatable with Solaris 9 and Solaris 10.
    Any one help me from where I can get the "wu-ftpd" installable for solaris 9 and solaris 10 sparc server.
    thanks,
    Amudha

    Hi Robert,
    Thanks for your reply.
    I too saw that the ftp version used in solaris 10 by default is wu-ftpd, but I am not sure about it, because when I tried to ftp to my solaris box the version it is started is not "FTP server (Version wu-2.6.2(5)".
    I have got the wu-ftpd installable. But I could not get the proper document for configuring the same.
    Question1: How to stop existing ftp service and start newly instlaled wu-ftpd in Solaris 9 and Solaris 10 servers?
    Earlier solaris 8 version I change the ftpd version in /etc/inetd.conf file and give HUP signal to inetd then this new wu-ftpd version will be used.
    Question 2: It always starts the system inbuilt ftp server and also I am getting ftp log in failure for any user which I add newly or even existing users.
    could any one help to resolve these issues? Thanks in advance for your help.
    Amdudha

  • Diff between Solaris 8 and Solaris 9

    Hello Experts,
    Do we have a document which talks about the diff between Solaris 8 and Solaris 9
    I need to know what are the new featured in Solaris 9 and etc....
    Thanks in Advance.
    Sunil.

    Sadly, the difference between the early releases of Solaris 9 and the late releases of Solaris 8 isn't that big, since Sun backported a lot of the cool features in Solaris 9 to Solaris 8..
    Hence; the answer to your question depends on which Solaris 8 and which Solaris 9 releases you are talking about.
    However, a complete list of changes incoperated in the different Solaris 9 releases can be found here:
    http://docs.sun.com/app/docs/doc/817-5770/6ml72d6k9?a=view
    I guess there are similar lists for Solaris 10, which is even cooler than 8/9.
    Enjoy!
    //Magnus

  • New x2100 not loading Solaris

    I just turned on my new x2100.
    It boots, brings up a boot menu, and solaris 10 starts loading.
    Then after a while the screen goes blank except for a blinking cursor in the upper left corner. I've waited for hours, but nothing happens.
    What should I do?
    Thanks!

    Did you fix this problem?
    I have the same problem.. my server has run for almost a year an suddenly after a reboot it just hangs with a black screen and a blinking cursor.
    I have contacted SUN and they have now changed the motherboard, but that didn't help.. so I'm really looking for a smart guy/girl who can tell me what to do??

  • Linux and Solaris Clients with password policy using LDAP

    Anybody managed to get Linux (RHEL) and Solaris 9 Client authenticate against Sun Directory Server 5.2p4 using the same password policy?
    For me it looks like Linux needs attribute shadowlastchanged set to display proper Warnings, that the password will expire/needs to be changed now. On the other hand Solaris (using pam_ldap) never writes this attribute, because it's using the password policy attribute pwdchangedtime.
    Hints very wellcome!
    Can anybody confirm Solaris9 pam_unix still sets this shadow* attributes correct on any password change executed by a user?

    Hi Jeremy,
    here the answers to your questions:
    >My question is which system takes precedence over the password policy?
    Unfortunately there is no policy verification between the portal and your Sun One LDAP. So if you reset the password from the portal then only the portal password policies can be checked.
    >  If I wanted to do password resets from the Portal, does the portal then store only the password in its database?
    No, the password will be stored in the LDAP, but only if it also corresponds with the LDAP policies. If not, then you will get an error, but you will not see the real LDAP exception.
    > Also what would then happen if you tried to reset the password from the LDAP?
    The password in the LDAP does not have to fit to the Portal password policies. When you log in, the portal will only check if the password you tipped in is the new one in LDAP and will not check any policies.
    Hope this brings some light in,
    Robert

  • New Fios Customer and Extremely Disappointed

    Hello,
    I just signed on to Verizon Fios because I've heard great things, however I've been extremely disappointed in what I've experienced so far.  
    My set up for installation was Sat 1/4 between 9am-12pm.  The installer showed up late, at 12:10pm.  It then took him until 3:45pm to complete the installation- over 3.5 hours!  I have no idea why it took so long for him to come in, set me up with a dvr box and internet.  I was previously with Optimum and they were in and out with installation in 30 minutes AND they arrived within their window.   My entire morning and afternoon was gone because I had to wait around all morning because I thought he would show up before noon, and then I'm not really sure why it took him ALL afternoon to set up.
    On Sun 1/5 as I was watching tv the screen went black.  It was on mute and all of a sudden it just shut off.  So I then spent over 2 hours on the phone first with an automated lady and then two different techs trying to fix the issue, which they concluded that I need a new set top box.  The earliest time they could give me is Wed 1/8 between 8am-8pm.  
    This service window of 12 hours is absolutely beyond ridiculous!!  I have never heard of a 12 hour window before for anything!  Whenever I had an issue with Optimum, they were there the next day before 10am.  
    I cannot take an entire day off from work to sit around my apartment waiting for a guy who will probably show up at 8:10pm.  (And I do not have family or friends nearby who can take the day to sit in my apartment for me in case the guy shows up between 8a-8p)  And it's crazy that I was just set up with cable/internet on late afternnon Sat, and within 24 hours cable's not working- and now I have to wait 3 days before anyone can come fix this??
    I need my service window to be Wed 1/8 between 6:30pm - 8pm.  I'm ready to leave and go back to Optimum.
    Thank you.

    I know what you mean. I am also a new fios customer after newly 8 years with optimum. I am beyond disappointed and quite furious! The tech guys that installed my fios on 1/4/14 took 4+ hours and admitted that they are not familiar with fios all that well even though they have been working with Verizon for years. The picture quality is sub-par to optimum, I don't know if something went wrong with the installation, but I am left with extremely blurry SD channels and  slightly pixelated HD channels. If you can called that HD! I have had Tech support come over and they gave me all the excuses on under the sun and even insinuated that I am seeing things. Its really frustrating that I haven't been able to find a tech that is knowledgeable enough to fix this issue. 
    Alas a customer service rep told me to give them another chance and that he will send an experience tech to my house on Monday 1/13/14 between 9-12am. If this tech person give me any excuse short from actually checking the splitter outside my door or  switching the wires, I am going back to optimum! Fios has been a complete nightmare to say the least and I hope both our issues get fix soon.

  • JSDS 6.2 and Solaris 10 UNIX Accounts (simple,proxy)

    Hi,
    I just got my Solaris10 server-client setup working. Here's some items that may be useful to you: All I'm using LDAP for at this point is user authentication to include home directory management from the server ( NFS share and auto_fs setup in LDAP and on the client )
    My server is JSDS 6.2 ( at least, that's what Sun's Download Center id'd it as. Here's output of DBVERSION file:
    cat /var/opt/SUNWdsee/dsins1/db/DBVERSION
    Sun-ldbm/6.0(64-bit) SunOS 5.10 sparc
    ASSUMPTIONS:  You have the LDAP server installed and running and you are ready to run /usr/lib/ldap/idsconfig
    Both systems patched to latest Recommended cluster and patches shown at JSDS download site. Also, make sure CRYPT is selected during idsconfig.
    myserver: UE450
    (myserver-root: /:225)-> showrev
    Hostname: myserver
    Hostid: 1234567890
    Release: 5.10
    Kernel architecture: sun4u
    Application architecture: sparc
    Hardware provider: Sun_Microsystems
    Domain: example.com
    Kernel version: SunOS 5.10 Generic_127111-01
    myclient: SF V445
    (myclient-root: /:130)-> showrev
    Hostname: myclient
    Hostid: 1234567890
    Release: 5.10
    Kernel architecture: sun4u
    Application architecture: sparc
    Hardware provider: Sun_Microsystems
    Domain: example.com
    Kernel version: SunOS 5.10 Generic_127111-01
    ON CLIENT:
    ldapclient -v init -a proxyDN=cn=proxyagent,ou=profile,dc=example,dc=com
    -a profileName=myprofile my.svr.ip.addr:port (port if not 389)
    I was not fully qualifying proxyDN and this caused authentication failures. ( do not run ldapclient init until the following are done first )
    ON CLIENT: I edited stock pam.conf and made sure only atries active were those id'd in Sun's doc. Also, I made sure I followed same order in each section as compared to Sun's doc.
    pam.conf ( from Sun's JSDS Admin guide ) on LDAP client:
    (*ldap-client*-root: /var/tmp:213)-> cat /etc/pam.conf
    #ident "@(#)pam.conf 1.28 04/04/21 SMI"
    # Copyright 2004 Sun Microsystems, Inc. All rights reserved.
    # Use is subject to license terms.
    # PAM configuration
    # Unless explicitly defined, all services use the modules
    # defined in the "other" section.
    # Modules are defined with relative pathnames, i.e., they are
    # relative to /usr/lib/security/$ISA. Absolute path names, as
    # present in this file in previous releases are still acceptable.
    # Authentication management
    # login service (explicit because of pam_dial_auth)
    login auth requisite pam_authtok_get.so.1
    login auth required pam_dhkeys.so.1
    login auth required pam_unix_cred.so.1
    #login auth required pam_unix_auth.so.1
    login auth required pam_dial_auth.so.1
    login auth binding pam_unix_auth.so.1 server_policy
    login auth required pam_ldap.so.1
    # rlogin service (explicit because of pam_rhost_auth)
    rlogin auth sufficient pam_rhosts_auth.so.1
    rlogin auth requisite pam_authtok_get.so.1
    rlogin auth required pam_dhkeys.so.1
    rlogin auth required pam_unix_cred.so.1
    #rlogin auth required pam_unix_auth.so.1
    rlogin auth binding pam_unix_auth.so.1 server_policy
    rlogin auth required pam_ldap.so.1
    # Kerberized rlogin service
    krlogin auth required pam_unix_cred.so.1
    krlogin auth binding pam_krb5.so.1
    krlogin auth required pam_unix_auth.so.1
    # rsh service (explicit because of pam_rhost_auth,
    # and pam_unix_auth for meaningful pam_setcred)
    rsh auth sufficient pam_rhosts_auth.so.1
    rsh auth required pam_unix_cred.so.1
    rsh auth binding pam_unix_auth.so.1 server_policy
    rsh auth required pam_ldap.so.1
    # Kerberized rsh service
    krsh auth required pam_unix_cred.so.1
    krsh auth binding pam_krb5.so.1
    krsh auth required pam_unix_auth.so.1
    # Kerberized telnet service
    ktelnet auth required pam_unix_cred.so.1
    ktelnet auth binding pam_krb5.so.1
    ktelnet auth required pam_unix_auth.so.1
    # PPP service (explicit because of pam_dial_auth)
    ppp auth requisite pam_authtok_get.so.1
    ppp auth required pam_dhkeys.so.1
    #ppp auth required pam_unix_cred.so.1
    #ppp auth required pam_unix_auth.so.1
    ppp auth required pam_dial_auth.so.1
    ppp auth binding pam_unix_auth.so.1 server_policy
    ppp auth required pam_ldap.so.1
    # Default definitions for Authentication management
    # Used when service name is not explicitly mentioned for authentication
    other auth requisite pam_authtok_get.so.1
    other auth required pam_dhkeys.so.1
    other auth required pam_unix_cred.so.1
    #other auth required pam_unix_auth.so.1
    other auth binding pam_unix_auth.so.1 server_policy
    other auth required pam_ldap.so.1
    # passwd command (explicit because of a different authentication module)
    #passwd auth required pam_passwd_auth.so.1
    passwd auth binding pam_passwd_auth.so.1 server_policy
    passwd auth required pam_ldap.so.1
    # cron service (explicit because of non-usage of pam_roles.so.1)
    cron account required pam_unix_account.so.1
    # Default definition for Account management
    # Used when service name is not explicitly mentioned for account management
    other account requisite pam_roles.so.1
    #other account required pam_unix_account.so.1
    other account binding pam_unix_account.so.1 server_policy
    other account required pam_ldap.so.1
    # Default definition for Session management
    # Used when service name is not explicitly mentioned for session management
    other session required pam_unix_session.so.1
    # Default definition for Password management
    # Used when service name is not explicitly mentioned for password management
    other password required pam_dhkeys.so.1
    other password requisite pam_authtok_get.so.1
    other password requisite pam_authtok_check.so.1
    #other password required pam_authtok_store.so.1
    other password required pam_authtok_store.so.1 server_policy
    # Support for Kerberos V5 authentication and example configurations can
    # be found in the pam_krb5(5) man page under the "EXAMPLES" section.
    ON CLIENT: Sun's nsswitch.ldap files that get's activated after running lapclient init has LDAP take over everything. I use a trimmed-down nsswitch.conf with very few ldap entries.
    nsswitch.conf on LDAP client
    (*ldap-client*-root: /var/tmp:215)-> cat /etc/nsswitch.conf
    # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
    # Use is subject to license terms.
    # ident "@(#)nsswitch.ldap 1.10 06/05/03 SMI"
    # /etc/nsswitch.ldap:
    # An example file that could be copied over to /etc/nsswitch.conf; it
    # uses LDAP in conjunction with files.
    # "hosts:" and "services:" in this file are used only if the
    # /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
    # LDAP service requires that svc:/network/ldap/client:default be enabled
    # and online.
    # the following two lines obviate the "+" entry in /etc/passwd and /etc/group.
    passwd: files ldap
    group: files ldap
    # consult /etc "files" only if ldap is down.not using LDAP for hosts
    hosts: files dns
    # Note that IPv4 addresses are searched for in all of the ipnodes databases
    # before searching the hosts databases.
    ipnodes: files
    networks: files
    protocols: files
    rpc: files
    ethers: files
    netmasks: files
    bootparams: files
    publickey: files
    netgroup: files
    automount: files ldap
    aliases: files
    # for efficient getservbyname() avoid ldap
    services: files
    printers: user files
    auth_attr: files
    prof_attr: files
    project: files
    tnrhtp: files
    tnrhdb: files
    ON CLIENT:
    contents of /var/ldap files on client: notice fully qualified NS_LDAP_BINDDN - it me quite some time to understand that this had to be fully qualified or I would continue to get those "Error: Unable to update from profile" in /var/ldap/cachemgr.log and "openConnection: simple bind failed - No such object" in /var/adm/messages error messages.
    (*ldap-client*-root: /var/ldap:218)-> cat ldap*
    # Do not edit this file manually; your changes will be lost.Please use ldapclien
    t (1M) instead.
    NS_LDAP_BINDDN= cn=proxyagent,ou=profile,dc=pacmh,dc=us,dc=eds,dc=com
    NS_LDAP_BINDPASSWD= (removed)
    # Do not edit this file manually; your changes will be lost.Please use ldapclien
    t (1M) instead.
    NS_LDAP_FILE_VERSION= 2.0
    NS_LDAP_SERVERS= my.svr.ip.addr:port (port if not 389)
    NS_LDAP_SEARCH_BASEDN= dc=example,dc=com
    NS_LDAP_AUTH= simple
    NS_LDAP_SEARCH_REF= FALSE
    NS_LDAP_SEARCH_SCOPE= one
    NS_LDAP_SEARCH_TIME= 30
    NS_LDAP_SERVER_PREF= my.svr.ip.addr:port (port if not 389)NS_LDAP_CACHETTL= 3600
    NS_LDAP_PROFILE= myprofile
    NS_LDAP_CREDENTIAL_LEVEL= proxy
    NS_LDAP_BIND_TIME= 15
    ON SERVER
    After running /usr/lib/ldap/idsconfig, I had to create VLV indexes with this command ( after idsconfig runs, it says to use directoryserver command, which does not exist in JSDS 6.2)
    /opt/SUNWdsee/ds6/bin/dsconf create-index -h myserver -p nnnn ( port if not 389 ) dc=example,dc=com getgrent gethostent [....]
    enter space-separated list of all VLV indexes idsconfig said to add after you ran idsconfig
    ON CLIENT:
    If you need to clear client init: ldapclient uninit ( if you get errors, check if ldap_cachemgr is running; if it is, kill -9 it, clear /var/ldap directory, make sure nsswitch.conf is not pointing to ldap stuff -- cp /etc/nsswitch.files /etc/nsswitch.conf
    Initialize ldapclient:
    ldapclient -v init -a proxyDN=cn=proxyagent,ou=profile,dc=example,dc=com
    -a profileName=myprofile my.svr.ip.addr:port (port if not 389)
    If this still does not work, clean up client again as before and reboot it. I had some issues w/Sun's nsswitch.conf file for LDAP taking over my client machine and rendering it useless until I rebooted it with files-settings in nsswitch.conf, making my own nsswitch.ldap file it /etc so Sun's LDAP-happy nsswitch file would not be used, and then running ldapclient init.
    ON CLIENT
    cp /etc/passwd /var/tmp/passwd.ldif ( same for group, shadow, auto_home, auto_master )
    Edit each ldif file and remove all entries other than regular user accounts and nobody/noaccess accounts
    passwd.ldif should look something like this:
    johndoe:x:146:14:John Doe:/home/johndoe:/bin/ksh
    janedoe:x:145:14:Jane Doe:/home/janedoe:/bin/ksh
    nobody:x:60001:60001:NFS Anonymous Access User:/:
    noaccess:x:60002:60002:No Access User:/:
    nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
    For auto_home, make sure each entry starts w/home-dir server's ip-addr: it'll look something like this:
    janedoe 10.10.20.50:/export/home/janedoe
    johndoe 10.10.20.50:/export/home/johndoe
    ldapaddent -D "cn=Directory Manager" -w <password> -f /var/tmp/passwd.ldif passwd
    .... group.ldif group NOTE order is important: passwd,
    .... shadow.ldif shadow group, shadow
    .... auto_home.ldif auto_home
    .... auto_master.ldif auto_master
    ON CLIENT
    /etc/auto_master
    +auto_master
    /etc/auto_home
    +auto_home
    enable these NFS daemons: ( ie. svcadm enable network/nfs/status )
    online 9:06:26 svc:/network/nfs/status:default
    online 9:06:27 svc:/network/nfs/nlockmgr:default
    online 13:09:41 svc:/network/nfs/cbd:default
    online 13:09:41 svc:/network/nfs/mapid:default
    online 13:09:41 svc:/network/nfs/client:default
    enable auto_fs
    online 13:37:42 svc:/system/filesystem/autofs:default
    ON SERVER
    enable these NFS daemons:
    online 16:36:16 svc:/network/nfs/cbd:default
    online 16:36:16 svc:/network/nfs/status:default
    online 16:36:17 svc:/network/nfs/mapid:default
    online 16:36:17 svc:/network/nfs/nlockmgr:default
    online 16:36:22 svc:/network/nfs/rquota:default
    online 16:36:22 svc:/network/nfs/client:default
    online 16:36:23 svc:/network/nfs/server:default
    ON HOME DIRECTORY SERVER
    export home dirs
    (home-dir-svr-root: /var/tmp:221)-> cat /etc/dfs/dfstab
    # Place share(1M) commands here for automatic execution
    # on entering init state 3.
    # Issue the command 'svcadm enable network/nfs/server' to
    # run the NFS daemon processes and the share commands, after adding
    # the very first entry to this file.
    # share [-F fstype] [ -o options] [-d "<text>"] <pathname> [resource]
    # .e.g,
    share -F nfs -o rw -d "home dirs" /export/home
    shareall
    enable auto_fs
    online 13:37:42 svc:/system/filesystem/autofs:default
    ON LDAP SERVER via the GUI ( not sure how to do this via command-line and since I have a JAVA GUI, I'm not going to knock myself out on the command-line trying to do something it'l take 15 seconds to do from the GUI -- command-line purists, feel free to contribute command to do this:
    From GUI, go into your DS instance: --> entry Management --> automountMapName=auto_home --> automountinformation: 144.10.199.220:/export/home/janedoe
    Verify home-dir-svr IP and home dir info are correct.
    log on as user from ldap-client
    NOTE: I did not alter any UNIX system files ( nsswitch.conf, pam.conf, passwd, auto_home, and the like) on LDAP server.
    Not sure if I missed anything, but hope this helps.
    John
    Edited by: No_Windoze on Nov 14, 2007 4:16 PM

    Just remembered something that is very subtle during idsconfig:
    At one point durint idsconfig, there's a questions about storing passwords in unix CRYPT format. You must answer yes to that question or none of this will work. The default answer is no.
    John
    Hi munnik,
    I had the same errors initially. I didn't write down what I did to clear them (oops!) but I think what I did to 'fix' this was I restarted/rebooted (can't remember which) the directory server to clear the error and then, from the client and in this order - passwd, group, shadow - I readded ldifs.
    If you're still having issues with DS, make sure the VLV index step discussed above was done, nothing missed, no errors - redo if necessary: uninit client(s), reinit client(s) with new profile created as a result of running idsconfig to recreate VLV indexes - it'll skip any VLV indexes that are in the server and display a message to that effect. It's a reather brute-force method of doing things, but I couldn't locate much in the way of troubleshooting user account creation issues.
    When I add a new user, here's what I do: add user to server where home dirs are and create a set of passwd, shadow, and auto_home ldif files with just the new user info and run ldapaddent. Then I add them to group (if necessary) with direct edit on ldap server.
    HTH
    John
    (aka NoWindoze)
    indexes and VLV Indexes 'created' when I ran idsconfig:
    uidNumber (eq,pres) skipped already exists
    ipNetworkNumber (eq,pres) skipped already exists
    gidnumber (eq,pres) skipped already exists
    oncrpcnumber (eq,pres) skipped already exists
    automountKey (eq,pres) skipped already exists
    VLV-indexes:
    getgrent vlv_index skipped already exists
    gethostent vlv_index skipped already exists
    getnetent vlv_index skipped already exists
    getpwent vlv_index skipped already exists
    getrpcent vlv_index skipped already exists
    getspent vlv_index skipped already exists
    getauhoent vlv_index skipped already exists
    getsoluent vlv_index skipped already exists
    getauduent vlv_index skipped already exists
    getauthent vlv_index skipped already exists
    getexecent vlv_index skipped already exists
    getprofent vlv_index skipped already exists
    getmailent vlv_index skipped already exists
    getbootent vlv_index skipped already exists
    getethent vlv_index skipped already exists
    getngrpent vlv_index skipped already exists
    getipnent vlv_index skipped already exists
    getmaskent vlv_index skipped already exists
    getprent vlv_index skipped already exists
    getip4ent vlv_index skipped already exists
    getip6ent vlv_index skipped already exists
    You can see indexes defined in your server with this command:
    dsconf list-indexes -h ldap.server.host.name-or.ip -p 389
    Edited by: SolarisSAinPA on Nov 30, 2007 1:05 PM
    Edited by: SolarisSAinPA on Nov 30, 2007 1:40 PM

  • Want to open a new browser window and display the html file in locale disk.

    Hi,
    I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
    Note:
    The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
    ------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
    <html>
    <body >
    <applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
    <param name="path" value="file://c:/open.html" />
    </applet>
    </body>
    </html>
    -------------OpenFile.java in server(Tomcat)--------------------------------------------
    public class OpenFile extends Applet implements ActionListener{
    String path = "";
    fileopen.FileOpen open = null;
    Button b = null;
    public void init(){
    path = getParameter("path");
    b = new Button("Open");
    b.addActionListener(this);
    add(b);
    public void actionPerformed(ActionEvent ae){
    try
    open = new fileopen.FileOpen(this,path);
    catch (Exception e){
    e.printStackTrace();
    -------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
    package fileopen;
    public class FileOpen
    AppletContext context = null;
    URL url = null;
    public FileOpen(Applet applet,String path)
    try
    if(null != applet){
    context = applet.getAppletContext();
    if (null != path)
    url = new URL(path);
    context.showDocument(url, "_blank");
    }catch(Exception ex)
    ex.printStackTrace();
    Please help to solve this issue very urgent.
    Thanks in advance.
    By,
    Saravanan.K.

    zzsara wrote:
    I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
    The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
    If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
    As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
    * The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
    On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
    new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
    I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
    I suggest a couple of things.
    - Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
    - A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
    Edit 1:
    ..and please figure out how to use the CODE tags.
    Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM

  • New to java and having issues trying to modify sample code.

    i was trying to edit the following code to add about 10+ more labels and textfields and save the information to the contacts.dat in the code. it currently displays all the fields i entered, but it only saves the first 7 fields information?? not sure why. also i was trying to just line the fields up using a flowlayout but it just errors. anyone have any suggestions?
    <source code below this line>
    ====================START OF CODE ======================
    // cm.java
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    // =========================================================
    // Class: cm
    // This class drives the contact manager. It contains the
    // main method which gets called as soon as this application
    // begins to run.
    // =========================================================
    class cm extends Frame implements ActionListener
    // Container of contact objects (one object per business
    // contact).
    private Vector contacts = new Vector (100);
    // List of names component. (Must specify java.awt in
    // front of List to distinguish the List class in the
    // java.awt package from the List class in the java.util
    // package.)
    private java.awt.List names = new java.awt.List ();
    // delete and edit button components.
    private Button delete;
    private Button edit;
    // Default constructor.
    public cm ()
    // Assign Contact Manager to title bar of frame window.
    super ("Customer Manager Version 0.001 BY Pebkac");
    // Add a listener that responds to window closing
    // events. When this event occurs (by clicking on the
    // close box in the title bar), save contacts and exit.
    addWindowListener (new WindowAdapter ()
    public void windowClosing
    (WindowEvent e)
    saveContacts ();
    System.exit (0);
    // Place an empty label in the north part of the frame
    // window. This is done to correct an AWT positioning
    // problem. (One thing that you'll come to realize as
    // you work with the AWT is that there are lots of bugs.)
    Label l = new Label ();
    add ("North", l);
    // Place the names component in the center part of the
    // frame window.
    add ("Center", names);
    // Create a panel object to hold four buttons.
    Panel p = new Panel ();
    Button b;
    // Add an add button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (b = new Button ("add"));
    b.addActionListener (this);
    // Add a delete button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (delete = new Button ("delete"));
    delete.addActionListener (this);
    // The delete button should be disabled until there is at
    // least one contact to delete.
    delete.setEnabled (false);
    // Add an edit button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (edit = new Button ("edit"));
    edit.addActionListener (this);
    // The edit button should be disabled until there is at
    // least one contact to edit.
    edit.setEnabled (false);
    // Add a quit button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (b = new Button ("quit"));
    b.addActionListener (this);
    // Add the panel object to the frame window container.
    add ("South", p);
    // Set the background of the frame window container to
    // pink (to give a pleasing effect).
    setBackground (Color.pink);
    // Set the size of the frame window container to 400
    // pixels horizontally by 200 pixels vertically.
    setSize (400, 200);
    // Do not allow the user to resize the frame window.
    setResizable (false);
    // Load all contacts.
    loadContacts ();
    // Make sure that the frame window is visible.
    setVisible (true);
    public void actionPerformed (ActionEvent e)
    if (e.getActionCommand ().equals ("delete"))
    delete ();
    else
    if (e.getActionCommand ().equals ("quit"))
    saveContacts ();
    System.exit (0);
    else
    if (e.getActionCommand ().equals ("add"))
    add ();
    else
    edit ();
    public Insets getInsets ()
    // Return an Insets object that describes the number of
    // pixels to reserve as a border around the edges of the
    // frame window.
    return new Insets (10, 10, 10, 10);
    public static void main (String [] args)
    // Create a new cm object and let it do its thing.
    new cm ();
    private void delete ()
    // Obtain index of selected contact item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot edit
    // a contact if no contact item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Remove the contact item from the names component.
    names.remove (index);
    // Remove the Contact object from the contacts Vector
    // object.
    contacts.remove (index);
    // If there are no more contacts ...
    if (contacts.size () == 0)
    delete.setEnabled (false);
    edit.setEnabled (false);
    else
    // Make sure that the first contact item in the names
    // list is highlighted.
    names.select (0);
    private void add ()
    // Create an add data entry form to enter information
    // for a new contact.
    DataEntryForm def = new DataEntryForm (this, "add");
    // If the bOk Boolean flag is set, this indicates the user
    // exited the form by pressing the Ok button.
    if (def.bOk)
    // Create a Contact object and assign information from
    // the form to its fields.
    Contact temp = new Contact ();
    temp.fname = new String (def.fname.getText ());
    temp.lname = new String (def.lname.getText ());
    temp.haddress = new String (def.haddress.getText ());
    temp.maddress = new String (def.maddress.getText ());
    temp.phone = new String (def.phone.getText ());
    temp.wphone = new String (def.wphone.getText ());
    temp.cphone = new String (def.cphone.getText ());
    temp.email = new String (def.email.getText ());
    temp.bdate = new String (def.bdate.getText ());
    temp.comments = new String (def.comments.getText ());
    // Add a new contact item to the names component.
    names.add (temp.lname + ", " + temp.fname);
    // Add the Contact object to the contacts Vector
    // object.
    contacts.add (temp);
    // Make sure that the delete and edit buttons are
    // enabled.
    delete.setEnabled (true);
    edit.setEnabled (true);
    // Destroy the dialog box.
    def.dispose ();
    // Make sure that the first contact item in the names list
    // is highlighted.
    names.select (0);
    // ===========================================================
    // Load all contacts from contacts.dat into the contacts
    // Vector object. Also, make sure that the last name/first
    // name from each contact is combined into a String object and
    // added into the names component - as a contact item.
    // ===========================================================
    private void loadContacts ()
    FileInputStream fis = null;
    try
    fis = new FileInputStream ("contacts.dat");
    DataInputStream dis = new DataInputStream (fis);
    int nContacts = dis.readInt ();
    for (int i = 0; i < nContacts; i++)
    Contact temp = new Contact ();
    temp.fname = dis.readUTF ();
    temp.lname = dis.readUTF ();
    temp.haddress = dis.readUTF ();
    temp.maddress = dis.readUTF ();
    temp.phone = dis.readUTF ();
    temp.wphone = dis.readUTF ();
    temp.cphone = dis.readUTF ();
    temp.email = dis.readUTF ();
    temp.bdate = dis.readUTF ();
    temp.comments = dis.readUTF ();
    names.add (temp.lname + ", " + temp.fname);
    contacts.add (temp);
    if (nContacts > 0)
    delete.setEnabled (true);
    edit.setEnabled (true);
    catch (Exception e)
    finally
    if (fis != null)
    try
    fis.close ();
    catch (Exception e) {}
    // Make sure that the first contact item in the names list
    // is highlighted.
    names.select (0);
    // ========================================================
    // Save all Contact objects from the contacts Vector object
    // to contacts.dat. The number of contacts are saved as an
    // int to make it easy for loadContacts () to do its job.
    // ========================================================
    private void saveContacts ()
    FileOutputStream fos = null;
    try
    fos = new FileOutputStream ("contacts.dat");
    DataOutputStream dos = new DataOutputStream (fos);
    dos.writeInt (contacts.size ());
    for (int i = 0; i < contacts.size (); i++)
    Contact temp = (Contact) contacts.elementAt (i);
    dos.writeUTF (temp.fname);
    dos.writeUTF (temp.lname);
    dos.writeUTF (temp.haddress);
    dos.writeUTF (temp.maddress);
    dos.writeUTF (temp.phone);
    dos.writeUTF (temp.wphone);
    dos.writeUTF (temp.cphone);
    dos.writeUTF (temp.email);
    dos.writeUTF (temp.bdate);
    dos.writeUTF (temp.comments);
    catch (Exception e)
    MsgBox mb = new MsgBox (this, "CM Error",
    e.toString ());
    mb.dispose ();
    finally
    if (fos != null)
    try
    fos.close ();
    catch (Exception e) {}
    private void edit ()
    // Obtain index of selected contact item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot edit
    // a contact if no contact item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Obtain a reference to the Contact object (from the
    // contacts Vector object) that is associated with the
    // index.
    Contact temp = (Contact) contacts.elementAt (index);
    // Create and display an edit entry form.
    DataEntryForm def = new DataEntryForm (this, "edit",
    temp.fname,
    temp.lname,
    temp.haddress,
    temp.maddress,
    temp.phone,
    temp.wphone,
    temp.cphone,
    temp.email,
    temp.bdate,
    temp.comments);
    // If the user pressed Ok...
    if (def.bOk)
    // edit the contact information in the contacts
    // Vector object.
    temp.fname = new String (def.fname.getText ());
    temp.lname = new String (def.lname.getText ());
    temp.haddress = new String (def.haddress.getText ());
    temp.maddress = new String (def.maddress.getText ());
    temp.phone = new String (def.phone.getText ());
    temp.wphone = new String (def.wphone.getText ());
    temp.cphone = new String (def.cphone.getText ());
    temp.email = new String (def.email.getText ());
    temp.bdate = new String (def.bdate.getText ());
    temp.comments = new String (def.comments.getText ());
    // Make sure the screen reflects the edit.
    names.replaceItem (temp.lname + ", " + temp.fname,
    index);
    // Destroy the dialog box.
    def.dispose ();
    // Make sure that the first contact item in the names
    // list is highlighted.
    names.select (0);
    // ========================================================
    // Class: Contact
    // This class describes the contents of a business contact.
    // ========================================================
    class Contact
    public String fname;
    public String lname;
    public String haddress;
    public String maddress;
    public String phone;
    public String wphone;
    public String cphone;
    public String email;
    public String bdate;
    public String comments;
    // ==========================================================
    // Class: DataEntryForm
    // This class provides a data entry form for entering contact
    // information.
    // ==========================================================
    class DataEntryForm extends Dialog implements ActionListener
    // bOk is a boolean flag. When true, it indicates that
    // the Ok button was pressed to terminate the dialog box
    // (as opposed to the Cancel button).
    public boolean bOk;
    // The following components hold the text that the user
    // entered into the visible text fields.
    public TextField fname;
    public TextField lname;
    public TextField haddress;
    public TextField maddress;
    public TextField phone;
    public TextField wphone;
    public TextField cphone;
    public TextField email;
    public TextField bdate;
    public TextField comments;
    public void actionPerformed (ActionEvent e)
    // If the user pressed the Ok button, indicate this
    // by assigning true to bOk.
    if (e.getActionCommand ().equals ("Ok"))
    bOk = true;
    // Destroy the dialog box and return to the point
    // just after the creation of the DataEntryForm object.
    dispose ();
    public DataEntryForm (Frame parent, String title)
    // Call the other constructor. The current constructor
    // is used for add operations. The other constructor
    // is used for edit operations.
    this (parent, title, "", "", "", "", "", "", "", "", "", "");
    public DataEntryForm (Frame parent, String title,
    String fname, String lname,
    String haddress, String maddress,
    String phone,String wphone,
    String cphone,String email,
    String bdate,String comments)
    // Initialize the superclass layer.
    super (parent, title, true);
    // Choose a grid bag layout so that components can be more
    // accurately positioned. (It looks nicer.)
    setLayout (new GridBagLayout ());
    // Add appropriate first name, last name, phone, wphone, and
    // email components to the current DataEntryForm container.
    // (Remember, DataEntryForm is a subclass of Dialog.
    // Dialog is a container. Therefore, DataEntryForm
    // inherits the ability to be a container.)
    addComponent (this, new Label ("First Name: "),0, 0, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.fname = new TextField (20);
    addComponent (this, this.fname, 1, 0, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("edit"))
    this.fname.setText (fname);
    addComponent (this, new Label ("Last Name: "), 0, 1, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.lname = new TextField (20);
    addComponent (this, this.lname, 1, 1, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("edit"))
    this.lname.setText (lname);
    addComponent (this, new Label ("Home Address: "), 0, 2, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.haddress = new TextField (20);
    addComponent (this, this.haddress, 1, 2, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("edit"))
    this.haddress.setText (haddress);
    addComponent (this, new Label ("Mailing Address: "), 0, 3, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.maddress = new TextField (20);
    addComponent (this, this.maddress, 1, 3, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("edit"))
    this.maddress.setText (maddress);
    addComponent (this, new Label ("Home Number: "), 0, 4, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.phone = new TextField (20);
    addComponent (this, this.phone, 1, 4, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("edit"))
    this.phone.setText (phone);
    addComponent (this, new Label ("Work Number: "), 0, 5, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.wphone = new TextField (20);
    addComponent (this, this.wphone, 1, 5, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("edit"))
    this.wphone.setText (wphone);
    addComponent (this, new Label ("Cell Number: "), 0, 6, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.cphone = new TextField (20);
    addComponent (this, this.cphone, 1, 6, 1, 1,
    GridBagConstraints.WEST,
    GridBagConstraints.WEST);
    addComponent (this, new Label ("Email Address: "), 0, 7, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.email = new TextField (20);
    addComponent (this, this.email, 1, 7, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    addComponent (this, new Label ("Birth Date: "), 0, 8, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.bdate = new TextField (20);
    addComponent (this, this.bdate, 1, 8, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    addComponent (this, new Label ("Comments: "), 2, 0, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.comments = new TextField (20);
    addComponent (this, this.comments, 2, 1, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    addComponent (this, new Label (""), 0, 9, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    addComponent (this, new Label (""), 1, 9, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    Button b;
    // Add an Ok button to this container.
    addComponent (this, b = new Button ("Ok"), 0, -9, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    b.addActionListener (this);
    // Add a Cancel button to this container.
    addComponent (this, b = new Button ("Cancel"), 1, -9, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    b.addActionListener (this);
    // Set the background of the frame window container to
    // pink (to give a pleasing effect).
    setBackground (Color.pink);
    // Set the size of the dialog window to 250 pixels
    // horizontally by 200 pixels vertically.
    setSize (450, 500);
    // Do not allow users to resize the dialog window.
    setResizable (false);
    // Make sure that the dialog window is visible.
    setVisible (true);
    private void addComponent (Container con, Component com,
    int gridx, int gridy,
    int gridw, int gridh, int fill,
    int anchor)
    // Get the current layout manager. It is assumed to
    // be a GridBagLayout object.
    LayoutManager lm = con.getLayout ();
    // Create a GridBagConstraints object to make it
    // possible to customize component positioning.
    GridBagConstraints gbc = new GridBagConstraints ();
    // Assign the x and y grid positions.
    gbc.gridx = gridx;
    gbc.gridy = gridy;
    // Assign the number of grid blocks horizontally and
    // vertically that are occupied by the component.
    gbc.gridwidth = gridw;
    gbc.gridheight = gridh;
    // Specify the component's resize policy (fill) and
    // the direction in which the component is positioned
    // when its size is smaller than available space (anchor).
    gbc.fill = fill;
    gbc.anchor = anchor;
    // Set the new constraints that the grid bag layout
    // manager will use.
    ((GridBagLayout) lm).setConstraints (com, gbc);
    // Add the component to the container.
    con.add (com);
    // ===========================================================
    // Class: MsgBox
    // This class displays a message box to the user. The message
    // is usually an error message. The user must press the Ok
    // button to terminate the message box.
    // ===========================================================
    class MsgBox extends Dialog implements ActionListener
    public void actionPerformed (ActionEvent e)
    // Terminate the dialog box in response to the user
    // pressing the Ok button.
    dispose ();
    public MsgBox (Frame parent, String title, String msg)
    // Initialize the superclass layer.
    super (parent, title, true);
    // Store the msg argument in a Label object and add
    // this object to the center part of the dialog window.
    Label l = new Label (msg);
    add ("Center", l);
    // Create a Button object and add it to the south part
    // of the dialog window.
    Button b = new Button ("Ok");
    add ("South", b);
    // Make the current object a listener to events that
    // occur as a result of the user pressing the Ok
    // button.
    b.addActionListener (this);
    // Make sure that the Ok button has the focus.
    b.requestFocus ();
    // Do not allow users to resize the dialog window.
    setResizable (false);
    // Allow the layout manager to choose an appropriate
    // size for the dialog window.
    pack ();
    // Make sure that the dialog window is visible.
    setVisible (true);
    ====================END OF CODE =======================

    You should first start by formatting the code before
    posting. I lost my interest as I browsed thorugh the
    code.
    Read here -
    http://forum.java.sun.com/help.jspa?sec=formatting
    ...and its way too much code to expect anyone to read. Post a short excerpt of the part you are having trouble with.

Maybe you are looking for

  • How to connect my HP Officejet 4500 G510n-z to work wireless.

    I recently purchased the HP Officejet 4500 G510n-z, i have it connected to my netgear router which i can see that it is through netgear genie, but my computer will not connect. i have tried turning off my firewall, i have uninstalled and reinstalled

  • Rosettanet STK credentials file in TomcatRN\webapps\rosettanet

    Hi, I'm working on integration of Rosettanet STK with XI. Scenario is PIP0C1 from STK to XI. I was going through the blog - /people/shabarish.vijayakumar/blog/2006/06/14/close-encounters-with-the-rosettanet-stk . At Step 6, where do specify the login

  • Aperture not recognizing iPhone 3GS as a camera?

    I decided to pull my iPhone photos into Aperture. However, some of the photos show correct camera metadata as being from my 3GS, but others show "unknown camera". There appears to be no rhyme nor reason, i.e. the first photo I took with my phone show

  • Terminal: -bash: fork: Resource temporarily unavailable

    I'm having "-bash: fork: Resource temporarily unavailable" when I open up the terminal on my 10.4.6 system. The only way to remedy this issue seems to restart which is at minimum annoying. The other odd thing is when this occurs and if I open up the

  • Flash player silent auto update not working

    I was glad to read the news about the new feature of silent auto updates of the Adobe Flash player, but unfortunately this is not working on my machine. Has anyone had the same problems and was able to solve them? Some information on my setup: I had