Getting drive list in java  application

How I can get the list of phisical and
logical drives in a computer?
I want to show this into a JComboBox...
can someone help me? thanks
simONE - Rome

public class JDriveComboBox extends JComboBox {
     private static final long serialVersionUID = 1L;
      * The Constructor of this class
     public JDriveComboBox(){
          super();
          File[] roots=File.listRoots();
          for(int i=0;i<roots.length;i++){
               this.addItem(roots.getPath());

Similar Messages

  • How to get a list of every application on my computer?

    I'm trying to figure out how to get a list of every application on my computer using applescript. I know it is possible for the system to do this, as evidenced by the dialog you get when you use the "choose application" function. Other examples are doing a spotlight search for "kind:app" or programs like Namely or QuickSilver.
    Is there a way to do this in applescript? The only solution I've come up with so far is to use the command:
    <pre>set everyapplicationaliases to choose application as alias with multiple selections allowed</pre>
    and manually select all on the resulting dialog. I can then take the results and go from there, however there are a few significant problems with this approach.
    1. It requires user interaction. (I have an idea for some future applications that could use this functionality if it can be done without user input.)
    2. It's horribly slow. As a test run I choose all the applications from the dialog, extracted some basic info and put the result on the clipboard. It took a couple of minutes to complete this relatively basic task. In comparison, running the aforementioned spotlight search took maybe ten seconds.
    Thanks in advance!
    best,
    peter

    For these specific queries my results are...
    set appList to paragraphs of (do shell script "mdfind \"(kMDItemKind = 'application'c) || (kMDItemKind = 'widget'c)\"")
    3082
    set appList to paragraphs of (do shell script "mdfind \"(kMDItemKind = 'Application'c) || (kMDItemKind = 'Widget'c) ||
    ((kMDItemContentTypeTree = 'com.apple.application') && (kMDItemContentType != com.apple.mail.emlx) && (kMDItemContentType != public.vcard))\"")
    3115
    I think I finally found some numbers that make sense!
    When I search for Kind:Application by the Command+F method in the Finder, I get a total of 2521 items, of which 2477 are "Applications" and 44 are "Other".
    (Just by eyeballing it, "Other" seems to include some Classic Apps and some .bundle files.)
    The total # found by this method (2521) plus the number of Widgets found using mdfind (318) equals the number of total number of items found by spotlight (2839).
    I also noticed that these numbers almost equal the spotlight number:
    mdfind results for kMDItemKind:
    Widgets: 318
    Applications: 1684
    Classic*: 795
    and
    Command+F "Other" items: 44
    3181684+79544 = 2841
    It may be a fluke that this is so close to the 2839 spotlight gives, or maybe there's an overlap somewhere...
    Tying this back into my initial question, it seems like the original mdfind command for Applications is probably the best answer for what I was looking for,
    since I wasn't really thinking about Classic apps and Widgets anyway.

  • How do I get rid of a java application unistall set that keeps popping up on everything I do

    Every time I open Firefox I get the Java Application unistall set How do I get rid of it so I can Go to different sites without it popping up all the time.

    Settings > iTunes and App Store > Apple ID = Sign Out...
    Then Sign In using the preferred Apple ID.
    Note:
    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622

  • Getting notification back to java application with Goldengate

    Hello,
    I am new to using Golden Gate. I have a java application running in an application server environment using Oracle database. We plan to use Goldengate to receive data directly in the database from external database. I have few questions in using goldengate:
    1. Is there a way for my application to know that database change to a table has happened?
    2. I came across goldengate and jms notification. Is there a non-jms way using java API for my application to know real-time that change has happened to database table?
    3. Are there any samples for this type of feature?
    Thank you.

    There is a Java API that can be used directly, rather than just using the built-in JMS delivery.
    The way it works: "extract" reads a trail, as the data is read, events are generated, and your custom event handler can receive these events. Types of basic events are "transaction begin", "new operation (insert, update, delete)", "transaction commit". These events are basically replaying what has happened on the source database; so, for example, if on the source DB you have "begin tx" + "insert" + "update" + "commit", then your custom Java event handler will receive an event for "begin tx", "insert", "update" and "commit".
    One thing to consider early on: the event handlers can work in one of two "modes". Either an entire source database transaction can be cached in memory and processed at once, OR you can process one operation at a time. The latter is typically preferable, since any DBA or batch job can be executed on the source DB that updates a few million rows at once, which could cause your JVM to run out of memory in "transaction mode" as it tries to cache this in memory. On the other hand, in "operation mode" you only need enough memory to hold one operation at a time, but you don't know what operations have already happened or what will happen. In "operation mode" you are free to cache your own data in your custom event handler, though -- as much or as little as you need.
    Note: GoldenGate only captures committed transactions, so you won't ever receive rolled back database transactions; however , there may be "interruptions" in the GG trail if/when a GG process abends & restarts. This puts a virtual "rollback" into the trail (technically, it's a restart/abend marker) which a GG replicat fully understands. The GG user-exit API prior to v11.2 does not pass RestartAbend events to any user-exits -- including the Java adapter. Long story short, your source "extract" (the one capturing changes from the source DB) must create trails with the "Format Release 9.5" qualifier, or (equivalently) specify "RecoveryOptions OverwriteMode". If you do this, then there will be no "restart/abend" markers in the trail. However, under certain (odd) circumstances, it may not be entirely possible to create trails in this format. The format 10+ trails (aka "RecoveryOptions AppendMode") are slightly more resilient to system failures, and do have additional file header info that is not available in "format 9.5" trails. Although GG 11.2 is available, the user-exits (the Java adapter & flat-file writer) that use this new API are presently not yet generally available.
    Ok, with the caveats out of the way, here's a code sample:
    package tst;
    import com.goldengate.atg.datasource.*;
    import com.goldengate.atg.datasource.GGDataSource.Status;
    public class HelloWorldHandler extends AbstractHandler {
      private long numTxs = 0;
      private long numOps = 0;
      private long numCols = 0;
      @Override
      public Status operationAdded(DsEvent e, DsTransaction tx, DsOperation operation) {
        super.operationAdded(e, tx, operation);
        numOps++;
        numCols += operation.getNumColumns();
        return Status.OK;
      @Override
      public Status transactionCommit(DsEvent e, DsTransaction tx) {
        super.transactionCommit(e, tx);
        numTxs++;
        return Status.OK;
      @Override
      public String reportStatus() {
        String s = "Processed (mode='" + getMode() + "')" + " transactions=" + numTxs
                  + ", operations=" + numOps + ", columns=" + numCols;
        return s;
    }That's about as basic as it gets. It will print out number of operations processed to the report file (dirrpt/*.rpt). The Java user-exits typically are an "end point" for the data stream (that's what the "CuserExit... PassThru" option means), so this example isn't terribly useful by itself. Typically you would send the data somewhere else (like the JMS handler, or a file-writer) or update some other system with these events.
    Btw, there are also a few helper classes to merge metadata (column/table names) and data (column "before" and "after" data). The "DsTransaction" and "DsOperation" and "DsColumn" classes are just "data". The following wrapper classes also provide metadata (Tx, Op, Col):
      import com.goldengate.atg.datasource.adapt.*;
      Tx tx = new Tx(dsTransaction, getMetaData(), getConfig());
      //or:  Op op = new Op(dsOperation, tableMeta, getConfig());
         for(Op op: tx) {
              for(Col c: op) { ... }
      }See the javadoc that comes with the software download for details (javadoc.zip).
    To compile and use (preferably creating a jar; I'm assuming you put it in "dirprm" (see below)):
    $ javac -d classes -cp {gg_home}/ggjava/ggjava.jar HelloWorldHandler.java
    $ jar -cvf myCustom.jar ...etc...Your extract ("pump") parameter file that loads and runs your custom Java user-exit event handler:
    Extract javaue
    SourceDefs dirdef/tc.def
    SetEnv ( GGS_USEREXIT_CONF = "dirprm/javaue.properties" )
    GetEnv (JAVA_HOME)
    GetEnv (LD_LIBRARY_PATH)
    -- CUserExit ggjava_ue.dll CUSEREXIT PassThru IncludeUpdateBefores
    CUserExit libggjava_ue.so CUSEREXIT PassThru IncludeUpdateBefores
    GetUpdateBefores
    -- must pass all data to user-exit, or
    -- else tx indicators might be missed
    TABLE GGS.*;
    TABLE EXAMPLE.*;And the referenced properties file could look like the following. There are really two parts to this file; the first part is used to configure the Java application, the second is used to configure the JNI bridge between the JVM and "extract".
    # Java application properties
    gg.handlerlist=mytest
    # your custom event handler.
    # note: setting property foo=bar automatically calls your handler's method setFoo("bar")
    gg.handler.mytest.type=tst.HelloWorldHandler
    gg.handler.mytest.foo=bar
    gg.handler.mytest.mode=op
    # gg.handler.mytest.mode=tx
    # Properties for native library ("C" User Exit)
    # set to TRUE to *disable* the duplicates-checkpoint-file
    goldengate.userexit.nochkpt=TRUE
    # duplicates-checkpoint-file prefix
    goldengate.userexit.chkptprefix=JAVAUE_
    # tx timestamp datatbase local (default) or UTC timestamp
    goldengate.userexit.timestamp=utc
    # C-user-exit logging config for native library *only*.
    # Java app uses log4j config in javawriter.bootoptions.
    goldengate.log.modules=TXSTORE,JAVAWRITER,JAVAUSEREXIT
    goldengate.log.level=INFO
    goldengate.log.tostdout=false
    goldengate.log.tofile=true
    # prefix for native library logfile name
    goldengate.log.logname=cuserexit
    goldengate.userexit.writers=javawriter
    # native lib statistics, defaults: time=3600, numrecs=10000
    #   display=false (doesn't write to file)
    #   full=false (would not include java report)
    javawriter.stats.time=3600
    javawriter.stats.numrecs=100
    javawriter.stats.display=TRUE
    javawriter.stats.full=TRUE
    # Set classpath to required jars.
    #    Use ':' path separator for Unix, ';' for windows.
    # Set the log4j configuration -- note this found in the classpath.
    #    See the example preconfigured log4j files in ggjava/resources/classes,
    #    copy to dirprm and rename, then customize as desired. (Don't put or
    #    modify files in the ggjava/* directory.)
    javawriter.bootoptions=-Xmx64m -Xms32m -Djava.class.path=dirprm:ggjava/ggjava.jar:dirprm/myCustom.jar -Dlog4j.configuration=log4j.propertiesNote that the property "bootoptions" includes "myCustom.jar" to find your class. You can use your custom log4j config as well (e.g., my-log4j.properties); put it in "dirprm" as well and it will be found in the classpath.
    See also the GoldenGate Java docs for a little more on this topic:
    * http://www.oracle.com/technetwork/middleware/goldengate/documentation/index.html => http://docs.oracle.com/cd/E18101_01/index.htm
    Hope it helps,
    -Michael
    Edited by: MikeN on Jun 20, 2012 10:34 PM - notes on trail format compatibility

  • Images not getting Loaded while running Java Application through jar file

    Hello Friends,
    I have a problem while starting my application.I have written my application using pure java.There is no JSP or anything just pure swings.Mine is a standalone appplication.So i used to run it using a batch file.And when i used to start my application it used to not show me the images.so what i did was i mentioned the starting directory in the properties of the batch file (ie in the start in column field).But that was when i was using weblogic server.And i have lot of people working on the same application.so i used ZAC publisher in weblogic and along with that i used to publish the batch file also.so the users dint have any problem.But now what is my problem is i m trying to use JAVA Webstart instead of weblogic ZAC.Now in webstart what happens is that i have to run the appliaction thru jar file.so where do i mention the class path so that the images get loaded.As of now the imaes are not getting loaded.i feel this is a class path problem.but where do i mention it that is my problem.It would be really helpfule if someone could help me out.
    thanx and regards,
    [email protected]

    try out this
    ImageIcon img1=new ImageIcon(this.getClass().getResource(imagename));
    for exmaple
    Imageicon img1=new ImageIcon(this.getClass().getResource("name1.jpg"));
    dont 4get to include the image files in the jar file

  • Java does not get file list from shared folder in another server.

    Hi,
    I'm using java 1.4.2.16,
    Command below does not get file list.
    import java.io.;*..
    File file = new File("\\\\10.242.22.28\\SapMII");
    File[] files = file.listFiles();
    SapMII folder is Everyone full Control permission.
    How can i solve this problem?
    Thanks.

    Could you please post replies in a more helpful way? Just informing me that it was an NPE doesn't really tell me anything. Post the stacktrace (Exception#printStackTrace()). And the listFile() methods API has this to say:
    Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.I'm able to run this sample code easily:
    import java.io.File;
    public class TestFileList {
         public static void main(String[] args) {
              File file = new File("\\\\10.40.55.33\\shared");
              File [] files = file.listFiles();
              for(File currentFile: files )
                   System.out.println(currentFile.getName());
    }

  • Building java applications using UML

    Hi all
    I want to get experience for building java applications using UML.
    Pls advice what is the best text book should I purchase??
    thanks
    madura

    I do not use UML to auto-generate codes either. Take a look at Martin Fowler's bliki on some quite good views about UML: http://www.martinfowler.com/bliki/uml.html
    What I do use UML for:
    1. To visualise the system being built during the analysis and design phases - both to help improve understanding and to keep the stakeholders happy.
    2. To reverse-engineer existing code that's weak on both design documents and code design. Makes understanding the code easier.
    3. To highlight areas in existing code that might benefit from the application of design patterns.
    As for how UML converts to Java code, the main diagrams are the Class Diagram and the Interaction Diagrams - Collaboration and Sequence. These diagrams translate to code very well.
    Hth.

  • How can I get a list of active users on an AS Java platform on a cluster?

    Hello Experts,
    I have an AS Java NetWeaver CE v7.1 EhP1 SP3 system and it's running in a cluster.  Do you know how I can get a list of all users that are currently logged in or whom have active sessions on each application server instance?
    Thanks,
    Sam

    > I don't know how to get classes used by VA for this tab.
    I wouldn't make any development investments based on classes for the VA anymore...
    Considering that not only Salvatore himself, but also the JControl might decide for itself that the system needs a hard shutdown and restart.. a possibly better solution would be to use a redirect. If the message server does does not respond or does not find any DIs or not the one which your previous session state was for, then redirect to a page with a meaningfulll message (and apology on it.
    Just a thought,
    Cheers,
    Julius

  • Issues while configuring java application using JDO with MS JDBC Driver 1.0

    We are in the process of configuring our java application with the production version of SQL Server 2005 Java Database Connectivity (JDBC) Driver 1.0. We are facing issues getting it to work with Sun App Server using JDO concept.
    After creating the data store, adding the JDBC driver to the application server classpath through console and also copying the driver into the lib directory, we are still getting the below error.
    Following is the stack trace encountered while running the application
    [#|2006-02-15T10:21:25.493+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb.entity.finder|_ThreadID=30;|JDO74010: Bean 'InventoryEJB' method ejbFindAllInventoryItems: problems running JDOQL query.
    com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
    NestedException: java.sql.SQLException: Error in allocating a connection. Cause: javax.transaction.SystemException
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.initializeSQLStoreManager(SQLPersistenceManagerFactory.java:870)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:786)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:673)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:849)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:681)
         at com.sun.j2ee.blueprints.supplier.inventory.ejb.InventoryEJB1142755294_ConcreteImpl.jdoGetPersistenceManager(InventoryEJB1142755294_ConcreteImpl.java:530)
         at com.sun.j2ee.blueprints.supplier.inventory.ejb.InventoryEJB1142755294_ConcreteImpl.ejbFindAllInventoryItems(InventoryEJB1142755294_ConcreteImpl.java:146)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:185)
         at $Proxy164.findAllInventoryItems(Unknown Source)
         at com.sun.j2ee.blueprints.supplier.inventory.web.DisplayInventoryBean.getInventory(Unknown Source)
         at org.apache.jsp.displayinventory_jsp._jspService(displayinventory_jsp.java:119)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
         at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
         at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
         at com.sun.j2ee.blueprints.supplier.inventory.web.RcvrRequestProcessor.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    Can anyone help me on this issue?
    Regards,
    Bindu

    I have already tried this before and this not work too, but strange that even if I use JDBC:ODBC bridge driver, the return value for output parameters are not correct, that is, only return the value that I input but not the value after executed in the procedure....
    The code that I used with JDBC:ODBC bridge is as follow:
    public static void main(String[] args) {
    String url = "jdbc:odbc:;DRIVER=SQL Server;Persist Security Info=False;database=db;Server=sql;uid=sa;pwd=pwd";
              Connection con;
              ResultSet rs = null;
    CallableStatement callS = null;
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              } catch(java.lang.ClassNotFoundException e) {
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
              try {
                   con=DriverManager.getConnection(url);
    callS = con.prepareCall("{ call dbo.CpJavaTest (?)}");
    callS.registerOutParameter(1, Types.INTEGER);
    callS.execute();
    rs=callS.getResultSet();
    int ret = callS.getInt(1);
    System.out.println("return value : " + ret);
                   while (rs.next()) {
                        String f1 = rs.getString(4);
                        String f2 = rs.getString(5);
                        System.out.println(f1 + " " + f2);
              } catch(SQLException ex) {
                   System.out.println("SQLException: " + ex.getMessage());
    The value of the output parameter is same as what I inputed! Hope any one can teach me how to correct it...
    Thank you very much!

  • Getting class not found error running java application using OIM libraries

    Hi,
    I have created a java application in which I access OIM libraries to fetch user list and then assign user roles. As i run the application it generates exception and program crashes. However, I am using the same libraries in OIM adapters and it is working fine. Following is the exception message i am getting.
    Caused by: java.lang.NoClassDefFoundError: org/springframework/jndi/JndiTemplate
    at oracle.iam.platform.OIMClient.<init>(OIMClient.java:83)
    at RoleAssignment.RoleAssignment.getUserAndChangePassword(RoleAssignment.java:143)
    at RoleAssignment.RoleAssignment.execute(RoleAssignment.java:81)
    at RoleAssignment.RoleAssignment.main(RoleAssignment.java:36)
    ... 5 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.jndi.JndiTemplate
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

    Hi,
    I resolved the problem by making spring.jar part of my executable jar file. I have added oimclient.jar, spring.jar, wlfullclient.jar, commons-logging.jar, and eclipselink.jar part of my executable jar. Now I am getting the error below. I googled it and it mentioned that i should add path of authwl.conf in my run configuration in eclipse. So i added the following line in " -Djava.security.auth.login.config=/u01/oracle/Middleware/Oracle_IDM1/server/CustomExec/authwl.conf " under the VM Arguments section of run configuration, but it continues to give the same error.
    java.lang.SecurityException: Unable to locate a login configuration
         at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:93)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at javax.security.auth.login.Configuration$3.run(Configuration.java:247)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.Configuration.getConfiguration(Configuration.java:242)
         at javax.security.auth.login.LoginContext$1.run(LoginContext.java:237)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.LoginContext.init(LoginContext.java:234)
         at javax.security.auth.login.LoginContext.<init>(LoginContext.java:403)
         at Thor.API.Security.LoginHandler.weblogicLoginHandler.login(weblogicLoginHandler.java:58)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:134)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:129)
         at com.infotech.tra.organization.RoleAssignment.getUserAndChangePassword(RoleAssignment.java:213)
         at com.infotech.tra.organization.RoleAssignment.execute(RoleAssignment.java:149)
         at com.infotech.tra.organization.RoleAssignment.main(RoleAssignment.java:49)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
    Caused by: java.io.IOException: Unable to locate a login configuration
         at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:250)
         at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:91)
         ... 24 more

