Using WSSEC User token with WLS 702

Hi,
I am trying to use the WSSEC user token auth with WLS 7.0.2. I am not sure if I understand this correctly or not but I think WSSEC is not supported in my version. If so, which version do I need to upgrade to?
Also, as I understand it, there are three types of auth: Basic, Form and Client Cert. Which type(s) do I use to make sure my WSSEC user token is parsed correctly?
I have my HTTP Auth working correctly with Basic Auth and I neither have a Cert nor am I using a form to send my username and password (they are sent encoded in the SOAP headers).
Any help to get me moving would be greatly appreciated.
Thanks,
Sridhar.

Jong,
Thanks for your reply. I downloaded and installed WLS 813. I still am unable to do an wssec authentication. I think my problem is that I am more of a "do as you see" guy. So, if you have an example (with a properly configured deployment descriptor files), it would help me better.
I did look at your http://webservice.bea.com:7001/ scenarios. The only one which said anything about WSSEC was Scenario 3 and the invocation failed! So, I was unable to see the request to send over.
Currently, I am using Vordel SOAPBox to generate the request (with WSSEC username token added in).
All I want to do is authenticate my user based on my defined realm role using WSSEC username token and password (which happens to be the one which weblogic server starts with).
Any help with this would be much appreciated.
Thanks,
Sridhar.

