Java and Access

Hi! I have one table "Student" and one "Course". They are connected via a many-to-many relationship.
The database is Access.
In the connecting table I register the grades the student get on a course. This works fine in some cases but not in others.
I get an error message saying something like "Can't add or change the row, it takes an related row in the course table". But I have checked and the row is there.
A funny thing is, that when I added a course in the course table, it was other combinations of student and course that didn't work.
I'll be happy to post my files to anyone who wants to take a look.
This is the error message: (and I also get a .ldb file for locked rows)
java.sql.SQLException: [Microsoft][Drivrutin f�r ODBC Microsoft Access] Du kan inte l�gga till eller �ndra posten. Det kr�vs en relaterad post i tabellen 'Kurs'.
     at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
     at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
     at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111)
     at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
     at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288)
     at Databashanterare.betygReg(Databashanterare.java:657)
     at BetygReg.actionPerformed(BetygReg.java:389)
     at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
     at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
     at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
     at java.awt.Component.processMouseEvent(Component.java:5100)
     at java.awt.Component.processEvent(Component.java:4897)
     at java.awt.Container.processEvent(Container.java:1569)
     at java.awt.Component.dispatchEventImpl(Component.java:3615)
     at java.awt.Container.dispatchEventImpl(Container.java:1627)
     at java.awt.Component.dispatchEvent(Component.java:3477)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
     at java.awt.Container.dispatchEventImpl(Container.java:1613)
     at java.awt.Window.dispatchEventImpl(Window.java:1606)
     at java.awt.Component.dispatchEvent(Component.java:3477)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Well, I do have auto increment in "course" and "student" but not in the third table. It can't be? since it depends on what student and what course you choose.
public String sqlInsert(String tabell, String kursNamn, String Litteratur)
          String status = null;
          try
               int idnr = 0;
               int i = 0;
               //int [] temp = new int[100];
               if(kursNamn.equals("") || Litteratur.equals(""))
                    status = "Du m�ste ange b�de kurs och litteratur!";
               if(status == null)
                    skapaKoppling();
                    rs = stmt.executeQuery("select * from " + tabell + " order by Kid");
                    while(rs.next())
                         idnr++; //R�knar ut sista postens idnr.
                         temp[idnr] = rs.getInt("Kid"); // H�r l�ggs alla kvarvarande idnr
                    idnr = temp[idnr]; //Sista postens idnr l�ggs i variabel.
                    System.out.println("idnr: " + idnr);
                    while(i < 20)
                         System.out.println("post "+i+" �r "+temp);
                         i++;
                    idnr++;
                    //int antal = stmt.executeUpdate("insert into Exempel values(1,'Blaha','Mer blaha','2002-02-18 19:23:21',"+true+")");
                    int antal = stmt.executeUpdate("insert into "+tabell+" values("+idnr+",'"+kursNamn+"','"+Litteratur+"')");
                    System.out.println("Antal rader som ber�rdes: " + antal);
                    status = "Kurs registrerad!";
                    avslutaKoppling();
               }//End if
          catch(SQLException sqle)
               sqle.printStackTrace();
          return status;
     }//End metod SQLinsert
public String sqlInsert2(String tabell, String studentNamn)
          String status = null;
          try
               int idnr = 0;
               int i = 0;
               int [] temp = new int[100];
               if(studentNamn.equals(""))
                    status = "Du m�ste ange student!";
               if(status == null)
                    skapaKoppling();
                    rs = stmt.executeQuery("select * from " + tabell + " order by Sid");
                    while(rs.next())
                         idnr++; //R�knar ut sista postens idnr.
                         temp[idnr] = rs.getInt("Sid"); // H�r l�ggs alla kvarvarande idnr
                    idnr = temp[idnr]; //Sista postens idnr l�ggs i variabel.
                    System.out.println("idnr: " + idnr);
                    //Test
                    while(i < 20)
                         i++;
                         System.out.println("post "+i+" �r "+temp[i]);
                    idnr++; //S�tter idnr till nummer efter sista post.
                    //int antal = stmt.executeUpdate("insert into Exempel values(1,'Blaha','Mer blaha','2002-02-18 19:23:21',"+true+")");
                    int antal = stmt.executeUpdate("insert into "+tabell+" values("+idnr+",'"+studentNamn+"')");
                    System.out.println("Antal rader som ber�rdes: " + antal);
                    status = "Student registrerad!";
                    avslutaKoppling();
               }//End if
          catch(SQLException sqle)
               sqle.printStackTrace();
          return status;
     }//End metod SQLinsert 2