  • How to remove Java Applications from "Add and Remove Programs" list?

    I have deployed my Java applications (both JWS and Applet) via JNLP with allow-offline option enabled and without installer-desc option specified.
    My questions are:
    1. An entry is added to the Add and Remove Programs list after launching the application via JNLP. Is it due to the specification of JNLP or JWS? Is there anyway to prevent this behavior?
    2. I removed my application by clearing the cache via Java Control Panel but the entry for the application is still listed in Add and Remove Programs. How can I remove the entry in the Add and Remove Programs?
    I have tried following methods but neither works:
    1.Go to Add and Remove Programs, and click [remove] button to the right of my application.
    *Warning message like 'Application cannot be uninstalled completely' is thrown.
    2.Follow instructions listed @ [Microsoft Online Support site|http://support.microsoft.com/kb/314481/en-us] to remove my application manually via Windows registry.
    *Couldn't find appropriate registry entry to delete.
    Thanks in advance!

    Hi, guys!
    This issue has been officially approved as a new bug (Bug Id: 6946221) for the JDK 1.6_20(might include any release below) release.
    It will take a couple of days for it to be shown up in the external Bug database. However, once it becomes available for viewing on external Bug database.I would like to encourage your valuable participation to vote on this bug to get it fixed ASAP by the SUN developer teams.
    Java Bug Database @
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221]
    Voting for the bug @
    [http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221]
    Thank you for your cooperation!
    Edited by: Jay-K on Apr 23, 2010 12:14 AM