Similar Messages

  • Workaround for using Oracle JDBC extension with WLS pooling

    Reading the newsgroup I saw that many of us encountered the problems
    with ClassCastException when tried to use Oracle JDBC extension
    with WLS pooling. I also had.
    In this case BEA recommends to use dangerous
    method getVendorConnection() which exposes
    the physical connection object to your code.
    Yes it's really dangerous because of unsafe usage may breaks
    WLS pooled connection(s).
    Moreover, this practice will make your JDBC code
    unportable (your JDBC code in addition to Oracle dependence
    became Weblogic dependent):
    void doSmth() {
    Connection con = ...;
    Connection vCon = ((WLConnection)con).getVendorConnection();
    // + mess of usage con in one places and vCon in others
    // (where Oracle extensions are needed)
    // !Don't forget to don't close vCon!
    Sux.
    I found the workaround.
    Introduction
    ============
    Yes the real cause of ClassCastException is that
    in depth of Oracle driver the casting
    to class oracle.jdbc.driver.OracleConnection
    (not to interface oracle.jdbc.OracleConnection)
    is performed.
    Someone can say that this is bug or pure desing.
    Weblogic pooled connection provide dynamic
    implementation for all public interfaces
    which real physical (wrapped) connection object implements.
    Great feature!
    But I guess that all interface methods implemented
    by simple call-delegation to physical (wrapped) connection object.
    In case of oracle.jdbc.OracleConnection interface
    this approach doesn't work for at least one its method:
    public OracleConnection unwrap()
    WLS pooled connection shoudn't implement this method by
    delegation to physical connection object BUT should
    return physical connection object itself!
    // Wrong implementation of unwrap()
    // delegation is used
    public OracleConnection unwrap() {
    return physicalConnection.unwrap();
    // Right implementation of unwrap()
    // physical connection returned
    public OracleConnection unwrap() {
    return physicalConnection;
    Workaround
    ==========
    1. Develop your own OracleConnection wrapper class:
    import oracle.jdbc.OracleConnection;
    import weblogic.jdbc.extensions.WLConnection;
    public class MyOracleConnectionImpl implements OracleConnection {
    private OracleConnection con;
    public MyOracleConnectionImpl(OracleConnection connection)
    throws SQLException
    this.con = connection;
    public OracleConnection unwrap() {
    return (OracleConnection)
    ((WLConnection)con).getVendorConnection();
    /* Implement all other methods by delegation to con object */
    2. Don't get Connections directly from DataSource --
    develop your own simple (may be static) utility
    class which retrives Connections from dataSource
    and returns them wrapped into your MyOracleConnectionImpl
    to your code from some method:
    puclic abstract class MyConnectionSource {
    public static Connection getConnection() {
    Connection con = // get it from DataSource
    return new MyOracleConnectionImpl((OracleConnection)con);
    3. Add attribute RemoveInfectedConnectionsEnabled="false"
    to definition of your JDBCConnectionPool within config.xml
    You may do it because of you `safely` use vendorConnection --
    you don't expose it to application code.
    4. Enjoy the Oracle JDBC extensions in your code!
    Example:
    Connection con = MyConnectionSource.getConnection;
    ArrayDescriptor add =
    ArrayDescriptor.createDescriptor("your_type", con);
    Hope it helps to someone.
    Best regards,
    Eugene Voytitsky

    Hello Eugene Voytitsky,
    Thanks Eugene Voytitsky for your idea
    I have tried the solution suggested by You, but it did not work.
    It still throws ClassCastException.
    I am sorry for posting the whole code of two classes below.
    I did this to give you more clarity.
    I am also indicating the place where the exception was thrown..
    Please let me know if I am doing something wrong.
    OracleConnection Wrapper class
    package ejbTesting;
    // sql imports
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.sql.SQLWarning;
    import java.sql.Statement;
    // util imports
    import java.util.Map;
    import java.util.Properties;
    // imports from Oracle Driver Classes
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OracleOCIFailover;
    import oracle.jdbc.OracleSavepoint;
    // import from Weblogic extensions
    import weblogic.jdbc.extensions.WLConnection;
    public class WeblogicConnectionWrapper implements OracleConnection
         // oracle connection object
         private OracleConnection connection;
         public WeblogicConnectionWrapper (OracleConnection orclConnection)
              try
                   this.connection = orclConnection;
              catch(Exception unexpected )
                   unexpected.printStackTrace();
         public OracleConnection unwrap()
              try
              // The datasource returns a weblogic.jdbc.pool.Connection
              // This needs to be type casted to weblogic.jdbc.extensions.WLConnection
              // Only this weblogic.jdbc.extensions.WLConnection CAN BE type casted
              // to OracleConnection
         return (OracleConnection) ((WLConnection) connection).getVendorConnection();
         catch(Exception sqlException )
              sqlException.printStackTrace ();
              return null;
         /* Implement all other methods by delegation to connection object */      
    public Connection _getPC()
    return connection._getPC();
    public void archive(int i, int j, String s)
    throws SQLException
    connection.archive(i, j, s);
    public void assertComplete()
    throws SQLException
    connection.assertComplete();
    public void clearWarnings()
    throws SQLException
    connection.clearWarnings();
    public void close()
    throws SQLException
    connection.close();
    public void commit()
    throws SQLException
    connection.commit();
    public Statement createStatement()
    throws SQLException
    return connection.createStatement();
    public Statement createStatement(int i, int j)
    throws SQLException
    return connection.createStatement(i, j);
    public boolean getAutoClose()
    throws SQLException
    return connection.getAutoClose();
    public boolean getAutoCommit()
    throws SQLException
    return connection.getAutoCommit();
    public CallableStatement getCallWithKey(String s)
    throws SQLException
    return connection.getCallWithKey(s);
    public String getCatalog()
    throws SQLException
    return connection.getCatalog();
    public boolean getCreateStatementAsRefCursor()
    return connection.getCreateStatementAsRefCursor();
    public int getDefaultExecuteBatch()
    return connection.getDefaultExecuteBatch();
    public int getDefaultRowPrefetch()
    return connection.getDefaultRowPrefetch();
    public Object getDescriptor(String s)
    return connection.getDescriptor(s);
    public boolean getExplicitCachingEnabled()
    throws SQLException
    return connection.getExplicitCachingEnabled();
    public boolean getImplicitCachingEnabled()
    throws SQLException
    return connection.getImplicitCachingEnabled();
    public boolean getIncludeSynonyms()
    return connection.getIncludeSynonyms();
    public Object getJavaObject(String s)
    throws SQLException
    return connection.getJavaObject(s);
    public DatabaseMetaData getMetaData()
    throws SQLException
    return connection.getMetaData();
    public Properties getProperties()
    return connection.getProperties();
    public boolean getRemarksReporting()
    return connection.getRemarksReporting();
    public boolean getRestrictGetTables()
    return connection.getRestrictGetTables();
    public String getSQLType(Object obj)
    throws SQLException
    return connection.getSQLType(obj);
    public String getSessionTimeZone()
    return connection.getSessionTimeZone();
    public int getStatementCacheSize()
    throws SQLException
    return connection.getStatementCacheSize();
    public PreparedStatement getStatementWithKey(String s)
    throws SQLException
    return connection.getStatementWithKey(s);
    public int getStmtCacheSize()
    return connection.getStmtCacheSize();
    public short getStructAttrCsId()
    throws SQLException
    return connection.getStructAttrCsId();
    public boolean getSynchronousMode()
    return connection.getSynchronousMode();
    public int getTransactionIsolation()
    throws SQLException
    return connection.getTransactionIsolation();
    public Map getTypeMap()
    throws SQLException
    return connection.getTypeMap();
    public String getUserName()
    throws SQLException
    return connection.getUserName();
    public boolean getUsingXAFlag()
    return connection.getUsingXAFlag();
    public SQLWarning getWarnings()
    throws SQLException
    return connection.getWarnings();
    public boolean getXAErrorFlag()
    return connection.getXAErrorFlag();
    public boolean isClosed()
    throws SQLException
    return connection.isClosed();
    public boolean isLogicalConnection()
    return connection.isLogicalConnection();
    public boolean isReadOnly()
    throws SQLException
    return connection.isReadOnly();
    public String nativeSQL(String s)
    throws SQLException
    return connection.nativeSQL(s);
    public Object openJoltConnection(String s, short word0, short word1)
    return connection.openJoltConnection(s, word0, word1);
    public void oracleReleaseSavepoint(OracleSavepoint oraclesavepoint)
    throws SQLException
    connection.oracleReleaseSavepoint(oraclesavepoint);
    public void oracleRollback(OracleSavepoint oraclesavepoint)
    throws SQLException
    connection.oracleRollback(oraclesavepoint);
    public OracleSavepoint oracleSetSavepoint()
    throws SQLException
    return connection.oracleSetSavepoint();
    public OracleSavepoint oracleSetSavepoint(String s)
    throws SQLException
    return connection.oracleSetSavepoint(s);
    public int pingDatabase(int i)
    throws SQLException
    return connection.pingDatabase(i);
    public CallableStatement prepareCall(String s)
    throws SQLException
    return connection.prepareCall(s);
    public CallableStatement prepareCall(String s, int i, int j)
    throws SQLException
    return connection.prepareCall(s, i, j);
    public CallableStatement prepareCallWithKey(String s)
    throws SQLException
    return connection.prepareCallWithKey(s);
    public PreparedStatement prepareStatement(String s)
    throws SQLException
    return connection.prepareStatement(s);
    public PreparedStatement prepareStatement(String s, int i, int j)
    throws SQLException
    return connection.prepareStatement(s, i, j);
    public PreparedStatement prepareStatementWithKey(String s)
    throws SQLException
    return connection.prepareStatementWithKey(s);
    public void purgeExplicitCache()
    throws SQLException
    connection.purgeExplicitCache();
    public void purgeImplicitCache()
    throws SQLException
    connection.purgeImplicitCache();
    public void putDescriptor(String s, Object obj)
    throws SQLException
    connection.putDescriptor(s, obj);
    public void registerApiDescription(String s, short word0, short word1, String
    s1)
    connection.registerApiDescription(s, word0, word1, s1);
    public void registerSQLType(String s, Class class1)
    throws SQLException
    connection.registerSQLType(s, class1);
    public void registerSQLType(String s, String s1)
    throws SQLException
    connection.registerSQLType(s, s1);
    public void registerTAFCallback(OracleOCIFailover oracleocifailover, Object
    obj)
    throws SQLException
    connection.registerTAFCallback(oracleocifailover, obj);
    public void rollback()
    throws SQLException
    connection.rollback();
    public void setAutoClose(boolean flag)
    throws SQLException
    connection.setAutoClose(flag);
    public void setAutoCommit(boolean flag)
    throws SQLException
    connection.setAutoCommit(flag);
    public void setCatalog(String s)
    throws SQLException
    connection.setCatalog(s);
    public void setCreateStatementAsRefCursor(boolean flag)
    connection.setCreateStatementAsRefCursor(flag);
    public void setDefaultExecuteBatch(int i)
    throws SQLException
    connection.setDefaultExecuteBatch(i);
    public void setDefaultRowPrefetch(int i)
    throws SQLException
    connection.setDefaultRowPrefetch(i);
    public void setExplicitCachingEnabled(boolean flag)
    throws SQLException
    connection.setExplicitCachingEnabled(flag);
    public void setImplicitCachingEnabled(boolean flag)
    throws SQLException
    connection.setImplicitCachingEnabled(flag);
    public void setIncludeSynonyms(boolean flag)
    connection.setIncludeSynonyms(flag);
    public void setReadOnly(boolean flag)
    throws SQLException
    connection.setReadOnly(flag);
    public void setRemarksReporting(boolean flag)
    connection.setRemarksReporting(flag);
    public void setRestrictGetTables(boolean flag)
    connection.setRestrictGetTables(flag);
    public void setSessionTimeZone(String s)
    throws SQLException
    connection.setSessionTimeZone(s);
    public void setStatementCacheSize(int i)
    throws SQLException
    connection.setStatementCacheSize(i);
    public void setStmtCacheSize(int i)
    throws SQLException
    connection.setStmtCacheSize(i);
    public void setStmtCacheSize(int i, boolean flag)
    throws SQLException
    connection.setStmtCacheSize(i, flag);
    public void setSynchronousMode(boolean flag)
    connection.setSynchronousMode(flag);
    public void setTransactionIsolation(int i)
    throws SQLException
    connection.setTransactionIsolation(i);
    public void setTypeMap(Map map)
    throws SQLException
    connection.setTypeMap(map);
    public void setUsingXAFlag(boolean flag)
    connection.setUsingXAFlag(flag);
    public void setWrapper(OracleConnection oracleconnection)
    connection.setWrapper(oracleconnection);
    public void setXAErrorFlag(boolean flag)
    connection.setXAErrorFlag(flag);
    public void shutdown(int i)
    throws SQLException
    connection.shutdown(i);
    public void startup(String s, int i)
    throws SQLException
    connection.startup(s, i);
    Util class to get Wrapped Connections from
    datasource
    package ejbTesting;
    // j2ee imports
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    // sql imports
    import java.sql.Connection;
    // imports from Oracle Driver Classes
    import oracle.jdbc.OracleConnection;
    * Wrapper class for the DataSource Connection from Weblogic pool
    public class DataSourceConnectionWrapper
         // datasource variable
         private static transient DataSource datasource = null;
         private static String dbName = "jdbc/workbench";
    * Method that returns the database connection
         public static Connection getConnection()
              try
                   // initialsing the datasource object
                   initialiseDataSource ();
                   // Getting a connection from the datasource
                   Connection con = datasource.getConnection( );
                   // wrapping it custom wrapper class and
                   // returning the connection object
                   return new WeblogicConnectionWrapper((OracleConnection)con);
              catch(Exception exception )
                   exception.printStackTrace();
                   return null;
         private static void initialiseDataSource( ) throws Exception
    if ( datasource == null )
    try
    InitialContext ic = new InitialContext( );
    datasource = (DataSource) ic.lookup( dbName );
    catch (Exception ne )
    throw new Exception( "NamingException while looking up DataSource with
    JNDI name" +
    dbName + ": \n" + ne.getMessage( ) );
    Exception Stack Trace
    The line 46 in DataSourceConnectionWrapper
    corresponds to
    return new WeblogicConnectionWrapper((OracleConnection)con);
    Which I feel is logical as the connection which we get from Weblogic
    datasource cannot be type casted to OracleConnection
    java.lang.ClassCastException: weblogic.jdbc.pool.Connection
    at ejbTesting.DataSourceConnectionWrapper.getConnection(DataSourceConnectionWrapper.java:46)

  • Using foreign JMS providers with wls

    does anybody have a clou, where i can find that article, i think it's
              by steve felts on using foreign JMS providers with wls? i think the
              link on dev2dev is broken?
              

    The new article is called "Using Foreign JMS Providers with WLS" and it's
              here:
              http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
              greg
              "leopld goess" <[email protected]> wrote in message
              news:[email protected]..
              > does anybody have a clou, where i can find that article, i think it's
              > by steve felts on using foreign JMS providers with wls? i think the
              > link on dev2dev is broken?
              

  • How to use Muticast testing utilities with WLS ??

    Hello,
              Does anyone here know how we can use the muticast testing utilities that are
              avilable with WLS ??
              I have run it, but I don't understand how to use it...
              What will it show ??
              WIll it show that there is a conflict in the muticast address ??
              Will it show something else ??
              Whenever I run it.... it just writes a bunch of messages ot the screen.
              What does that mean ??
              Is there any documentation available on this utlity ??
              Please help.
              -Anu
              

    see below
              If your multicast is properly setup each server reports that a new
              neighbor is found and it's able to accept messages from the other server.
              java utils.MulticastTest -N S1 -A 224.0.0.1
              ***** WARNING ***** WARNING ***** WARNING *****
              Do NOT use the same multicast address as a running WLS cluster.
              Starting test. Hit any key to abort
              Using multicast address 224.0.0.1:7001
              Will send messages under the name S1 every 2 seconds
              Will print warning every 600 seconds if no messages are received
              New Neighbor s2 found on message number 2
              Duplicate message from s2: 2
              Duplicate message from s2: 2
              Duplicate message from s2: 2
              Duplicate message from s2: 2
              Duplicate message from S1: 1
              Duplicate message from S1: 1
              Duplicate message from S1: 1
              Duplicate message from S1: 1
              I (S1) sent message num 1
              Received message 3 from s2
              Duplicate message from s2: 3
              Duplicate message from s2: 3
              Duplicate message from s2: 3
              Duplicate message from s2: 3
              Received message 2 from S1
              java utils.MulticastTest -N S2 -A 224.0.0.1
              ***** WARNING ***** WARNING ***** WARNING *****
              Do NOT use the same multicast address as a running WLS cluster.
              Starting test. Hit any key to abort
              Using multicast address 224.0.0.1:7001
              Will send messages under the name s2 every 2 seconds
              Will print warning every 600 seconds if no messages are received
              Duplicate message from s2: 1
              Duplicate message from s2: 1
              Duplicate message from s2: 1
              Duplicate message from s2: 1
              I (s2) sent message num 1
              Received message 2 from s2
              Duplicate message from s2: 2
              Duplicate message from s2: 2
              Duplicate message from s2: 2
              Duplicate message from s2: 2
              I (s2) sent message num 2
              New Neighbor S1 found on message number 1
              Duplicate message from S1: 1
              Duplicate message from S1: 1
              Duplicate message from S1: 1
              Duplicate message from S1: 1
              Received message 3 from s2
              Duplicate message from s2: 3
              Duplicate message from s2: 3
              Duplicate message from s2: 3
              Duplicate message from s2: 3
              I (s2) sent message num 3
              Received message 2 from S1
              Duplicate message from S1: 2
              Duplicate message from S1: 2
              Duplicate message from S1: 2
              Duplicate message from S1: 2
              Received message 4 from s2
              Duplicate message from s2: 4
              Duplicate message from s2: 4
              Duplicate message from s2: 4
              Duplicate message from s2: 4
              I (s2) sent message num 4
              Anu Kulatunga wrote:
              > Hello,
              >
              > Does anyone here know how we can use the muticast testing utilities that are
              > avilable with WLS ??
              >
              > I have run it, but I don't understand how to use it...
              >
              > What will it show ??
              >
              > WIll it show that there is a conflict in the muticast address ??
              >
              > Will it show something else ??
              >
              > Whenever I run it.... it just writes a bunch of messages ot the screen.
              >
              > What does that mean ??
              >
              > Is there any documentation available on this utlity ??
              >
              > Please help.
              > -Anu
              >
              >
              >
              >
              >
              

  • Using Testexec user interface with test stand

    Hi,
    I want to use the testexec UIR (from cvi) with my Test Stand sequence. My goal is when this operator interface is opened directly, the specified sequence opens automatically.
    Any suggestion!
    Best Regards,

    You can approach this 2 ways:
    1- Hard code the name and path of the sequence file into the CVI code and rebuild testexec.exe.
    2- Associate .seq files with testexec.exe such that when someone clicks on an .seq file it opens in the UI.  Then place a shortcut to your sequence file on the desktop and have users start it by clicking on that.
    I recommend 2.
    As a side note: By default a UI will open the last sequence file that was opened.
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Problem using Java Mail API with WLS 7.0

    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
         public static void main(String args[])
              try
                   //Context ic = getInitialContext();
                   InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
                   Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
                   Properties props = new Properties();
                   props.put("mail.transport.protocol", "smtp");
                   props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
                   props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
                   Session session2 = session.getInstance(props);
                   Message msg = new MimeMessage(session2);
                   msg.setFrom();
                   msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
                   msg.setSubject("Test Message");
                   msg.setSentDate(new Date());
                   MimeBodyPart mbp = new MimeBodyPart();
                   mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
                   Multipart mp = new MimeMultipart();
                   mp.addBodyPart(mbp);
                   msg.setContent(mp);
                   Transport.send(msg);
              catch(Exception e)
                   e.printStackTrace();
         }//end of main
    public static Context getInitialContext()
         throws NamingException
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
                   p.put(Context.SECURITY_PRINCIPAL, "weblogic");
                   p.put(Context.SECURITY_CREDENTIALS, "weblogic");
              return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah

    You can use InitialContext ic = new InitialContext() only if you are using a startup class, servlet or a JSP i.e
    server side code.
    If you are using a java client you need to use Context ic = getInitialContext();
    Try this code
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try {
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    h.put(Context.PROVIDER_URL, "t3://localhost:7001");
    Context ic = new InitialContext(h);
    Session session = (Session) ic.lookup("testSession");
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    props.put("mail.from", "[email protected]");
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse("[email protected]",false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    }//end of class
    We have shipped a javamail example in the samples\server\src\examples\javamail folder.
    Jimmy Shah wrote:
    Hi All,
    I am trying to use the Java Mail API provided by WLS 7.0. I have made the
    settings metioned in the WLS 7.0 docs. However when I try to run the program I
    am getting the following error:
    javax.naming.NoInitialContextException: Need to specify class name in environment
    or system property, or as an applet parameter, or in an application resource file:
    java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    46)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    The code that I have written is as follows
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.*;
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    public class MailTo {
    public static void main(String args[])
    try
    //Context ic = getInitialContext();
    InitialContext ic = new InitialContext();
    /* My jndi name is "testSession" */
    Session session = (Session) ic.lookup("testSession"); /* THE PROBLEM IS SHOWN
    IN THIS LINE */
    Properties props = new Properties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", "XX.XX.XX.XX");
    /* For security reasons I have written the ip add in this format */
    props.put("mail.from", "[email protected]"); /* for security reasons i have
    changed the mail address */
    Session session2 = session.getInstance(props);
    Message msg = new MimeMessage(session2);
    msg.setFrom();
    msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]",
    false));
    msg.setSubject("Test Message");
    msg.setSentDate(new Date());
    MimeBodyPart mbp = new MimeBodyPart();
    mbp.setText("This is a mail sent to you using JAVA Mail API and Weblogic Server");
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp);
    msg.setContent(mp);
    Transport.send(msg);
    catch(Exception e)
    e.printStackTrace();
    }//end of main
    public static Context getInitialContext()
    throws NamingException
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://localhost:7501/testWebApp");
    p.put(Context.SECURITY_PRINCIPAL, "weblogic");
    p.put(Context.SECURITY_CREDENTIALS, "weblogic");
    return new InitialContext(p);
    }//end of class
    Can anyone please tell me what is the problem. I thought that we cannot directly
    do
    InitialContext ic = new InitialContext();
    So I had written a method getInitialContext() as shown in the above piece of code,
    but that too did not work.
    Eagerly awaiting a response.
    Jimmy Shah--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • R12 using domain user account

    Hi All,
    Our architecture is R12.1.3 Apps and 11.2.0.3 database.we are trying to clone from PROD to test.
    Copyright (c) 1991, 2011, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ppclone15db.ppgpl.co.tt)
    (PORT=1524)))
    The command completed successfully
    ECHO is off.
    Listener DB15 has already been started.
    ECHO is off.
    addlnctl.cmd exiting with status 0
    [SC] OpenService FAILED 1060:
    The specified service does not exist as an installed service.
    oracleserviceTest is created with path executable /orant/bin oracle.exe instead of ORACLE_HOME/bin oracle.exe.
    we are doing rapidclone using Domain user account (with local administrator privilege)
    As per metalink note id 406982.1 Note: On Microsoft Windows, Rapid Clone is not currently certified for use from Domain User Accounts
    kindly provide us suitable solutions to overcome rapid clone issue in windows machine.
    Regards,
    Dinesh

    Hi,
    As a workaround, always keep a copy of your configuration files like (XML files, .ora files etc) from the TEST environment before removing all the files for cloning.
    Original files can be copied over from backup copies and can be reused after running the autoconfig.
    You can take a backup of your existing Oracle services running on windows for TEST environment before removing it for Clone.
    To view the oracle services running and their location on windows OS you can view the services by:
    go to Run --> services.msc to get to the services page.
    Regards
    Neeraj Sharma
    Edited by: NeSharma on Jul 9, 2012 2:13 AM

  • Java ftp server which can use LDAP, how to integrate with WLS' implementation of LDAP?

    Howdy.
    I'm setting up a java ftp server
    (http://www.mycgiserver.com/~ranab/ftp/index.html) which is capable of using
    LDAP for it's user security. I would like to integrate this ftp server with
    wls' implementation of LDAP so I only have to admin one user list.
    Does wls put it's user list in the LDAP or in it's own proprietary setup? I
    tried playing around with it, but the users don't seem to appear in the JNDI
    tree. Is this where the LDAP stuff is located? I thought it was in there?
    If it's in it's own setup, is there a way to propagate the users to LDAP?
    If these look like newbie Q&A, I guess they kind of are, I'm new to LDAP.
    Thanks for any input you might have.

    Peter,
    If you are talking about using the embedded LDAP server in WLS 7.0 for this purpose
    I think you are going done the wrong path.
    Look at the following URL on how to use an external LDAP server for your custom
    application
    http://e-docs.bea.com/wls/docs70/secmanage/realm.html#1172008
    Chuck Nelson
    DRE
    BEA Technical Support

  • What tools are being used with WLS 5.1?

    I have been experimenting with WLS 5.1 and it is clear that there are many
    steps in developing, testing, and deploying EJBs. What tools are being
    used? How do IBM's Visual Age, JBuilder 4, and Visual Cafe EE stack up?
    Are there any tools for developing and debugging JSPs?
    Thanks,
    Mike

    Hi folks,
    about the "IBM VisualAge 3.02 (Integration Kit)" that Nirav mentions below...
    Does this integration kit work with Visual Age 3.5? If not, do you have any tool recommendations for VA3.5 users who are developing apps for WebLogic5.1?
    Thanks,
    Janet
    Nirav Chanchani <[email protected]> wrote:
    Mike,
    The level of integration between WLS and the tools is as follows (with
    VisualCafe being the most integrated) --
    1. VisualCafe Enterprise (or the WebGain Studio suite)
    http://www.webgain.com/Products/index.htm
    2. JBuilder 4 http://www.inprise.com/jbuilder/
    3. IBM VisualAge 3.02 (Integration Kit beta up on BEA website)
    http://commerce.beasys.com/downloads/weblogic_server.jsp#wlstools
    All the integration's support development, local debugging, and local
    deployment, but VisualCafe has wizards and like which generate code for the
    J2EE specs that WLS supports.
    I have read that JBuilder 4 supports JSP debugging but have not tried it yet.
    Nirav.
    Mike DiChiappari wrote:
    I have been experimenting with WLS 5.1 and it is clear that there are many
    steps in developing, testing, and deploying EJBs. What tools are being
    used? How do IBM's Visual Age, JBuilder 4, and Visual Cafe EE stack up?
    Are there any tools for developing and debugging JSPs?
    Thanks,
    Mike--
    Nirav Chanchani
    BEA Systems, Inc.

  • Always used 1 main account.  Started using individual user accounts. So how do I use software or applications with a lot of data like Quicken under my own user account?

    I recently upgraded our family's mac to OS X.  I thought this was the perfect time to create and use "user accounts".  We had always used 1 main account.  So how do I use software or applications with a lot of data like Quicken under my own user account?  I wanted to be able to manage my own itunes library, iphone apps, messages.  But I still really need to use the Stuff I have in Quicken essentials.  I don't want to have to restart all my work done in Quicken already.

    I haven't used Quicken in a while, but most applications store your files in your Documents folder. Is that where your Quicken data file is? What you do next depends on how many family members need to get at that data.
    If multiple family members need to use the Quicken data file, try moving it to the Documents folder in the Shared account. That is an account that all accounts can see. It's at the same level as the other accounts. In other words, Shared is one level up from your Home account, or Hard Drive/Users/Shared.
    If you're the only one allowed to see that Quicken data, move the Quicken data file from the old main account to your account, and don't leave a copy behind. You can use the Shared folder as a way station for the transfer since you won't be able to see both accounts' Documents folders at the same time (because you're not allowed to peek into other people's accounts). Or you can use another disk or server for the transfer, as long as you can get to it when logged into either account.

  • How to use your own database with your users to authenticate in a Web app?

    Hello, everybody!
    I'm starting to write my first web application and I'm going to use JSF, JPA and EJB3 in this application. One of the first things that I have to do on it is the authentication part where I'll have a page with a user name and a password for the user to login. So, as I'm new to all this in Java (I've already implemented this on .NET in the past), I was studying the Java EE 5 Tutorial, especifically the section "Example: Using Form-Based Authentication with a JSP Page". But I saw that the users that the sample application uses come from the file realm on the Application Server. The users are created there and assigned a name, a password and a group. After the users are in the Application Server we can simply uses forms authentication declaratively in the deployment descriptor (web.xml).
    But the problem is that this doesn't work to me as I already have my own database with my users, so I want to use it instead of having to create the users on the Application Server.
    So, I'm asking you how to do that. Of course I'm not expecting that you place the code here to me as I know that such a thing could be complicated. Instead, I'm asking if you know about some tutorial, article, book or something that teaches how to do what I want. But I would like to see theses examples using JSF and/or EJB3 because these are the technologies that I'm using to develop. It's a pity that the Java EE 5 Tutorial doesn't have an example using a custom database as I know that this situation is very common in the majority of web sites.
    Thank you very much.
    Marcos

    From memory, it goes like this... You just create a
    raw jdbc connection on your user database using a
    special "login" DB user account, which has
    permissions only to an "authenticate" stored query,
    which accepts two arguments: username & password, and
    returns a boolean 0 or 1 rows found.When I implemented this in .NET's ASP.NET I had the same solution. I had an special user created in the database that I used to log in. When the real user entered his username and password I was already logged in and I had just to check his username and password agains the right table in my database.
    But that was only possible bacause when I connected to the database using my hidden user, I used the rights APIs in ASP.NET that coordinate the authentication process. This means that before login in, no one could access any resources (pages, atc...). So what I'm saying is that I can't manager this manually in Java. Java has to have some API or whatever to allow me to control the login process programmatically, while letting the Application Server control the access to the resources.

  • I have a new ipod and when I sign in to Words with Friends it says that user name is already in use. How can I continue using the same user name with a different ipod?

    I have a new ipod and added all my apps to it. When I sign in to Words with Friends it says that "user name is already in use" because it is linked to my old ipod. How can I use the same user name with my new ipod?

    Was the iPod setup via iTunes on this computer?
    Setup via wifi?
    Was the iPod previous synced to another iTunes library/computer?
    Have you successfully synced from this iTunes library/computer before?
    Do the songs play in iTunes?           
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod        
    Try syncing using the manual method                 

  • How to use CMS Users with SAP BOPC NW 7.5

    Hello,
    I have problems importing and using CMS Users with BO PC 7.5 NW.
    I am trying two types of CMS-users
    1. CMS Enterprise Users created in CMS and using "Enterprise" authentication
    2. SAP BW Users imported into CMS using their SAP authentication "secSAPR3")
    but both don't work:
    In the BOPC Admin Client, I can succesfully select Security->Users->"Add new Users". Both CMS "Enterprise Users" and CMS Users that use SAP authentication are displayed in the "Everyone" Group.
    The CMS Enterprise Users are displayed as <username>, e.g. "Miller".
    The CMS users with sap authentication are displayed as <SAPSystem><Client>/<SAPusername>, e.g. "KBE100/Smith".
    Now If I try to import a user...
    1. CMS Enterprise Users
    If can successfully import CMS Enterprise Users and add them to the ADMIN Team, e.g. "Miller".
    The problem is they can't be used to log in to the Admin Client and Excel Client:
    E.g. I enterUser-ID "Miller" and his CMS-Enterprise-password under password after starting Excel Client, an error message shows up: "The UserID, Password or Domain cannot be authenticated. Go back and make sure you entered valid credentials" ... (same error message as if the user wouldn't exist/wrong pw.).
    Seems the user wasn't added as BO PC user. Or do I need to use any prefix before the "user ID" for CMS Enterprise users in the User_ID field instead of just "Miller"?! 
    2. CMS Users which use SAP-authentication (users imported into CMS from BW and use SAP-authentication)
    In the BO PC Admin Client, I can't import them: I go through "1. User Setup" select "KBE~100/Smith", "2. User Detail", "3. Assignments", but if I am in "4. Finish" and click on "Apply", the following error shows up:
    "Failed to create directory \root\Webfolders\<AppSetName>\<Appname>" for "KBE~100/Smith".
    My guess is that the operating system doesn't like the "/" in the Username - but I guess this can't be changed  bc. these Users from CMS and are already displayed with the "/" between SAPSystemID~ClientNummer and username in the User-list in BOPC Admin Client!
    side remark: if I create a SAP CMS Enterprise user which contains a "/" in the username (on pupose ), I am getting the same error message.
    Any help, explanations and workarounds are greatly appreciated - Any solution will be awarded with maximum points!
    Best Regards and thanks a lot for your help!

    Hi Florian,
    The problem seems indeed the file system on the bw not being able to handle "/". The automatic user import from the bw role into the CMC does not give you an option to replace the "/" character with anything else.
    This should solve it:
    - Go to the CMC double click the user. Delete the server part "KBE100/" and click save. Make sure the default system is set to "KBE100". The user should now be able to login from BPC with the user Smith.
    Good luck,
    Martin

  • I am still using my Apple G4 1.25 Ghz MDD running Leopard 10.5.8 with iTunes 10.6.3 installed. Can I use an Phone 4s with iOS 5 with this set up? I have read the iPhone iOS 5 user guide and it appears that I can but is anybody actually doing it ?

    Hello to all my readers.I am still using my Apple G4 1.25 Ghz MDD running Leopard 10.5.8 with iTunes 10.6.3 installed. Can I use an Phone 4s with iOS 5 with this set up? I have read the iPhone iOS 5 user guide and it appears that I can but is anybody actually doing it ? My current phone is a £10 Nokia and I've neither wish nor cash to spend more than a grand upgrading to an intel based machine (at the moment) ! Regards to you all.

    If you can find an iPhone running iOS5 and those are the specs for iOS5, there is no reason it should not work.
    If you want a more current version of iOS or a more current device, a Windows computer is always an option at significantly less cost. 
    Granted, there is no requirement to have a computer to use an iPhone.

  • So I just bought a used MacBook from Amazon with OSX 10.5.8.  I am trying to install new software and operating system, but I don't have the passwords to the Users set up in the computer.  What do I do?

    So I just bought a used MacBook from Amazon with OSX 10.5.8.  I am trying to install new software and operating system, but I don't have the passwords to the Users set up in the computer.  What do I do?

    Put your install DVD into the optical drive (CD/DVD drive) and reboot. Be sure to either use the disc that came with your Mac, or, if you installed a later Mac OS X version from disc, use the newer disc. As soon as you hear the boot chime, hold down the "c" key on your keyboard (or the Option Key until the Install Disk shows up) until the apple shows up. That will force your MacBook to boot from the install DVD in the optical drive.
    When it does start up, you'll see a panel asking you to choose your language. Choose your language and press the Return key on your keyboard once. It will then present you with an Installation window. Completely ignore this window and click on Utilities in the top menu and scroll down to Reset Password. After resetting the password use Startup Disk from the same menu to choose your hard drive for startup and restart.

Maybe you are looking for