Similar Messages

  • UML,Java and Access

    Hello Good morning. Maybe this message has not a lot to do at all with Java. Iam doing a program in Java using UML(both OO).Wouldn't be a contradiction to use MS Access as "DataBase" since Java and UML are Object Oriented?.
    Thanks.
    CELH.

    You are quite right. Thus, I wonder about it because it's strange mixing Object Oriented programming and modeling with a relational DataBase. Maybe a Object Oriented DataBase will suit it better, but then again, you are right: There a few known Object Oriented DataBase.
    Thanks.
    CELH

  • How create plugins in java and access then from the app

    How can I create plugins for a Java app. And how do I need in my app to access those plugins??

    Generally speaking, any sort of plugin is simply an implementation of some defined or set of defined interfaces that is loaded at runtime and invoked based on some event, configuration or other such mechanism. Java plugins can be implemented simply as .jar or individual classes that implement the interface(s). The application loads these (perhaps using separate, specifically defined class loaders) and is responsible for knowing how and when to invoke their method(s).
    The trick, of course, is defining the interfaces to be supported by the app and implemented by the plugin and to define a set of events, etc. that would cause these to be invoked. The mechanics of loading the classes, instatiating the instances as need, etc. is fairly basic Java programming.
    Chuck

  • Java and Access database

    Hello,
    I have an application with an access database. The access database (the access file) is in the same directory as all java files in c:\programs\eclipse\workspace\javaBooks.
    The connection method looks as follows:
    public boolean getConnection(String url,String user, String passw)
    try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con = DriverManager.getConnection(url,user,passw);          
    DatabaseMetaData dbmd = con.getMetaData();
         System.out.println("Connected to " + dbmd.getURL());
         System.out.println("Version " + dbmd.getDriverVersion());
         System.out.println("DBMS: " + dbmd.getDatabaseProductName());
         return true;
         //System.out.println("AutoCommit: " + con.getAutoCommit());
         //rs=dbmd.getTables(null,"%","%",null); // Driver is not capable!
         catch (java.sql.SQLException e)
              System.err.println("Can't connect to database");
              System.err.println(e.getMessage());
              return false;
         catch (ClassNotFoundException e)
              System.err.println("Can't connect to database");
              System.err.println(e.getMessage());
              return false;
    At the beginning when I start the application a form is displayed where I have to indicate an url and a password.
    Does anybody know how I have to configure the corresponding things to use the database with the application?

    You access (ahem) Access through the JdbcOdbcDriver,
    which comes with Java.Not bad, not bad.
    World spins
    RD-R
    � {�                                                                                                                                                                                                                                                   

  • Dates, java, and Access Databases

    I have my Access DB set up with three date fields, all of them are date/time and short dates. In my interface (done with NetBeans) I have the three text fields. I need to be able to have formatted entry, and then when I want to save to the Access DB I need to save the appropriate information. Up to this point, the only problem I have is with the formatted entry.
    However, when I try to save with a field that has no date entered, I get a data type mismatch error. I don't want to store zeroes in the fields, I just want to store the dates properly, and if no date, then have the field in the DB blank.
    Any suggestions or help?

    However, when I try to save with a field that has no
    date entered, I get a data type mismatch error. I
    don't want to store zeroes in the fields, I just want
    to store the dates properly, and if no date, then
    have the field in the DB blank. No. You want to have the field in the DB contain null. So you need to call setNull on your PreparedStatement if the input field is empty and setDate if it contains a valid date.

  • Java and Access databases

    Hi I have a problem that I have been working on for a couple days now. It is on inserting, deleting and updating a database table. I wrote a small simple java program to insert a record into the table called Table1. I have my ODBC set up with the name tester1. I have another program that queries the same database table and it works fine. but I can't get this program to work. The code that I am using is from a textbook, the program compiles fine but when I run it it gives me an error -> SQL Error: java.sql.SQLException: General error 0 S1000
    I have 7 columns in the database table. The first two are numbers and the rest are text. The first colmns is the primary key.
    Can anyone see what is the problem?
    Here is the code:
    import java.sql.*;
    public class databasetest1b {
         public static void main(String[] arguments) {
              String data = "jdbc:odbc:tester1";
         try {
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection conn = DriverManager.getConnection(
                   data, "", "");
              PreparedStatement st = conn.prepareStatement(
              "INSERT INTO Table1 VALUES(?,?,?,?,?,?,?)");
                   st.setString(1,"1");
                   st.setString(2,"12345");
                   st.setString(3,"ethan");
                   st.setString(4,"pats");
                   st.setString(5,"kid");
                   st.setString(6,"single");
                   st.setString(7,"rich");
                   st.executeUpdate();
                   conn.close();
         } catch (SQLException s) {
                   System.out.println("SQL Error: " + s.toString() + " "
                        + s.getErrorCode() + " " + s.getSQLState());
         } catch (Exception e) {
                   System.out.println(" Error: " + e.toString()
                        + e.getMessage());
    All I would like to be able to do is add a record into the table. Then I can figure out how to change fields and update them.

    Greetings,
    Have you tried sending the first two using
    setInt(1, 1);
    setInt(2, 12345)
    since they are numbers?
    Don't know how picky your database is but it might not like the paranthesis format or might actually require a SQL int datatype.
    Hope that helps,
    -J

  • Java and MS-Access: Login Authentication trough SQL

    Hi all,
    I am currently new to the world of java and would like to ask something for a school project.
    We have an MS-Access database setup which we want to use as an login-database.
    We can select from the tables in the database using a standard SQL query, and print out the output, but we do not know how to combine the java-string "UserID" and "Corrpass" field to compare them with the database to check if the entered login is correct.
    I know this question is a little bit on the SQL side, but could you please help me? The code for printing out Usernames was founfdon the bottom of this webpage:
    http://www.ster.be/java/java6.html
    Our Microsoft Access Database Layout:
    MS-Access Database
    Table: Users
    | UserID -AutoNumber : UserID (Login code)
    | Corrpass -text :The Correct Password for the above UserID
    | UserVoornaam -text : First name
    | UserAchternaam -text : Surname
    All help/welcome/advise/flaming posts are welcome.

    Hi all,
    I am currently new to the world of java and would like to ask something for a school project.
    We have an MS-Access database setup which we want to use as an login-database.
    We can select from the tables in the database using a standard SQL query, and print out the output, but we do not know how to combine the java-string "UserID" and "Corrpass" field to compare them with the database to check if the entered login is correct.
    I know this question is a little bit on the SQL side, but could you please help me? The code for printing out Usernames was founfdon the bottom of this webpage:
    http://www.ster.be/java/java6.html
    Our Microsoft Access Database Layout:
    MS-Access Database
    Table: Users
    | UserID -AutoNumber : UserID (Login code)
    | Corrpass -text :The Correct Password for the above UserID
    | UserVoornaam -text : First name
    | UserAchternaam -text : Surname
    All help/welcome/advise/flaming posts are welcome.

  • Error when accessing Java and JVM section

    I'm getting the following error when accessing the Java and
    JVM section of the CF Administrator:
    "Element JDKPATH is undefined in FORM"
    I've searched a lot and there's very little on the topic. On
    this forum there are two posts and one got no answer, on the other
    it was suggested it might be the jvm.config file. I've looked at
    mine but I really have no idea what could be wrong. Also, there are
    two jvm.config files in my install, one in jrun4/bin and another in
    jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/runtime/bin
    folder (I did multiserver installation).
    I've already tried a bunch of things and no luck, any help is
    appreciated on this.

    quote:
    Originally posted by:
    ke4pym
    What is your path? Make sure you're using forward slashes.
    ie: d:/java/jdk1.6.0_12/bin/blah/blah/blah
    What path are your referring to? My actual PATH environment
    variable? Or are you referring to something else. Btw, here's what
    my config file looks like right now.
    # VM configuration
    # Where to find JVM, if {java.home}/jre exists then that JVM
    is used
    # if not then it must be the path to the JRE itself
    java.home=C:/JRun4/jre
    # If no java.home is specified a VM is located by looking in
    these places in this
    # order:
    # 1) bin directory for java.dll (windows) or
    lib/<ARCH>/libjava.so (unix)
    # 2) ../jre
    # 3) registry (windows only)
    # 4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
    # Arguments to VM
    java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false
    -XX:MaxPermSize=192m -XX:+UseParallelGC
    -Dcoldfusion.rootDir={application.home}/
    # commas will be converted to platform specific separator and
    the result will be passed
    # as -Djava.ext.dirs= to the VM
    java.ext.dirs={jre.home}/lib/ext
    # where to find shared libraries
    java.library.path={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusi on/lib,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra /bin,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra/b in/international
    system.path.first=false
    # set the current working directory - useful for Windows to
    control
    # the default search path used when loading DLLs since it
    comes
    # before system directory, windows directory and PATH
    java.user.dir={application.home}/../lib
    # JVM classpath
    java.class.path={application.home}/servers/lib,{application.home}/lib

  • Can ABAP program and a Java apps access the same DB table?

    If an ABAP program and a Java apps access the same DB table, how does the Enqueue services from ABAP and Java communicate with each other to ensure locking consistency (if they even communicate with each otehr at all)?
    Or there wont be such situation because there are separate schema for ABAP stack and Java stack?
    Your help is greatly appreciated.

    Hello!
    A while ago I was a subject to criticism too for not granting points to helpfull answers. I appeared to be ungratefull, but I'm actually not (I guess the same goes for Vincent). I absolutely agree that good people who provide helpfull answers deserve (at least) points, but I didn't quite get the whole idea with points untill I was explicitly warned. I took some time to correct this and I granted points for all my past questions, generously, with "interest rates" for waiting.
    My point is:
    The pointing system is good, but unintuitive and not documented. I suggested this at that time, and I see that nothing has changed since. I see also that I'm not the only one who has experienced missunderstandings.
    I repeat the message to SDN people: Please provide some info on pointing system! A few sentences behind a "What's this?" link would do. It's not such a hard work.
    Thanks!
    Kind regards,
    Igor Barbaric

  • Deploying a VB dll using some web service and accessing it through java

    I'm new to Web Services Based Programming. I would like to know whether this is possible and if so has anyone tried it. I want to create a vb dll that contains the remote methods that the client will access from a java program. After going thru a lot of articles, I'm still unsure on how to do this. I found one method was to Create a VB program/dll, deploy it in a web service and create the java program that accesses by another web service.
    I'm doing this as part of my lab syllabus. The thing is My lab exercises do not state anything about the technologies that I can use to do this.
    This is all that is stated there:-
    Creation Of DLL Using VB And Deploy it in Java
    I just cant get any ideas other than deploying both the parts as web services. If anyone has Better ideas for this, I would really appreciate it.
    I dont know anything about CORBA for languages other than Java and I'm already using the servlets and EJB's in my normal life. I'm also learning the ORB based programming in java. Therefore your help will probably help me learn something new then what I know.

    Sorry I wasn't too specific in my last question.
    This is my java class calling the native method print
    //HeyWorld.java
    class HeyWorld {
    private native void print();
    public static void main(String[] args) {
    new HeyWorld().print();
    static {
    System.loadLibrary("HeyWorld");
    In this case, my C method for calling a C++ method: HelloWorld.cpp
    #include "jni.h"
    #include "stdio.h"
    #include "stdafx.h"
    #Include "HeyWorld.h" //this is where i get my function prototype
    #include "Test.h" //this is the C++ header where the print method and the Test class is
    JNIEXPORT void JNICALL
    Java_HeyWorld_print(JNIEnv *env, jobject obj)
    CTest a; //CTest is the print class I created
    a.print();
    //This is the header for Test.h
    class CTest: public CWinApp
    public:
         CTest(); //constructor
         void print(); //our method
    //And this is the implementation of the class Test.cpp
    void CTest::print()
         printf("Hey World!\n");
         return ;
    I could compile the Test.cpp, HeyWorld.cpp successfully. However when I tried to compile HeyWorld.cpp using
    cl -I<path of jdk include> -I<path of jdk include win32> -LD HeyWorld.cpp -FeHeyWorld.dll,
    the VC++ 6.0 compiler gave me this error:
    HeyWorld.obj:error LNK2001: unresolved external symbol "public:_thiscall CTest::CTest(void)"
    HeyWorld.obj:error LNK2001: unresolved external symbol "public:_thiscall CTest::print(void)"
    Thanks for the help.

  • UWC/CE 6.3 and Access Manager 7.1 SSO sometimes fails (seems like a bug)

    PREAMBULA: I started writing this post thinking that our AM SSO setup was at fault in some step. As I was gathering data, checking the doc-links and config files and finally sniffed the servers for HTTP dialogs, I grew pretty sure there's a bug in UWC/CE, AM SDK or Web Server Policy Agent, whatever implements the AM SSO session checking.
    In short, as written below, our "sunmail" server can POST a broken cookie to AM server, if the cookie originally contained a "plus" character. The "plus" is replaced by a "space", invalidating the session check. As we know, "+" is often used in URLs to "escape" the space character. Perhaps some URL cleanup routine backfired here. I have double-checked, it is not the reverse proxy on "psam" breaking things. It is "sunmail" (UWC/CE or Policy Agent, don't know for certain) supplying the broken request. On the few occasions when the AM cookie contains no "plus" characters, the SSO works like a charm (also checked by a sniffer). Whenever there is a "plus", it breaks.
    Is there some known bug or workaround that matches this description?
    Nevertheless, for completeness' sake I kept the description of our setup. Maybe it's at fault after all :)
    We have an installation of JCS5 with the latest patches as of early July 2008. And as the subject implies, we have problems with AM SSO in UWC/CE web-interface. I have reported them before, then they seemed fixed (not occuring for several tests in a row), but as time has shown, something wrong is still there.
    So I'll try to go into deeper detail now, as we've may have overlooked some nuance... Then again, as my sniffer research below shows, this may be an engine bug and these setup details are irrelevant.
    Our setup is split into several Solaris 10 full-root zones hosted on several servers, some of the components are enroute to HA (perhaps we made some mistakes on this part of the way?)
    So, we have the following software stack:
    1) two MMR Directory Servers (DSEE 6.3 = DSEE 6.2 from JCS5 + 125278-07__DSEE_6.3__x86x64 + 125277-07__DSEE_6.3__x86_sol9 patches) working in zones on two different servers. Except for one time when a manually forced ZFS rollback corrupted one of the server instances, no problems here.
    2) two zones with Directory Proxy Servers (6.3, exact versions as above) running at port 389 provide the clients with an illusion that they have a stable Directory Server, even if one of the actual servers is currently rebooting ;)
    These DPS zones are hosted on two different servers as well and are primarily used by LDAP clients (JCS components) running in other zones on the same respective servers.
    3) A zone with Sun Web Server 7.0U1 and Access Manager 7.1 (+ 126357-01__AM71_x86 patch) and Delegated Admin 6.4-4.01 (from JCS5 + 121582-18__COMMCLI64__x86 patch).
    At the moment there is one such zone (named "cos-psam-01.domain.ru" in the logs below), but we expect(-ed) it to become two similar zones as per AM HA setup.
    Zones listed in (1-3) use private IP numbers, they belong in our internal DMZ.
    Zones listed in (4-5) below use public (routed) IP numbers, they belong in our external DMZ.
    4) A zone with Sun Web Server 7.0U1 used primarily as a reverse-proxy server (optionally with a load-balancer libpassthrough.so plugin) successfully used for other hosted projects. One of its configurations now passes connections from an externally routed IP address published as "psam.domain.ru" to "cos-psam-01.domain.ru", per AM HA setup, so HTTP clients believe they work with an Access Manager instance. This zone has a backend interface with a private IP address to communicate with the actual AM instance.
    In AM configuration (both LDAP and file-based) we have configured a site ID with the publicly known name and mentioned both names (psam and cos-psam-01) in organization's realm/dns aliases.
    5) A zone with the rest of the Sun Java Communications Suite 5, as in Messaging Server 6.3 (6.3-6.03 64-bit: ci-5.0-1.03_solx86_x64__Messaging_Server_6.3-2 + patch 126480-09__MSG63__x86-64), UWC/CE 6.3 (from JCS5 + 122794-17__UWC63-4.01_core__x86), Instant Messaging 7.2 (from JCS5 + 118790-29__IM72__x86-1 + 118787-28__IM72__x86-2), Calendar Server 6.3 (from JCS5 + 121658-28__iCS63__x86). The web-components (UWC/CE, IM, /httpbind) are deployed in a Sun Web Server 7.0U1 as well.
    This zone is named "sunmail.domain.ru" and has a routed IP address for direct external access to its servicess.
    The AM SDK part is also patched (126357-01__AM71_x86); it points to the load-balancer name ("psam.domain.ru") as an actual AM server.
    # imsimta version
    Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 64bit)
    libimta.so 6.3-6.03 (built 17:15:08, Mar 14 2008; 64bit)
    SunOS sunmail 5.10 Generic_127112-07 i86pc i386 i86pc
    While setting up this server set we tried to use AM SSO as the user login method, but it works unreliably.
    "Unreliably" means that while most of the time entering a correct uid and password in Access Manager login page ("http://psam.domain.ru/amserver/UI/Login") does redirect a user back to "http://sunmail.domain.ru/uwc/auth" along with a new cookie, and the user is redirected again to his or her mailbox, sometimes the user receives the UWC/CE login page. Entering the same uid and password here does log him in, but it breaks the whole point of SSO and only increases the end-user routine required to log in :\
    We have also seen the "missing mail tab" problem - if the users point the browser to any hostname different from "sunmail.domain.ru" (i.e. www.mail.domain.ru which is equivalent in DNS), they have only the Address book, Calendar and Options tabs; no webmail. So far this is resolved by Policy Agent forcing The One name of the server.
    Here's the configuration we did specifically for AM SSO:
    1) in AMConfig.properties of "sunmail" and "cos-psam-01" we set up
    com.iplanet.am.cookie.encode=false
    am.encryption.pwd=<the same value>
    all hostname-related parameters point to "psam.domain.ru"
    2) in AMConfig.properties of "cos-psam-01" a number of FQDN equivalence entries are added (so it does not redirect to a server hostname unknown to visitors):
    com.sun.identity.server.fqdnMap[publicname-or-ip]=psam.domain.ru
    com.sun.identity.server.fqdnMap[cos-psam-01.domain.ru]=cos-psam-01.domain.ru
    3) in "msg.conf" on "sunmail" (entries added via configutil):
    local.webmail.sso.amcookiename = iPlanetDirectoryPro
    local.webmail.sso.amnamingurl = http://psam.domain.ru:80/amserver/namingservice
    local.webmail.sso.singlesignoff = yes
    local.webmail.sso.uwcenabled = 1
    service.http.ipsecurity = no
    (perhaps some more options are required? Looking for confirmation about: local.webmail.sso.uwclogouturl local.webmail.sso.uwccontexturi local.webmail.sso.uwchome service.http.allowadminproxy )
    4) Configured Web Policy Agent for Sun Web Server, so that users without an AM session are required to get one. Set up per [http://msg.wikidoc.info/index.php/AM_redirection_using_Policy_Agent], except that com.sun.am.policy.agents.config.notenforced_list points to the many names our server can go known by.
    5) Updated the logout URL in /opt/SUNWuwc/webmail/main.js:
    --- main.js.orig        Sat Jan 26 07:52:09 2008
    +++ main.js     Mon Jul 21 01:06:29 2008
    @@ -667,7 +667,8 @@
    function cleanup() {
       if(laurel)
    -      top.window.location =  getUWCHost() + "/base/UWCMain?op=logout"
    +//      top.window.location =  getUWCHost() + "/base/UWCMain?op=logout"
    +      top.window.location =  "http://sunmail.domain.ru:80/base/UWCMain?op=logout"
       else
           exec('logout', '', 'exit()')
    @@ -1707,7 +1708,8 @@
       if(lg) {
             url = document.location.href
             url = url.substr(0,url.indexOf('webmail'))
    -        uwcurl = url + 'base/UWCMain?op=logout'        
    +//      uwcurl = url + 'base/UWCMain?op=logout'        
    +        uwcurl = "http://sunmail.domain.ru:80/base/UWCMain?op=logout"
       exit()
    }6) Calendar SSO - per docs...
    According to ngrep sniffing,
    1) the browser goes to "http://sunmail.domain.ru/uwc/auth" without any cookies
    2) receives a redirect and goes to "http://psam.domain.ru/amserver/UI/Login?gotoOnFail=http://sunmail.domain.ru:80/uwc&goto=http%3A%2F%2Fsunmail.domain.ru%3A80%2Fuwc%2Fauth"; sends no cookies either.
    3) The first response from the "psam" server (as redirected from "cos-psam-01") sets a few cookies while rendering the login page:
    Set-cookie: JSESSIONID=7EF8F2810D2071CA03CFEAE9972735B2; Path=/
    Set-cookie: AMAuthCookie=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#; Domain=.domain.ru; Path=/
    Set-cookie: amlbcookie=02; Domain=.domain.ru; Path=/
    4) The browser requests the login page resources (javascripts, images, etc) using these cookies, as in this header line:
    Cookie: JSESSIONID=7EF8F2810D2071CA03CFEAE9972735B2; AMAuthCookie=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#; amlbcookie=02
    5) The browser POSTs the login request to "/amserver/UI/Login" and receives a redirection to http://sunmail.domain.ru:80/uwc/auth
    Set-cookie: iPlanetDirectoryPro=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#; Domain=.domain.ru; Path=/
    Set-cookie: AMAuthCookie=LOGOUT; Domain=.domain.ru; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
    6) The browser requests "http://sunmail.domain.ru/uwc/auth" using the newly set cookie (looks like the old one to me though):
    Cookie: amlbcookie=02; iPlanetDirectoryPro=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#
    7) The "sunmail" web-server checks the AM session validity with the same "psam.domain.ru". It sends a series of POSTs to /amserver/namingservice:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="com.iplanet.am.naming" reqid="685">
    <Request><![CDATA[
    <NamingRequest vers="1.0" reqid="324" sessid="AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#">
    <GetNamingProfile>
    </GetNamingProfile>
    </NamingRequest>]]>
    </Request>
    </RequestSet>(receives a large XML list of different Access Manager configuration parameters and URLs)
    ...then a double-request to /amserver/sessionservice:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="Session" reqid="686">
    <Request><![CDATA[
    <SessionRequest vers="1.0" reqid="678">
    <GetSession reset="true">
    <SessionID>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#</SessionID>
    </GetSession>
    </SessionRequest>]]>
    </Request>
    <Request><![CDATA[
    <SessionRequest vers="1.0" reqid="679">
    <AddSessionListener>
    <URL>http://sunmail.domain.ru:80/UpdateAgentCacheServlet?shortcircuit=false</URL>
    <SessionID>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1+xTqH7C3I=@AAJTSQACMDI=#</SessionID>
    </AddSessionListener>
    </SessionRequest>]]>
    </Request>
    </RequestSet>As a result it receives an XML with a lot of user-specific information (the username, LDAP DN, preferred locale, auth module used, etc.)
    !!!*** Now, the problem part ***!!!
    8) And then "sunmail" POSTs a broken cookie to "psam" (note the space in mid-text, where the "plus" sign was previously). As we know, "+" is often used in URLs to "escape" the space character. Perhaps some URL cleanup routine backfired here.
    I have double-checked, it is not the reverse proxy on "psam" breaking things. It is "sunmail" (UWC/CE or Policy Agent, don't know for certain) supplying the broken request. I looked over the large XML responses to the two previous requests, whenever they mention the session cookie value, the "plus" is there.
    For the most detail I can provide, I'll even paste the whole HTTP packet:
    POST /amserver/sessionservice HTTP/1.1
    Proxy-agent: Sun-Java-System-Web-Server/7.0
    Cookie: iPlanetDirectoryPro=AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=#;amlbcookie=null
    Content-type: text/xml;charset=UTF-8
    Content-length: 336
    Cache-control: no-cache
    Pragma: no-cache
    User-agent: Java/1.5.0_09
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Host: cos-psam-01.domain.ru
    Client-ip: 194.xxx.xxx.xxx
    Via: 1.1 https-weblb.domain.ru
    Connection: keep-alive
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="session" reqid="258">
    <Request><![CDATA[<SessionRequest vers="1.0" reqid="254">
    <GetSession reset="true">
    <SessionID>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=#</SessionID>
    </GetSession>
    </SessionRequest>]]></Request>
    </RequestSet> The server's error response is apparent:
    HTTP/1.1 200 OK
    Server: Sun-Java-System-Web-Server/7.0
    Date: Thu, 31 Jul 2008 05:49:50 GMT
    Content-type: text/html
    Transfer-encoding: chunked
    19b
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ResponseSet vers="1.0" svcid="session" reqid="258">
    <Response><![CDATA[<SessionResponse vers="1.0" reqid="254">
    <GetSession>
    <Exception>AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=# Invalid session ID
    AQIC5wM2LY4SfcwuT2ASCrsfO78nXdceEHXeH1 xTqH7C3I=@AAJTSQACMDI=#</Exception>
    </GetSession>
    </SessionResponse>]]></Response>
    </ResponseSet>On the few occasions when the AM cookie contains no "plus" characters, the SSO works like a charm (also checked by a sniffer). Whenever there is a "plus", it breaks.
    For reference, here's a working final request-response (one with a good cookie, as received by the load-balancer web-server). Request looks a bit different:
    POST /amserver/sessionservice HTTP/1.1
    Cookie: iPlanetDirectoryPro=AQIC5wM2LY4Sfcy/5sEzVmuq9z1ggdHOkBDgVFAwfhqvn4U=@AAJTSQACMDI=#;amlbcookie=null
    Content-Type: text/xml;charset=UTF-8
    Content-Length: 379
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.5.0_09
    Host: psam.domain.ru
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <RequestSet vers="1.0" svcid="session" reqid="281">
    <Request><![CDATA[<SessionRequest vers="1.0" reqid="277">
    <SetProperty>
    <SessionID>AQIC5wM2LY4Sfcy/5sEzVmuq9z1ggdHOkBDgVFAwfhqvn4U=@AAJTSQACMDI=#</SessionID>
    <Property name="uwcstatus" value="active"></Property>
    </SetProperty>
    </SessionRequest>]]></Request>
    </RequestSet> ...and the response is OK:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ResponseSet vers="1.0" svcid="session" reqid="281">
    <Response><![CDATA[<SessionResponse vers="1.0" reqid="277">
    <SetProperty>
    <OK></OK>
    </SetProperty>
    </SessionResponse>]]></Response>
    </ResponseSet>

    There have been a few reports of the same behaviour with other customers - specifically with the handling of the encoding of "+" characters to " ". It relates to how cookie encoding/decoding is performed (as you have already observed).
    The solution for these customers was the following:
    => AM server/client side:
    Ensure that com.iplanet.am.cookie.encode=false in AMConfig.properties and AMAgent.properties on all systems.
    => AM client (UWC) side:
    - Set <property name="encodeCookies" value="false"/> in /var/opt/SUNWuwc/WEB-INF/sun-web.xml. This will prevent UWC from trying to urldecode the cookie it receives and therefore stops it turning the + into a space e.g.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Servlet 2.3//EN' 'file:///net/wajra.india.sun.com/export/share/dtd/sun-web-app_2_3-1.dtd'>
    <sun-web-app>
       <property name="encodeCookies" value="false"/>
       <session-config>
          <session-manager/>
       </session-config>
       <jsp-config/>
    <property name="allowLinking" value="true" />
    </sun-web-app>Regards,
    Shane.

  • Whenever I use the search the results page comes up but if I try and access any of the pages i get the Not responding message

    I can access all my favourite websites ok. It is only when I try and access a page from using Search.

    Your plugins list shows two Flash plugins and other outdated plugin(s) with known security and stability risks.
    # Shockwave Flash 10.0 r45
    # Shockwave Flash 10.1 r53
    # Adobe Shockwave for Director Netscape plug-in, version 11.0
    # Next Generation Java Plug-in 1.6.0_19 for Mozilla browsers
    Flash Player uninstall: http://www.adobe.com/go/tn_14157 (this will remove the Firefox Flash plugin and the ActiveX control for IE)
    Update the [[Flash]] and [[Shockwave|Shockwave for Director]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    *http://www.adobe.com/shockwave/welcome/
    *http://www.adobe.com/downloads/
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    Do a malware check with a few malware scan programs.<br />
    You need to use all programs because each detects different malware.<br />
    Make sure that you update each program to get the latest version of the database.
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    See also "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked and [[Searches are redirected to another site]]

  • RE: Java and Forte

    We have no problem using JDK 1.1.5. However, we are using Orbixweb. If
    you are accessing the applet and the IOR file from the same host (exact
    host name), then one other possibility is the JVM compatibility for your
    browser. Using Javasoft's Activator or appletviewer should resolve
    that.
    -----Original Message-----
    From: Kamran Amin [SMTP:[email protected]]
    Sent: Tuesday, March 10, 1998 7:48 AM
    To: '[email protected]'; '[email protected]'
    Subject: RE: Java and Forte
    Dan,
    We had the same problem as you are having regarding question
    one. Make
    sure you are
    using JDK 1.1.3 or 1.1.4. It did not work for me when I was using JDK
    1.1.5. Also you have to
    use the gatekeeper to make the applet work. Hope this help.
    Kamran Amin
    Forte Technical Leader, Software Engineering
    [email protected]
    203-459-7362
    Oxford Health Plans
    48 Monroe Turnpike
    CT, Trumbull 06611
    http://www.oxhp.com/
    From: [email protected][SMTP:[email protected]]
    Sent: Monday, March 09, 1998 7:49 PM
    To: [email protected]
    Subject: Re: Java and Forte
    1. I have been able to make my Java client appllication call-in to a
    Forte service object with success. However the tricky part beginswhen
    I try to do the same with a Java applet. I get an exception returned
    which is an AppletSecurityException. I understand that running a Java
    applet in a browser has two limitations, one being the Java applet
    sandbox and the firewall restriction. As I am only running my Java
    applet and the Forte service object on the same node, this rules out
    the latter.
    I have tried running the Gatekeeper from the same directory as myJava
    client application, which includes all the client stub files
    (including stub files which are generated from Forte supplier plans
    such as those in the Framework folder). However, I still receive the
    AppletSecurityException.
    How can I go about making this operation successful?
    **AppletSecurityExceptions can be caused by many problems--trying toaccess
    machines other than the class download machine, or trying to accessserver
    side classes outside the defined directory structure in the webserver. I'd
    look closely at the classes that are being brought into memory (forexample,
    Visibroker's ORB shows you each file as it is loaded) and make sureyour web
    server is defined correctly. If you follow the Forte technotesclosely, it
    usually solves this problem.
    2. Has anyone tried implementing a 'fat' client, one that combines a
    Forte web application, JavaScript, and a Java applet client toperform
    operations such as validation and a tiny bit of data processing allon
    the client side, relieveing the application server from such
    operations? If yes, how do I implement the solution, and are thereany
    tech notes from Forte that specifically tell me how to do this?
    **We have created a Java framework that follows many of the designpatterns
    and naming conventions as our Forte framework. The Java classes canbe
    extended to marshal and unmarshal scalar data structs passed acrossthe ORB
    boundary to instantiate 'thick' functional objects on the client, andas much
    processing and as many business rules as wanted can be developed inthe
    client
    Java objects.

    If you look at the exception information in the iiop manual it
    discusses exteneded propties DefaultThrowsClause, ThrowsClause and
    IsThrowable.
    If you mark your exception class with IsThrowable it will show up in the
    IDL as an exception. If you use either DefaultThrowsClause(project) or
    ThrowsClause(method) you will get the appropriate raises in the idl.
    This will cause the idl2java to produce code which will allow you to catch
    the exception.
    Tom.
    At 09:41 AM 1/29/99 +0100, Giuseppe Sorce wrote:
    >
    Hi all,
    I am currently working to an architecture to establish a communication
    between a Forte' server and a Java client, using Visigenic's Visibroker and
    IDL mode.
    I have problems when I try to raise a Forte' exception from a method
    invoked by the Java client; I would like the exception class
    (ProductException) not to inherit from the class GenericException, because
    the IDL I want to generate must have this structure:
    exception ProductException {
    string message;
    Using this solution, the client application gets blocked waiting forever.
    I am currently working with:
    - Forte' 3.0.G.2 plus WebEnterprise 1.0.B
    - JDK 1.1.5
    - Visibroker 3.1
    My question is: is it possible to raise an exception from the Forte' side
    that is
    compliant to the IDL mentioned above?
    Of course it should be caught from the Java side.
    Thank you in advance
    Giuseppe Sorce
    CSI Piemonte - C.so Unione Sovietica 216 - 10134 Torino - ITALY
    tel. +39-011-3168736
    fax +39-011-3168212
    e-mail [email protected]
    url http://www.csi.it
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Java and MS SQL Server 2000 problem, please help

    please help me. I am using java and MS SQL Server 2000, and I'm trying to access and verify the login. I'm getting the following error message: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
    Can any please help in this regard.
    String userNumber = (String)userNumField.getValue();
    char[] userPasswordArray = userPasswordField.getPassword();
    String userPassword = new String(userPasswordArray);
         try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc:odbc:Dikolobe_Data");
                java.sql.PreparedStatement statement = connection.prepareStatement(
                        "SELECT USER_NUMBER, USER_PASSWORD, USER_CLASS, USER_STATUS " +
                        "FROM SYS_USER " +
                        "WHERE (USER_NUMBER = ? AND USER_PASSWORD = ?);");
                statement.setString(1, userNumber);
                statement.setString(2, userPassword);
                java.sql.ResultSet result = statement.executeQuery();
                if(result.next()) {
                    String userStatus = result.getString(4);
                    if(userStatus.equals("logged on")) {
                        String loginErrorMessage = "User with number: " + userNumber + " is already logged on.";
                        javax.swing.JOptionPane loginErrorPane = getNarrowOptionPane(72);
                        loginErrorPane.setMessage(loginErrorMessage);
                        loginErrorPane.setMessageType(javax.swing.JOptionPane.ERROR_MESSAGE);
                        javax.swing.JDialog loginErrorDialog = loginErrorPane.createDialog(null, "Login Error");
                        loginErrorDialog.setVisible(true);
                    else {
                        String userClassification = result.getString(3);
                        if(userClassification.equals("Administrator")) {
                            AdminHomePage newAdminHomePage = new AdminHomePage();
                            newAdminHomePage.setVisible(true);
                        else if(userClassification.equals("Educator")) {
                            EduHomePage newEduHomePage = new EduHomePage();
                            newEduHomePage.setVisible(true);
                        statement = connection.prepareStatement(
                                "UPDATE SYS_USER SET USER_STATUS = ? " +
                                "WHERE USER_NUMBER = ?");
                        statement.setString(1, "logged on");
                        statement.setString(2, userNumber);
                        statement.executeUpdate();
                        dispose();
                }

    Doesn't the following link give you enough information?
    http://www.google.com/search?q=invalid+descriptor+index
    Anyway .. This error means that the given ResultSet column index which you're trying to retrieve the value from is out of the range.

  • Workflow API: adding and accessing file Attachments to a Human Task

    Hi there,
    I am using the Workflow Services Java API (11.1.1) for SOA Suite to access and manipulate human tasks. I would like to be able to access and add file attachments to existing human tasks. I am using the methods provided in the AttachmentType interface.
    When adding an attachment, the problem I am running into is that an attachment does created and associated with the task, however it is empty and has no content. I have attempted both setting the input stream of the attachment, as well as the content string and in each case have had no success.
    I have successfully added and accessed an attachment using the worklist application, however when trying to access the content of this attachment through code I receive an object with mostly null/0 values throughout, apart from the attachment name.
    As the API's are not overly rich in documentation I may well be using them incorrectly. I would really appreciate any help/suggestions/alternatives in dealing with BPEL task attachments.
    Thanks
    The code I am using resembles:
    List attachments = taskWithAttachments.getAttachment();
    for(Object o : attachments){
    AttachmentType a = (AttachmentType) o;
    String content = a.getContent(); +// NULL+
    InputStream str = a.getInputStream(); +// NULL+
    String name = a.getName(); +// Has the attachment name+
    String mime = a.getMimeType(); +// Has the mime type+
    long size = a.getSize(); +// 0+
    Edited by: 855489 on May 2, 2011 4:23 PM
    Edited by: 855489 on May 2, 2011 8:48 PM

    I am also facing the same issue, using 11.1.1.6, anyone managed to solve this?
    Regards
    Venkat

Maybe you are looking for

  • HP Laserjet 2100TN - how to add IP printer in Snow Leopard

    I am not a very technical person, so this was quite an ordeal for me.  I was very frustrated by the process and almost gave up.  I am glad that I did not I just upgraded to Snow Leopard and after many hours of reading blogs and instructions etc. I fi

  • Sales order with reference to Service Notification

    Hi Freinds, I have to create a sales order with reference to Service notification (IW51). can someone sugggest me BAPI or Function module to perform this task. Appriciate your help. Best regards Pravin

  • HT201328 Is there a way to see if the AT&T unlock process worked and actually unlocked my old 4S?

    Is there a way to check my iphone 4S to see if it was actually unlocked by AT&T? They could not tell that it was. They just said it was approved 24 hours ago and to wait until today to restore it. I did this thru iCloud not iTunes if that matters. Th

  • How to add highlight mark to video?

    I'm a novice video editor. I need to produce a sports video, and I need to highlight an individual player by putting a circle, an arrow, or some other type of highlight around the individual player for a second or two. Anyone know how to do this? I k

  • My Mountain Lion wont download, what should I do?

    I just bought a new macbook pro and I received a free OS X Mountain Lion download. But it wont let me download the app because it says it wasnt signed or the file was not verified. Can someone help?