  • How to get Formatted Mail Content through Java Application

    I am using a mail sending function in my applet code which is listed below:
    Main content is fetched from a format tool bar in JSP Page and it is passed as parameter to applet and it is used inside the mail content.
    Same content when passed and executed in a JSP page, the formatted content is not lost and it is included in mail content as what it is fetched from Format Tool Bar.
    Format is lost when it is used inside the Java Application mail sending function.
    The below code I have used to send mail:
    package com;
    import java.util.HashSet;
    import java.util.Properties;
    import java.util.Set;
    import javax.mail.BodyPart;
    import javax.mail.Message;
    import javax.mail.Multipart;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    class mailsendClass
    public void sendmail(String from,String host,boolean debug,String msgText)
         try
              Set tomailsid = new HashSet();
              Set ccmailsid = new HashSet();
              //to mail ids           
              tomailsid.add("[email protected]" );          
              tomailsid.add("[email protected]" );
              tomailsid.add("[email protected]" );
              //cc mail ids
              ccmailsid.add("[email protected]" );
              ccmailsid.add("[email protected]" );
              String mailarray[]= (String[])tomailsid.toArray(new String[tomailsid.size()]);
              String ccmailID[]= (String[])ccmailsid.toArray(new String[ccmailsid.size()]);
              Properties props = new Properties();
              //props.put("mail.smtp.port","425");
              props.setProperty("mail.smtp.host", host);
              if (debug) props.setProperty("mail.debug", ""+debug);
              Session session = Session.getInstance(props, null);
              session.setDebug(debug);
              String mailsubject = "Mail Subject";
              // create a message
              Message msg = new MimeMessage(session);
              msg.setFrom(new InternetAddress(from));
              javax.mail.internet.InternetAddress[] toAddress=new javax.mail.internet.InternetAddress[mailarray.length];
              for (int i=0;i<mailarray.length ;i++ )
              toAddress=new javax.mail.internet.InternetAddress(mailarray[i]);
              System.out.println ("id inside to address loop " + i + " is "+ mailarray[i]);
              System.out.println ("toAddress " + i + " is "+ toAddress[i]);
              msg.setRecipients(Message.RecipientType.TO, toAddress);
              msg.setSubject(mailsubject);
              try
                   javax.mail.internet.InternetAddress[] CCAddress=new javax.mail.internet.InternetAddress[ccmailID.length];
                   for (int i=0;i<ccmailID.length ;i++ )
                        CCAddress[i]=new javax.mail.internet.InternetAddress(ccmailID[i]);
                        System.out.println("CC Array is ===> " +CCAddress[i] );//          
              msg.setRecipients(Message.RecipientType.CC,CCAddress);
              catch(Exception ss)
                   System.out.println("CC mail Exception is ====>"+ ss);     
                   msg.setSentDate(new java.util.Date());
    //          Multipart multipart = new MimeMultipart("relative");
                   Multipart multipart = new MimeMultipart("alternative");
              BodyPart messageBodyPart = new MimeBodyPart();
              messageBodyPart.setContent(msgText, "text/html");
    //          messageBodyPart.setContent(msgText, "text/plain");
              multipart.addBodyPart(messageBodyPart);          
                   msg.setContent(multipart);
              Transport.send( msg );
         catch (Exception e)
              System.out.println("The Exception is ------>"+e);
    public class SendMail {
    public static void main(String[] args)
         System.out.println("before Mail Send ");
         mailsendClass mail = new mailsendClass();
         String from="[email protected]";
         String host="172.16.2.6";
         String msgText="<p><strong>Index</strong><br />I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:<br />• Engage<br />• Chapters 1–6<br /><a title='ftp:///Index' href='ftp://index/'>ftp:///Index</a><strong><br />XML Coding - Files with errors</strong><br />• Engage<br />• Chapters 1–6<br /><a title='ftp:///XML_Coding_Need%20Fixing' href='ftp://xml_coding_need%20fixing/'>ftp:///XML_Coding_Need%20Fixing</a></p>";
         mail.sendmail(from,host,true,msgText);
         System.out.println("after Mail Send ");
    Content placed in format tool bar is as follows:
    Index
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    • Engage
    • Chapters 1–6
    ftp:///Index
    XML Coding - Files with errors
    • Engage
    • Chapters 1–6
    ftp:///XML_Coding_Need%20Fixing
    Content fetched from format tool bar inside JSP page is as follows:
    <p><strong>Index</strong>
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    &bull; Engage
    &bull; Chapters 1&ndash;6
    <a title="ftp:///Index" href="ftp://index/">ftp:///Index</a><strong>
    XML Coding - Files with errors</strong>
    &bull; Engage
    &bull; Chapters 1&ndash;6
    <a title="ftp:///XML_Coding_Need%20Fixing" href="ftp://xml_coding_need%20fixing/">ftp:///XML_Coding_Need%20Fixing</a></p>
    Fetched Content inside Java Application through parameter and it will use as input for mail content is as follows:
    <p><strong>Index</strong>
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    • Engage
    • Chapters 1–6
    <a title="ftp:///Index" href="ftp://index/">ftp:///Index</a><strong>
    XML Coding - Files with errors</strong>
    • Engage
    • Chapters 1–6
    <a title="ftp:///XML_Coding_Need%20Fixing" href="ftp://xml_coding_need%20fixing/">ftp:///XML_Coding_Need%20Fixing</a></p>
    Actual mail received after Java Application execution is as follows:
    Index
    I have posted the following PDFs (Second Pages) as mentioned to start producing the Index:
    ? Engage
    ? Chapters 1?6
    ftp:///Index
    XML Coding - Files with errors
    ? Engage
    ? Chapters 1?6
    ftp:///XML_Coding_Need%20Fixing
    Unicode characters in the mail content are replaced by “?”.
    In the function listed above I have used the MIME Setting as
    Multipart multipart = new MimeMultipart("alternative");
    I have tried by using “relative” MIME format also as
    Multipart multipart = new MimeMultipart("relative");
    But I am not getting the actual format passed as input to the Java Application in the mail content.
    Can anybody let us know how to overcome this problem?
    Thanks in advance.

    You need to really understand how the different multiparts work instead of just guessing.
    But for your application, you don't need a multipart at all. Just use msg.setText(msgText, null, "html");
    Although that doesn't explain your problem, it will simplify your program.
    How are you determining that the mail received doesn't have the formatting? Are you viewing it in a
    mail reader (e.g., Outlook)? Or are you fetching it with JavaMail?
    Are you using an Exchange server? Exchange will often reformat your message to what it thinks you meant.

  • How to get the Database Driver list

    Hi... I want to know that particular database driver is registered or not in windows.. how can i get this info.
    And I want to get the list of all the database drivers registered in windows..
    Can anybody help me..

    dcminter wrote:
    Well, seeing as how none of them are registered, until your program registers them, simply keep a list.That's not actually true. If the JAR is in the classpath then a JDBC4 driver will use the service provider hooks to register itself.
    When first loaded. Which is unlikely to happen until you explicitly load it.
    Being on the classpath doesn't mean the JVM will actually do anything with a class. Either an application will have to initiate some action or it will have to be initiated by the manifest of the jar (and I'm not sure that will actually do anything until a class from that jar is actually required to be loaded).

  • How to get list of deployed application on server programatically?

    Hi,
    I am trying to build an application which will display list application(WebDynpro , Portal) deployed on portal server. In EP 7.0 we can go to Content Admin -> WebDynpro  page to get list of WebDynpro  application. Par files can be found under portal runtime->browse deployment page.
    In CE we have nice feature which shows both portal application and WebDynpro  application in content Admin->portal content list.
    I want to find list of applications programmatically, is there any way to achieve this? Are there any apis where I should take a look at.
    Thanks,
    Nitesh Shelar

    Hi,
    Thank you for your reply.
    I tried using
    String[] applications = WDServerState.getActualApplications();
    I am getting following exception.
    java.lang.UnsupportedOperationException: Not longer supported starting with NW07.
        at com.sap.tc.webdynpro.serverimpl.core.admin.AbstractServerState.getActualApplications(AbstractServerState.java:133)
        at com.sap.tc.webdynpro.services.sal.admin.api.WDServerState.getActualApplications(WDServerState.java:52)
    Do you know Any other api which I can use?
    Regards,
    Nitesh Shelar

  • Getting UWL workitem count in WD 4 Java Application

    Hi,
    Our team is trying to get the UWL workitem count that appears on the Tasks tab in a webdynpro for Java application . Is it possible to get the count .i.e. (New Workitems)/(Old Workitems) in a Webdynpro for Java application?
    Thanks
    Aditya

    PLEAAAASE!!! somebody help us out with this one, we really need to get this done, and given the lack of responses this has got so far, I think it might not be possible at all.
    Just some thoughts on the subject, anyway.
    When creating the UWLcontext, you need to set a user for it (e.g. context.setUser( ) ), so does that mean that I will never be able to get the UWL task list/count for more than one user at a time? and does that also mean that, if a user is set to the UWLContext, in order for it to work, it needs to be authenticated with an ongoing session at the time of execution?
    Again, please, these observations might or might not provide additional help in order to resolve this issue, but at least got to try something...

Maybe you are looking for

  • Create statspack report using sql*developer

    Hello, While connecting with PERFSTAT user I can not create statspack report using SQL*Developer: @?/rdbms/admin/awrrpt Error starting at line 1 in command: @?/rdbms/admin/awrrpt Error report: Unable to open file: "?/rdbms/admin/awrrpt.sql" Actually,

  • ISE Alarm : Critical : Profiler SNMP Request Failure : Server

    Ok, so this alarm is coming in repeatedly and is now on my projects list.  I get email alerts from the server that list thr NAD IP as the endpoint device and the Endpoint IP address is correct.  I've checked the settings and the endpoint is not liste

  • Error  running Adobe Document Services

    When trying to display a form, we get the following error (from the log): #1.5#005056B02A1A003500000001000002F800041CF15AB0F77A#1157722841432#com.adobe.AdobeDocumentServices#com.adobe/AdobeDocumentServices#com.adobe.AdobeDocumentServices#ADS_AGENT#72

  • Agent in expression not determined

    Hi All, I have a user decision step in my workflow.The agent for this step is determined programmatically and passed to a variable .In the agent assignment portion of user decision,I have used this variable(Expression).But it errors out at run time a

  • Missing movies and pictures?

    I wanted to change my password to itunes, and knew when I did that now the atv would not work. anyway went back to itunes and changed it back, did'nt go back to the atv for a couple of days, when I did wake it up I had no pictures no movies nothing,