InitialContext Bug in WebLogic5.1 ?

I have a SessionBean Method :
public void contextTest() throws RemoteException {
try {
System.out.println("Principal 1: " + ctx.getCallerPrincipal());
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");
h.put(Context.SECURITY_PRINCIPAL, "toto");
h.put(Context.SECURITY_CREDENTIALS, "test");
Context new_ctx = new InitialContext(h);
System.out.println("Principal 2: " + ctx.getCallerPrincipal());
} catch (Exception e) {e.printStackTrace(); }
When principal "titi" invokes this Method it produces the following output:
Principal 1: titi
Principal 2: toto
As You can see the Method just replaced the Caller Context's principal stored in the ctx field without even touching it. Since
my Servlets run on the same JVM and use PassByReference calling this Method twice results in :
Principal 1: titi
Principal 2: toto
Principal 1: toto
Principal 2: toto
I think this is a Bug because it makes it quiet difficult to open two Context's at the same time.
I would like to read some opinions.

the difference here is Thread-based security vs. Object-based security. WLS opts for the Thread-based model. this model was also
backed up by the original revisions of the JAAS spec. it's just something to take into consideration when designing applications.
.paul
Marcel Stremming wrote:
I have a SessionBean Method :
public void contextTest() throws RemoteException {
try {
System.out.println("Principal 1: " + ctx.getCallerPrincipal());
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");
h.put(Context.SECURITY_PRINCIPAL, "toto");
h.put(Context.SECURITY_CREDENTIALS, "test");
Context new_ctx = new InitialContext(h);
System.out.println("Principal 2: " + ctx.getCallerPrincipal());
} catch (Exception e) {e.printStackTrace(); }
When principal "titi" invokes this Method it produces the following output:
Principal 1: titi
Principal 2: toto
As You can see the Method just replaced the Caller Context's principal stored in the ctx field without even touching it. Since
my Servlets run on the same JVM and use PassByReference calling this Method twice results in :
Principal 1: titi
Principal 2: toto
Principal 1: toto
Principal 2: toto
I think this is a Bug because it makes it quiet difficult to open two Context's at the same time.
I would like to read some opinions.

Similar Messages

  • Big jsp Bug in Weblogic! UnNoticed by weblogic!

              <%@ page language="java" contentType="text/html" %> <%! public void jspInit() { System.out.println("Hello"); } %> <% out.println("jsp executed"); %>
              The above code displays "Hello" on the command line or Dos and "jsp executed" on the browser!
              When this jsp is loaded first time it executes correctly. when it is again loaded then jsp init method is not executed. This is also fine.
              But the problem is when I restart my weblogic server and clear the browser cache and then load the jsp file then the init method is called TWO times! "Hello" is displayed two times!
              why this is so? Is there any bug in weblogic5.1? Or am I doing something wrong? please tell
              

              You hit the JSP and the .class file gets loaded into memory and jspInit() executes. Fine.
              Once loaded into memory, the next thing the JSP does is check if it 'isStale()' -
              this compares the date-stamp that was on the .jsp file when the jsp was compiled
              with the date-stamp on the .jsp file on disk. This is in the code of the JSP itself, it
              does not compare the date of the .class file with the date of the .jsp file - so it was
              necessary to load the JSP in memory (an call jspInit()) simply to check the if it was
              up-to-date. In your case, it is not up-to-date. The JSP is compiled, loaded into
              memory and jspInit() executes - again.
              Mike Reiche
              Robert Patrick <[email protected]> wrote:
              >Hi,
              >
              >Please realize that this is NOT an official BEA support forum. All BEA personnel that monitor this newsgroup and answer questions do it on their own time because we (yes, I work for
              >BEA) want to help people be successful with our products. If you want an official response from BEA to your problem, then I suggest that you send mail to [email protected], call our toll
              >free support number (888)232-7878 and/or talk with your BEA Account Representative.
              >
              >As for your problem, I am not sure what is happening but this may be a simple matter of not understanding how JSP reloading works. I am more than willing to help you but you need to
              >provide me with a more detailed description of exactly what it is that you are doing, what service pack level are you using, etc.
              >
              >Thanks,
              >Robert
              >
              >gopal wrote:
              >
              >> <%@ page language="java" contentType="text/html" %> <%! public void jspInit() { System.out.println("Hello"); } %> <% out.println("jsp executed"); %>
              >>
              >> The above code displays "Hello" on the command line or Dos and "jsp executed" on the browser!
              >>
              >> When this jsp is loaded first time it executes correctly. when it is again loaded then jsp init method is not executed. This is also fine.
              >>
              >> But the problem is when I restart my weblogic server and clear the browser cache and then load the jsp file then the init method is called TWO times! "Hello" is displayed two times!
              >>
              >> why this is so? Is there any bug in weblogic5.1? Or am I doing something wrong? please tell
              >
              

  • BUG: When substitution is used

    Hi,
    I get an error when I turn on substitution under certain conditions. I currently have 2 ViewController projects which both use a root application module, The root app module has 2 app modules nested inside it. These two applications are linked together using deep linking. I have a view in one of the applications that is substituted for another view.
    When I start up the app it starts up fine. When I deep link into the other app an error is thrown becuase it tries to setup the substitution of the view object again. The problem is happening at line 1167 in oracle.jbo.mom.DefinitionManager
    mContext.bind(oldName, subs.get(oldName));
    I am using JDev 10.1.3.2.0.4066
    Bar
    FINE: [4657] javax.naming.NameAlreadyBoundException: com.claimvantage.adf.main.view.ClaimView already bound.
         at oracle.jbo.mom.xml.XMLContextImpl.bind(XMLContextImpl.java:85)
         at javax.naming.InitialContext.bind(InitialContext.java:359)
         at oracle.jbo.mom.DefinitionManager.loadSubstitutes(DefinitionManager.java:1167)
         at oracle.jbo.mom.DefinitionManager.loadProjectDefinition(DefinitionManager.java:785)
         at oracle.jbo.mom.DefinitionManager.loadProjectDefinition(DefinitionManager.java:883)
         at oracle.jbo.server.SessionImpl.init(SessionImpl.java:143)
         at oracle.jbo.server.ApplicationModuleHomeImpl.createSession(ApplicationModuleHomeImpl.java:110)
         at oracle.jbo.server.ApplicationModuleHomeImpl.<init>(ApplicationModuleHomeImpl.java:47)
         at oracle.jbo.server.InitialContextImpl.createJboHome(InitialContextImpl.java:51)
         at oracle.jbo.common.JboInitialContext.lookup(JboInitialContext.java:77)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:136)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:80)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.instantiateResource(ApplicationPoolImpl.java:2468)
         at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:536)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2094)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1961)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453)
         at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:233)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:419)
         at oracle.adf.model.bc4j.DCJboDataControl.rebuildApplicationModule(DCJboDataControl.java:1536)
         at oracle.adf.model.bc4j.DCJboDataControl.beginRequest(DCJboDataControl.java:1396)
         at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:99)
         at oracle.adf.model.BindingContext.get(BindingContext.java:457)
         at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:280)
         at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:248)
         at oracle.adf.model.binding.DCUtil.findContextObject(DCUtil.java:383)
         at oracle.adf.model.binding.DCIteratorBinding.<init>(DCIteratorBinding.java:127)
         at oracle.jbo.uicli.binding.JUIteratorBinding.<init>(JUIteratorBinding.java:60)
         at oracle.jbo.uicli.binding.JUIteratorDef.createIterBinding(JUIteratorDef.java:87)
         at oracle.jbo.uicli.binding.JUIteratorDef.createIterBinding(JUIteratorDef.java:51)
         at oracle.adf.model.binding.DCIteratorBindingDef.createExecutableBinding(DCIteratorBindingDef.java:277)
         at oracle.adf.model.binding.DCBindingContainerDef.createExecutables(DCBindingContainerDef.java:296)
         at oracle.adf.model.binding.DCBindingContainerDef.createBindingContainer(DCBindingContainerDef.java:425)
         at oracle.adf.model.binding.DCBindingContainerReference.createBindingContainer(DCBindingContainerReference.java:54)
         at oracle.adf.model.binding.DCBindingContainerReference.getBindingContainer(DCBindingContainerReference.java:44)
         at oracle.adf.model.BindingContext.get(BindingContext.java:483)
         at oracle.adf.model.BindingContext.findBindingContainer(BindingContext.java:313)
         at oracle.adf.model.BindingContext.findBindingContainerByPath(BindingContext.java:633)
         at oracle.adf.model.BindingRequestHandler.isPageViewable(BindingRequestHandler.java:265)
         at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:169)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:161)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
         at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:620)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

    Hi,
    if you think this is a bug then this is what we have customer support for: to track down the issue, isolate it and follow up with a fix
    Frank

  • ACL problem in 6 and 5.1 sp9? Bug?!

    Hi all gurus:
    I got this problem for several days, and still cannot solve it. Can
    anyone help me?
    My design is to put all my beans and connection pool under one "kbf"
    acl. And "guest" servlet/jsp accesses these beans by using this "kbf"
    account. And it works in 5.1 sp8.
    Then i tried to use sp9. The very first time when jsp is compiling
    by WLS, all the jsps work correctly! After that, immediately click the
    link again, it throws jndi exception. Saying "guest" no permission to
    access "kbf" jndi. But my "guest" actually is a servlet/jsp running
    inside the server.
    So then we tried to use 6 sp2, to see whether we can solve the
    problem. And the funny things come out as follows.
    I just click my URL link in browser, first time everything is fine,
    my data is shown correctly. second time it throws ACL exception ,saying
    guest no right to look up my JDBC pool. Click again, the data comes out
    again. Clieck again throws same exception. It is a "toggle".
    And, for another jsp page/link, (it gets data from two tables),
    first time both two tables data are shown. Click some other link, then
    come back to click this link, only one table data is shown, then click
    this link again, both are shown. It is also a "toggle", slightly
    different.
    Something really funny going on for this ACL!
    Can anyone in BEA tell me more about this ACL issue? Why always
    nobody cares to answer these ACL questions? Both in ejb group and
    security group?
    Or simply nobody is using ACL in their project?
    Or i missed out something important? or i am abusing ACL?
    Or is it a bug?
    Since we are going to production very soon, i need the solution
    ASAP. Right now i only have two solutions:
    1. stick to 5.1 sp8.
    2. grant "guest" permission to all my beans, connection pool, which
    means no use for the ACL at all.
    Hope someone at least give me an hint. And sorry for the crossing
    post.
    Thanks.
    minjiang

    Thanks a lot!
    The problem is that i cached the ejb homes and connection pool. So now i use
    your first solution, create context everytime, although the performance may be
    slow down.
    But strange, it works in 5.1 sp6-8.
    Thanks again, Dimitri!
    minjiang
    Dimitri Rakitine wrote:
    The security context is associated with thread so, for example:
    in a servlet, you create InitialContext as "user" and save it.
    Next request which will be "guest" anyway.
    So, if you want authentication, you can either
    - create InitialContext everytime
    - use j2ee security so container will do this automatically:
    http://e-docs.bea.com/wls/docs61/webapp/security.html
    Dimitri
    On Fri, 13 Jul 2001, minjiang wrote:
    Hi Dimitri:
    Sorry to mail you directly.
    I have this question for quite some time. And not receive any
    response for my posting, cross posting.
    Do you have any idea why my deployment works on 5.1 sp8, but not on
    sp9 and 6 sp2?
    I noticed bea changed the weblogic.ejb.interal.StatefulEJBObejct,
    and StatefulEJBCache in sp9, and this is part of why my application
    cannot work. (for one facade session bean looking up other beans in
    another acl)
    Another part is i described in the forward posting, for my "guest"
    jsp/servelt cannot access other acl?
    For my understanding, since my facade bean and jsp/servlet only run
    inside the WLS server, so as long as the correct credential is supplied
    while constructing the jndi context, they should be allowed, right? It
    shoud not be only one credential in one thread, which seems WLS is doing
    now.
    Thanks for help, and any hint or document is appreciated.
    minjiang

  • DataSourceUserManager bug in oracle 9.0.4

    Hi,
    We use jaas configured with com.evermind.sql.DataSourceUserManager as a custom user manager provider on Oracle 9.0.4. It works with a datasource that defined in OracleAs datasource.
    Every thing works fine.
    When we restart the OC4J instance, the com.evermind.sql.DataSourceUserManager gives error that could not initial becuase could not find the datasource which is already there!
    We found it as a bug in AS 9.0.4 are there any patches for this version.
    Regadrs,
    Alireza Fattahi

    Hi,
    We found the pacth p3343332, which fix this bug in metalink! This patch only replaces the DataSourceUserManager which is in %ORACLE_HOME%\j2ee\home\oc4j.jar
    Regards,
    Alireza Fattahi
    The Code is:
    package com.evermind.sql;
    import com.evermind.security.*;
    import com.evermind.util.ObjectUtils;
    import java.io.PrintStream;
    import java.math.BigInteger;
    import java.sql.*;
    import java.util.*;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    // Referenced classes of package com.evermind.sql:
    // DataSourceUser
    public class DataSourceUserManager extends AbstractUserManager
    public DataSourceUserManager()
    dataSource = null;
    dataSourceLocation = null;
    groupMembershipUserField = "username";
    groupMembershipGroupField = "group";
    users = new HashMap();
    stalenessTime = -1L;
    public void init(Properties properties)
    throws InstantiationException
    String staleness = properties.getProperty("staleness");
    String casing = properties.getProperty("casing");
    if(staleness != null)
    try
    stalenessTime = Integer.parseInt(staleness);
    catch(NumberFormatException e)
    throw new InstantiationException("Invalid staleness value: '" + staleness + "', must be a valid integer");
    if(casing == null || casing.equalsIgnoreCase("sensitive"))
    this.casing = 1;
    else
    if(casing.equalsIgnoreCase("toupper"))
    this.casing = 2;
    else
    if(casing.equalsIgnoreCase("tolower"))
    this.casing = 3;
    else
    throw new InstantiationException("Unknown casing type: '" + casing + "'");
    String location = properties.getProperty("dataSource");
    if(location == null)
    throw new InstantiationException("No dataSource specified");
    dataSourceLocation = location;
    tableName = properties.getProperty("table", properties.getProperty("tableName", "users"));
    usernameField = properties.getProperty("usernameField", "username");
    passwordField = properties.getProperty("passwordField", "password");
    certificateIssuerField = properties.getProperty("certificateIssuerField", null);
    certificateSerialField = properties.getProperty("certificateSerialField", null);
    localeField = properties.getProperty("localeField", null);
    groupMembershipTableName = properties.getProperty("groupMembershipTableName");
    groupMembershipUserField = properties.getProperty("groupMembershipUsernameField");
    groupMembershipGroupField = properties.getProperty("groupMembershipGroupField");
    if(properties.getProperty("groupMembershipUsernameFieldName") != null)
    groupMembershipUserField = properties.getProperty("groupMembershipUsernameFieldName");
    if(properties.getProperty("groupMembershipGroupFieldName") != null)
    groupMembershipGroupField = properties.getProperty("groupMembershipGroupFieldName");
    debug = "true".equalsIgnoreCase(properties.getProperty("debug"));
    if(groupMembershipGroupField == null)
    groupMembershipGroupField = "group";
    if(groupMembershipUserField == null)
    groupMembershipUserField = "username";
    String defaultGroupsString = properties.getProperty("defaultGroups");
    if(defaultGroupsString != null)
    for(StringTokenizer tokenizer = new StringTokenizer(defaultGroupsString, ", "); tokenizer.hasMoreElements(); addDefaultGroup(tokenizer.nextToken()));
    public Group getGroup(String name)
    if(parent != null)
    return parent.getGroup(name);
    else
    return null;
    public User createUser(String username, String password)
    throws InstantiationException
    username = toCase(username);
    DataSourceUser user = null;
    try
    Connection connection = getDataSource().getConnection();
    try
    synchronized(this)
    PreparedStatement statement = connection.prepareStatement("SELECT * FROM " + tableName + " WHERE " + usernameField + " = ?");
    statement.setString(1, username);
    ResultSet resultSet = statement.executeQuery();
    if(resultSet.next())
    resultSet.close();
    statement.close();
    throw new InstantiationException("User already exists");
    resultSet.close();
    statement.close();
    statement = connection.prepareStatement("INSERT INTO " + tableName + "(" + usernameField + ", " + passwordField + ") VALUES (?, ?)");
    statement.setString(1, username);
    statement.setString(2, password);
    statement.executeUpdate();
    statement.close();
    user = new DataSourceUser(this, username, password, null, null, null, stalenessTime < 0L ? 0L : System.currentTimeMillis());
    synchronized(users)
    users.put(username, user);
    finally
    try
    connection.close();
    catch(SQLException e) { }
    catch(SQLException e)
    throw new RuntimeException("SQLException: " + e.getMessage());
    return user;
    public User getUser(String username)
    username = toCase(username);
    if(debug)
    System.out.println("DataSourceUserManager.getUser(" + username + ")");
    User user = null;
    synchronized(users)
    user = (DataSourceUser)users.get(username);
    if(user != null && (stalenessTime < 0L || ((DataSourceUser)user).fetchedTime >= System.currentTimeMillis() - stalenessTime))
    return user;
    Connection connection = null;
    try
    connection = getDataSource().getConnection();
    try
    synchronized(this)
    PreparedStatement statement = connection.prepareStatement("SELECT * FROM " + tableName + " WHERE " + usernameField + "= ?");
    statement.setString(1, username);
    ResultSet resultSet = statement.executeQuery();
    if(!resultSet.next())
    resultSet.close();
    statement.close();
    if(parent != null)
    user = parent.getUser(username);
    } else
    String password = resultSet.getString(passwordField);
    String issuer = null;
    BigInteger serial = null;
    Locale locale = null;
    if(certificateIssuerField != null)
    issuer = resultSet.getString(certificateIssuerField);
    if(certificateSerialField != null)
    String serialString = resultSet.getString(certificateSerialField);
    if(serialString != null)
    serial = new BigInteger(serialString);
    if(localeField != null)
    locale = ObjectUtils.toLocale(resultSet.getString(localeField));
    user = new DataSourceUser(this, username, password, issuer, serial, locale, stalenessTime < 0L ? 0L : System.currentTimeMillis());
    resultSet.close();
    statement.close();
    synchronized(users)
    users.put(username, user);
    finally
    try
    connection.close();
    catch(SQLException e) { }
    catch(SQLException e)
    if(debug)
    System.err.println("SQLException in getUser(...):");
    e.printStackTrace();
    throw new RuntimeException("SQLException: " + e.getMessage());
    return user;
    public boolean remove(User user)
    String name = user.getName();
    boolean response = false;
    if(name == null)
    return false;
    synchronized(users)
    users.remove(user);
    Connection connection = null;
    try
    connection = getDataSource().getConnection();
    try
    synchronized(this)
    PreparedStatement statement = connection.prepareStatement("DELETE FROM " + tableName + " WHERE " + usernameField + "= ?");
    statement.setString(1, name);
    response = statement.executeUpdate() != 0;
    statement.close();
    finally
    try
    connection.close();
    catch(SQLException e) { }
    catch(SQLException e)
    throw new RuntimeException("SQLException: " + e.getMessage());
    return response;
    public void updateUserInfo(String username, String issuer, BigInteger serial, Locale locale)
    if((issuer != null || serial != null) && (certificateIssuerField == null || certificateSerialField == null))
    throw new UnsupportedOperationException("certificateIssuerField or certificateSerialField not specified");
    Connection connection = null;
    try
    connection = getDataSource().getConnection();
    synchronized(this)
    StringBuffer buffer = new StringBuffer();
    buffer.append("update " + tableName + " set ");
    boolean first = true;
    if(certificateIssuerField != null)
    first = false;
    buffer.append(certificateIssuerField + " = ?");
    if(certificateSerialField != null)
    if(!first)
    buffer.append(", ");
    first = false;
    buffer.append(certificateSerialField + " = ?");
    if(localeField != null)
    if(!first)
    buffer.append(", ");
    first = false;
    buffer.append(localeField + " = ?");
    buffer.append(" WHERE " + usernameField + " = ?");
    PreparedStatement statement = connection.prepareStatement(buffer.toString());
    int nr = 1;
    if(certificateIssuerField != null)
    if(issuer == null)
    statement.setNull(nr++, 12);
    else
    statement.setString(nr++, issuer);
    if(certificateSerialField != null)
    if(serial == null)
    statement.setNull(nr++, 12);
    else
    statement.setString(nr++, serial.toString());
    if(localeField != null)
    if(locale == null)
    statement.setNull(nr++, 12);
    else
    statement.setString(nr++, ObjectUtils.toString(locale));
    statement.setString(nr++, username);
    statement.executeUpdate();
    statement.close();
    catch(SQLException e)
    throw new RuntimeException("SQLException: " + e.getMessage());
    finally
    try
    if(connection != null)
    connection.close();
    catch(SQLException e) { }
    public User getUser(String issuerDN, BigInteger serial)
    User user;
    user = null;
    if(certificateIssuerField == null || certificateSerialField == null)
    break MISSING_BLOCK_LABEL_505;
    if(users == null)
    break MISSING_BLOCK_LABEL_131;
    Map map = users;
    JVM INSTR monitorenter ;
    Iterator iterator = users.values().iterator();
    goto _L1
    _L3:
    BigInteger userSerial;
    user = (DataSourceUser)iterator.next();
    userSerial = user.getCertificateSerial();
    if(userSerial != null && userSerial.equals(serial) && issuerDN.equals(user.getCertificateIssuerDN()))
    return user;
    _L1:
    if(iterator.hasNext()) goto L3; else goto L2
    _L2:
    map;
    JVM INSTR monitorexit ;
    break MISSING_BLOCK_LABEL_131;
    Exception exception;
    exception;
    throw exception;
    Connection connection = null;
    try
    connection = getDataSource().getConnection();
    synchronized(this)
    PreparedStatement statement = connection.prepareStatement("SELECT * FROM " + tableName + " WHERE " + certificateIssuerField + " = ? AND " + certificateSerialField + " = ?");
    statement.setString(1, issuerDN);
    statement.setString(2, serial.toString());
    ResultSet resultSet = statement.executeQuery();
    if(!resultSet.next())
    resultSet.close();
    statement.close();
    if(parent != null)
    user = parent.getUser(issuerDN, serial);
    } else
    String username = resultSet.getString(usernameField);
    String password = resultSet.getString(passwordField);
    Locale locale = null;
    if(localeField != null)
    locale = ObjectUtils.toLocale(resultSet.getString(localeField));
    user = new DataSourceUser(this, username, password, issuerDN, serial, locale, stalenessTime < 0L ? 0L : System.currentTimeMillis());
    resultSet.close();
    statement.close();
    synchronized(users)
    users.put(username, user);
    catch(SQLException e)
    throw new RuntimeException("SQLException: " + e.getMessage());
    finally
    try
    if(connection != null)
    connection.close();
    catch(SQLException e) { }
    if(user == null && parent != null)
    return parent.getUser(issuerDN, serial);
    else
    return user;
    protected Set getGroups(DataSourceUser user)
    throws SQLException
    if(debug)
    System.out.println("Getting groups for " + user.getName() + "...");
    if(groupMembershipTableName == null)
    if(debug)
    System.out.println("Groups for " + user.getName() + ": <none> (no groupMembershipTableName defined)");
    return null;
    Connection connection = null;
    Set set1;
    try
    connection = getDataSource().getConnection();
    PreparedStatement statement = connection.prepareStatement("select " + groupMembershipGroupField + " from " + groupMembershipTableName + " where " + groupMembershipUserField + " = ?");
    statement.setString(1, user.getName());
    ResultSet set = statement.executeQuery();
    Set response = new HashSet();
    for(; set.next(); response.add(getGroup(set.getString(1))));
    set.close();
    statement.close();
    if(debug)
    System.out.println("Groups for " + user.getName() + ": " + response);
    set1 = response;
    finally
    try
    if(connection != null)
    connection.close();
    catch(SQLException e) { }
    return set1;
    protected void addToGroup(DataSourceUser user, Group group)
    throws SQLException
    if(groupMembershipTableName == null)
    return;
    Connection connection = null;
    try
    connection = getDataSource().getConnection();
    PreparedStatement statement = connection.prepareStatement("insert into " + groupMembershipTableName + " (" + groupMembershipUserField + ", " + groupMembershipGroupField + ") values (?, ?)");
    statement.setString(1, user.getName());
    statement.setString(1, group.getName());
    statement.executeUpdate();
    statement.close();
    finally
    try
    if(connection != null)
    connection.close();
    catch(SQLException e) { }
    protected void removeFromGroup(DataSourceUser user, Group group)
    throws SQLException
    if(groupMembershipTableName == null)
    return;
    Connection connection = null;
    try
    connection = getDataSource().getConnection();
    PreparedStatement statement = connection.prepareStatement("delete from " + groupMembershipTableName + " where " + groupMembershipUserField + " = ? and " + groupMembershipGroupField + " = ?");
    statement.setString(1, user.getName());
    statement.setString(2, group.getName());
    statement.executeUpdate();
    statement.close();
    finally
    try
    if(connection != null)
    connection.close();
    catch(SQLException e) { }
    public int getUserCount()
    Connection connection;
    Exception exception;
    connection = null;
    int i;
    try
    connection = getDataSource().getConnection();
    PreparedStatement statement = connection.prepareStatement("select count(*) as numberOfUsers from " + tableName);
    ResultSet set = statement.executeQuery();
    set.next();
    int count = set.getInt("numberOfUsers");
    set.close();
    statement.close();
    i = count;
    catch(SQLException e)
    throw new RuntimeException("SQLException: " + e.getMessage());
    finally
    JVM INSTR jsr 126;
    return i;
    throw exception;
    local;
    try
    if(connection != null)
    connection.close();
    catch(SQLException e) { }
    JVM INSTR ret 7;
    public List getUsers(int start, int length)
    Connection connection;
    Exception exception;
    connection = null;
    List list;
    try
    connection = getDataSource().getConnection();
    PreparedStatement statement = connection.prepareStatement("select " + usernameField + " from " + tableName);
    ResultSet set;
    for(set = statement.executeQuery(); start > 0 && set.next(););
    List response = new ArrayList();
    for(; length > 0 && set.next(); response.add(getUser(set.getString(usernameField))));
    set.close();
    statement.close();
    list = response;
    catch(SQLException e)
    throw new RuntimeException("SQLException: " + e.getMessage());
    finally
    JVM INSTR jsr 194;
    return list;
    throw exception;
    local;
    try
    if(connection != null)
    connection.close();
    catch(SQLException e) { }
    JVM INSTR ret 9;
    public String toCase(String name)
    switch(casing)
    case 2: // '\002'
    boolean needsToChange = false;
    for(int i = 0; i < name.length(); i++)
    if(!Character.isLowerCase(name.charAt(i)))
    continue;
    needsToChange = true;
    break;
    return needsToChange ? name.toUpperCase() : name;
    case 3: // '\003'
    boolean needsToChange = false;
    for(int i = 0; i < name.length(); i++)
    if(!Character.isUpperCase(name.charAt(i)))
    continue;
    needsToChange = true;
    break;
    return needsToChange ? name.toLowerCase() : name;
    return name;
    protected DataSource getDataSource()
    if(dataSource == null)
    try
    InitialContext context = new InitialContext();
    dataSource = (DataSource)context.lookup(dataSourceLocation);
    catch(ClassCastException e)
    if(debug)
    e.printStackTrace();
    System.out.println("DataSourceUserManager.getDataResource - Not a valid DataSource at " + dataSourceLocation);
    dataSource = null;
    catch(NamingException e)
    if(debug)
    e.printStackTrace();
    System.out.println("DataSourceUserManager.getDataResource - Error in lookup of datasource : " + dataSourceLocation + " exception is " + e.getMessage());
    dataSource = null;
    return dataSource;
    private static final int CASING_SENSITIVE = 1;
    private static final int CASING_TOUPPER = 2;
    private static final int CASING_TOLOWER = 3;
    protected DataSource dataSource;
    protected String dataSourceLocation;
    protected boolean destroyed;
    protected String tableName;
    protected String usernameField;
    protected String passwordField;
    protected String certificateIssuerField;
    protected String certificateSerialField;
    protected String localeField;
    protected boolean debug;
    protected String groupMembershipTableName;
    protected String groupMembershipUserField;
    protected String groupMembershipGroupField;
    protected Map users;
    protected long stalenessTime;
    protected int casing;
    }

  • A bug in creator when creating jdbc jndi connection

    Hi,
    I am using sun java studio creator for jdbc jndi connection. The syntax is
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/mydb");
    conn = ds.getConnection();
    It's failed. Once I change to ctx.lookup("jdbc/mydb") and the connection is created.
    Once deployed to tomcat, it seems only java:comp/env/jdbc/mydb is working.
    The full path(java:comp/env/jdbc/mydb) seems right from my google search.
    Why creator using jdbc/mydb? Is it a bug to creator?
    Thanks,
    Jie

    I mean a resource reference in web.xml file that looks like this:
         <resource-ref id="ResourceRef_1103225373500">
              <res-ref-name>DBConnection</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Application</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>
    where DBConnection is the resource alias I mentioned before:
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/DBConnection");
    Using WebSphere a binding between this above defined ResourceRef and JNDI mapping must be defined in a file called ibm-web-bnd.xmi. The content of this file will look like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <webappbnd:WebAppBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:webappbnd="webappbnd.xmi" xmi:id="WebAppBinding_1" virtualHostName="default_host">
    <webapp href="WEB-INF/web.xml#WebApp"/>
    <resRefBindings xmi:id="ResourceRefBinding_1103225373500" jndiName="jdbc/mydb">
    <bindingResourceRef href="WEB-INF/web.xml#ResourceRef_1103225373500"/>
    </resRefBindings>
    </webappbnd:WebAppBinding>
    Obviously using WSAD all of that could be done using IDE. In your case and using Sun IDE, I am not sure. But this is basically the concept of needed mapping in order to reference your JNDI without getting an error. At least this is how we resolved the error you are encountering.
    Hope that helps!

  • Bug in weblogic.rmic: produces incorrect IDL in factory decls.

    My EJB when producing IDL produces incorrect IDL: One of the outputs
    is java/net/URL.idl but when I try to compile it using Inprise
    visibroker
    4.0 for C++, I get the following parse error:
    /opt/inprise/vbrokercpp/bin/idl2cpp -no_servant -idl_strict
    -I/opt/inprise/vbrokercpp/idl -tie -namespace -no_pretty_print -Iidl
    -src_suffix cpp -root_dir cpp/java/lang idl/java/lang/ClassLoader.idl
    idl/java/net/URL.idl: 76:syntax error after )
    idl/java/net/URL.idl: 76:expected a[n]: ;
    idl/java/net/URL.idl: 76:instead of raises
    idl/java/net/URL.idl: 78:syntax error after )
    idl/java/net/URL.idl: 78:expected a[n]: ;
    idl/java/net/URL.idl: 78:instead of raises
    idl/java/net/URL.idl: 82:java::net::URLStreamHandler not found (expected
    type name)
    idl/java/net/URL.idl: 83:syntax error after )
    idl/java/net/URL.idl: 83:expected a[n]: ;
    idl/java/net/URL.idl: 83:instead of raises
    idl/java/net/URL.idl: 84:java::net::URLStreamHandler not found (expected
    type name)
    idl/java/net/URL.idl: 88:syntax error after )
    idl/java/net/URL.idl: 88:expected a[n]: ;
    idl/java/net/URL.idl: 88:instead of raises
    6 errors
    This is an error in the IDL: factory methods are trying to raise
    exceptions; however this is disallowed by the OMG IDL specification
    version 2.3:
    <init_dcl> ::= "factory" <identifier>"(" [ <init_param_decls> ]
    <init_param_decls> ::= <init_param_decl> { , <init_param_decl> }
    <init_param_decl> ::= <init_param_attribute> <param_type_spec>
    <simple_declarator>
    <init_param_attribute> ::= "in"
    As you can see, when using the keyword "factory" there is no "raises"
    clause allowed by the grammar.
    This is one of a few instances of the problem (this problem only
    occurred
    in one file but for several methods):
    factory
    create__CORBA_WStringValue__CORBA_WStringValue__CORBA_WStringValue( in
    ::CORBA::WStringValue arg0, in ::CORBA::WStringValue arg1, in
    ::CORBA::WStringValue arg2) raises (::java::net::MalformedURLEx);
    -Kim.

    the difference here is Thread-based security vs. Object-based security. WLS opts for the Thread-based model. this model was also
    backed up by the original revisions of the JAAS spec. it's just something to take into consideration when designing applications.
    .paul
    Marcel Stremming wrote:
    I have a SessionBean Method :
    public void contextTest() throws RemoteException {
    try {
    System.out.println("Principal 1: " + ctx.getCallerPrincipal());
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    h.put(Context.PROVIDER_URL, "t3://localhost:7001");
    h.put(Context.SECURITY_PRINCIPAL, "toto");
    h.put(Context.SECURITY_CREDENTIALS, "test");
    Context new_ctx = new InitialContext(h);
    System.out.println("Principal 2: " + ctx.getCallerPrincipal());
    } catch (Exception e) {e.printStackTrace(); }
    When principal "titi" invokes this Method it produces the following output:
    Principal 1: titi
    Principal 2: toto
    As You can see the Method just replaced the Caller Context's principal stored in the ctx field without even touching it. Since
    my Servlets run on the same JVM and use PassByReference calling this Method twice results in :
    Principal 1: titi
    Principal 2: toto
    Principal 1: toto
    Principal 2: toto
    I think this is a Bug because it makes it quiet difficult to open two Context's at the same time.
    I would like to read some opinions.

  • Help: I'm sure it is a Bug in JNI calling WebLogic EJB

    Help me! I'm using jni to call weblogic EJB from a Com+ component,here is the code:
    // This is the main project file for VC++ application project
    // generated using an Application Wizard.
    #include "stdafx.h"
    #pragma unmanaged
    #include <windows.h>
    #include <jni.h>
    #include <process.h>
    #include <stdio.h>
    #define USER_CLASSPATH "C:\\myClasses;C:\\j2sdk1.4.0\\lib\\tools.jar;Z:\\wlserver6.1\\lib\\weblogic.jar;"
    /* where Prog.class is */
    JavaVM *jvm;
    * Function GetJNIEnv(void) returns the java environment pointer
    * in case we are executing on a thread other than the one the
    * jvm was created on.
    JNIEnv* GetJNIEnv(void){
         JNIEnv *env = NULL;
         jint nRet = jvm->GetEnv((void **)&env, JNI_VERSION_1_2);
         if(nRet == JNI_EDETACHED){
              jvm->AttachCurrentThread((void **)&env, NULL);
         return env;
    * Function DoJNDI(void *arg) uses the Java Invocation API to
    * execute the following Java code:
    * Hashtable prop = new Hashtable();
    * prop.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"
    * prop.put( Context.PROVIDER_URL, "t3://192.168.40.137:7001" );
    * ctxInitial = new InitialDirContext( prop );
    void DoJNDI(void *arg){
         jclass clsHash, clsInitDirCx;
         jmethodID mHashInit, mHashPut, mInitDirCxInit;
         jobject objHash, objInitDirCx;
         JNIEnv *env = GetJNIEnv(); // Get the environment if on a different thread
         clsHash = env->FindClass("java/util/Hashtable");
         mHashInit = env->GetMethodID(clsHash, "<init>", "()V");
         objHash = env->NewObject(clsHash, mHashInit);
         mHashPut = env->GetMethodID(clsHash, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
         jstring jstrICxFactoryPut = env->NewStringUTF("java.naming.factory.initial");
         jstring jstrICxFactoryVal = env->NewStringUTF("weblogic.jndi.WLInitialContextFactory");
         env->CallObjectMethod(objHash, mHashPut, jstrICxFactoryPut,jstrICxFactoryVal);
         jstring jstrProviderUrlPut = env->NewStringUTF("java.naming.provider.url");
         jstring jstrProviderUrlVal = env->NewStringUTF("t3://192.168.40.137:7001");
         env->CallObjectMethod(objHash, mHashPut, jstrProviderUrlPut,jstrProviderUrlVal);
         clsInitDirCx = env->FindClass("javax/naming/InitialContext");
         mInitDirCxInit = env->GetMethodID(clsInitDirCx, "<init>", "(Ljava/util/Hashtable;)V");
         objInitDirCx = env->NewObject(clsInitDirCx, mInitDirCxInit, objHash);
         if(objInitDirCx == NULL){
              printf("%s test FAILED:\n\n", (char*)arg);
         else{
              printf("%s test PASSED\n\n", (char*)arg);
         jvm->DetachCurrentThread();
    * Function main(void) creates a JVM, and calls DoJNDI twice:
    * Once as a regular function call, and once as a spun off thread.
    void main() {
    JavaVMInitArgs vm_args;
    JavaVMOption options[5];
         options[0].optionString = "-client";
    options[1].optionString =
    "-cp " USER_CLASSPATH;
    options[2].optionString =
    "-Djava.class.path=" USER_CLASSPATH;
         //options[3].optionString =
         //     "-Xbootclasspath:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;z:\\wlserver6.1\\lib\\weblogic.jar;";
         options[3].optionString =
              "-Xbootclasspath/a:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
         options[4].optionString =
              "-Xbootclasspath/p:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 5;
    vm_args.ignoreUnrecognized = JNI_TRUE;
         JNIEnv *env;
         jint res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
         // *** Make the magic calls! (Both lines should do the same thing) ***
         DoJNDI((void*)"Function call");
         _beginthread(DoJNDI,0,(void *)"Thread call");
         /* wait for thread(s) to finish */
         Sleep(5000);
         jvm->DestroyJavaVM();
    But it always send me a Exception like below:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory.
    Root exception is java.lang.ClassNotFoundException: weblogic/jndi/WLInitialContextFactory
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:207)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    when I search this problem in java.sun.com,an article announce that it is a bug that
    JNDI not support multi-threads call,and it is fixed is JDK1.4 beta. The link is:
    http://developer.java.sun.com/developer/bugParade/bugs/4307751.html
    It seems that weblogic's JNDI is not support multi-thread call. what can i do?

    Try adding the following code before instantiating your initial context:
    Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader()
    This fixed the problem for me.
    -Brian
    "Edward Lu" <[email protected]> wrote:
    >
    Help me! I'm using jni to call weblogic EJB from a Com+ component,here is
    the code:
    // This is the main project file for VC++ application project
    // generated using an Application Wizard.
    #include "stdafx.h"
    #pragma unmanaged
    #include <windows.h>
    #include <jni.h>
    #include <process.h>
    #include <stdio.h>
    #define USER_CLASSPATH "C:\\myClasses;C:\\j2sdk1.4.0\\lib\\tools.jar;Z:\\wlserver6.1\\lib\\weblogic.jar;"
    /* where Prog.class is */
    JavaVM *jvm;
    * Function GetJNIEnv(void) returns the java environment pointer
    * in case we are executing on a thread other than the one the
    * jvm was created on.
    JNIEnv* GetJNIEnv(void){
         JNIEnv *env = NULL;
         jint nRet = jvm->GetEnv((void **)&env, JNI_VERSION_1_2);
         if(nRet == JNI_EDETACHED){
              jvm->AttachCurrentThread((void **)&env, NULL);
         return env;
    * Function DoJNDI(void *arg) uses the Java Invocation API to
    * execute the following Java code:
    * Hashtable prop = new Hashtable();
    * prop.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"
    * prop.put( Context.PROVIDER_URL, "t3://192.168.40.137:7001" );
    * ctxInitial = new InitialDirContext( prop );
    void DoJNDI(void *arg){
         jclass clsHash, clsInitDirCx;
         jmethodID mHashInit, mHashPut, mInitDirCxInit;
         jobject objHash, objInitDirCx;
         JNIEnv *env = GetJNIEnv(); // Get the environment if on a different thread
         clsHash = env->FindClass("java/util/Hashtable");
         mHashInit = env->GetMethodID(clsHash, "<init>", "()V");
         objHash = env->NewObject(clsHash, mHashInit);
         mHashPut = env->GetMethodID(clsHash, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
         jstring jstrICxFactoryPut = env->NewStringUTF("java.naming.factory.initial");
         jstring jstrICxFactoryVal = env->NewStringUTF("weblogic.jndi.WLInitialContextFactory");
         env->CallObjectMethod(objHash, mHashPut, jstrICxFactoryPut,jstrICxFactoryVal);
         jstring jstrProviderUrlPut = env->NewStringUTF("java.naming.provider.url");
         jstring jstrProviderUrlVal = env->NewStringUTF("t3://192.168.40.137:7001");
         env->CallObjectMethod(objHash, mHashPut, jstrProviderUrlPut,jstrProviderUrlVal);
         clsInitDirCx = env->FindClass("javax/naming/InitialContext");
         mInitDirCxInit = env->GetMethodID(clsInitDirCx, "<init>", "(Ljava/util/Hashtable;)V");
         objInitDirCx = env->NewObject(clsInitDirCx, mInitDirCxInit, objHash);
         if(objInitDirCx == NULL){
              printf("%s test FAILED:\n\n", (char*)arg);
         else{
              printf("%s test PASSED\n\n", (char*)arg);
         jvm->DetachCurrentThread();
    * Function main(void) creates a JVM, and calls DoJNDI twice:
    * Once as a regular function call, and once as a spun off thread.
    void main() {
    JavaVMInitArgs vm_args;
    JavaVMOption options[5];
         options[0].optionString = "-client";
    options[1].optionString =
    "-cp " USER_CLASSPATH;
    options[2].optionString =
    "-Djava.class.path=" USER_CLASSPATH;
         //options[3].optionString =
         //     "-Xbootclasspath:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;z:\\wlserver6.1\\lib\\weblogic.jar;";
         options[3].optionString =
              "-Xbootclasspath/a:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
         options[4].optionString =
              "-Xbootclasspath/p:c:\\j2sdk1.4.0\\lib\\tools.jar;z:\\wlserver6.1\\lib\\weblogic_sp.jar;";
    vm_args.version = 0x00010002;
    vm_args.options = options;
    vm_args.nOptions = 5;
    vm_args.ignoreUnrecognized = JNI_TRUE;
         JNIEnv *env;
         jint res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
         // *** Make the magic calls! (Both lines should do the same thing) ***
         DoJNDI((void*)"Function call");
         _beginthread(DoJNDI,0,(void *)"Thread call");
         /* wait for thread(s) to finish */
         Sleep(5000);
         jvm->DestroyJavaVM();
    But it always send me a Exception like below:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory.
    Root exception is java.lang.ClassNotFoundException: weblogic/jndi/WLInitialContextFactory
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:207)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    when I search this problem in java.sun.com,an article announce that it is
    a bug that
    JNDI not support multi-threads call,and it is fixed is JDK1.4 beta. The
    link is:
    http://developer.java.sun.com/developer/bugParade/bugs/4307751.html
    It seems that weblogic's JNDI is not support multi-thread call. what can
    i do?

  • Java.io.NotSerializableException: javax.naming.InitialContext

    I am using Workshop to create a Stateful session bean and i just have a simple member variable in the bean of type string. I didnt override the ejbCreate and setSessionContext methods and i get the following error when it is trying to passivate the bean.
    Passivate Called
    <Nov 17, 2004 2:51:06 PM PST> <Error> <EJB> <BEA-010024> <Error occurred during
    passivation: java.io.NotSerializableException: javax.naming.InitialContext
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
    :1330)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
    02)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
    a:1245)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
    at weblogic.ejb20.swap.PassivationUtils.write(PassivationUtils.java:94)
    at weblogic.ejb20.swap.DiskSwap.write(DiskSwap.java:214)
    at weblogic.ejb20.manager.StatefulSessionManager.swapOut(StatefulSession
    Manager.java:1051)
    at weblogic.ejb20.cache.NRUCache.moveInActiveToFree(NRUCache.java:550)
    at weblogic.ejb20.cache.NRUCache.reclaimNodes(NRUCache.java:578)
    at weblogic.ejb20.cache.NRUCache.getFreeNode(NRUCache.java:238)
    at weblogic.ejb20.cache.NRUCache.put(NRUCache.java:318)
    at weblogic.ejb20.manager.StatefulSessionManager.create(StatefulSessionM
    anager.java:844)
    at weblogic.ejb20.manager.StatefulSessionManager.remoteCreate(StatefulSe
    ssionManager.java:880)
    at weblogic.ejb20.internal.StatefulEJBHome.create(StatefulEJBHome.java:1
    33)
    at filenet.wfqa.tests.ejb.beans.StatefulSession_us0wxs_HomeImpl.create(S
    tatefulSession_us0wxs_HomeImpl.java:75)
    at filenet.wfqa.tests.ejb.beans.StatefulSession_us0wxs_HomeImpl_WLSkel.i
    nvoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
    ef.java:108)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:353)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    144)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:415)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    The stack trace sesms to tell me that it is something internal to the workshop generated EJBHome class since i do not see any reference to InitialContext in my bean class.
    Is it some bug with workshop. Or is it something wrong i am doing.
    Thanks
    sriram

    Page 325 (paragraph 5) of O”Reilly Enterprise Java Beans (4th Edition) states:
    “During the lifetime of a stateful session bean, there may be periods of inactivity when the bean instance is not servcing mentod from the client. To conseve resources, the container can passivate the bean instance by preserving its conversation state and evicitin the bean instance from memory. A ben’s convesatin stat may consist of primitive values, object that are serializable, and the following special types:
    javax.ejb.SessionContext
    javax.ejb EJBHome
    javax.ejb EJNObject
    javax.ejb Jta.UserTRansaction
    javax.ejb Naming.Context(only when it references the JNDI ENC)
    …”

  • Bug in WLS 8.1

    Hi,
    I enable JCOM in WLS 8.1.2 and once awhile I would see the following error message
    throw by WLS Server. I assuming it's a bug within weblogic.
    <May 4, 2004 8:49:31 AM CDT> <Error> <Kernel> <BEA-000802> <ExecuteRequest faile
    d
    java.lang.NullPointerException.
    java.lang.NullPointerException
    at java.util.Hashtable.get(Ljava.lang.Object;)Ljava.lang.Object;(Optimiz
    ed Method)
    at weblogic.com.COMService.getSubjectFromCache(Ljava.lang.Object;)Lweblo
    gic.security.acl.internal.AuthenticatedSubject;(COMService.java:133)
    at weblogic.com.COMExecuteRequest.execute(Lweblogic.kernel.ExecuteThread
    ;)V(COMExecuteRequest.java:67)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest
    ;)V(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
    at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Sourc
    e)
    >

    Hello,
    In general, JNDI clients should assume the correct environment is already configured so there is no need to explicitly set property values and pass them to the InitialContext constructor. However, a JNDI client may need to access a name space other than the one identified in its environment. In this case, it is necessary to explicitly set the java.naming.provider.url (provider URL) property used by the InitialContext constructor. A provider URL contains bootstrap server information that the initial context factory can use to obtain an initial context. Any property values passed in directly to the InitialContext constructor take precedence over settings of those same properties found elsewhere in the environment.
    Context.PROVIDER_URL— specifies the URL of the WebLogic Server that provides the name service. The default is t3://localhost:7001. So that you are getting the following result:
    ProviderURL=t3://localhost:7001
    Regards,
    Kuldeep Singh.

  • 10g: Bug with XML\Jazn Security

    For days I've been trying to get my migrated apps (from 9.0.3.1) to run with the internal JDev OC4J using JAZN security. I've been able to deploy to the packaged OC4J just fine, yet whenever I run it internally, it's never accepted my username and password.
    I just now found that JDev added a...
    <jazn provider="XML" location="[AppName]-jazn-data.xml" default-realm="jazn.com"/>
    to my App-oc4j-app.xml. I'm guessing this is for the Current Workspace settings, which is fine... however, for the Global settings, JDev never looks into system9.0.5.0.0.1375 \ oc4j-config for the global jazn-data.xml file when you run your app. (It will obfuscate passwords and everything, just won't look up your credentials)
    To fix the problem, I ended up copying my global jazn-data.xml file to my app's main directory (where App-oc4j-app.xml exists) from the system directory, then changing the location of the jazn provider in the App-oc4j-app.xml file to jazn-data.xml. (I suppose I could have just changed the location to point to the System directory as well).
    Anyways, figured this might help someone.

    I have the same problem. My app works fine with Stand alone OC4J. I tried to migrate my app into 10g Env.
    But I had the problem the JAZN Authentication. I tried all solutions, it still failed. I decided to create
    very simple EJB project to test Embedded OC4J debugging.
    I create a simple Test Workspace and testEJB project.
    I followed the steps to create a simple TestSesssionEJB with one method: insert.
    I right clicked on the TestSesssionEJB to generate New Sample EJB Client, named TestSessionEJBClient.
    1) To start the debug EJB, I right cliked the TestSesssionEJB and selected Degug TestSesssionEJB.
    2) Embedded OC4J Server started fine.
    3) I ran TestSessionEJBClient I got javax.naming.AuthenticationException
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Invalid username/password for current-workspace-app (admin); nested exception is:
         javax.naming.AuthenticationException: Invalid username/password for current-workspace-app (admin). Root exception is javax.naming.AuthenticationException: Invalid username/password for current-workspace-app (admin)
         at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2298)
         at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2129)
         at com.evermind.server.rmi.RMIConnection.lookup(RMIConnection.java:1665)
         at com.evermind.server.rmi.RMIServer.lookup(RMIServer.java:680)
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:134)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at test.TestSessionEJBClient.main(TestSessionEJBClient.java:17)
    Here is TestSessionEJBClient generated by JDeveloper
    package test;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import test.TestSessionEJB;
    import test.TestSessionEJBHome;
    import javax.naming.NamingException;
    public class TestSessionEJBClient
    public static void main(String [] args)
    TestSessionEJBClient testSessionEJBClient = new TestSessionEJBClient();
    try
    Context context = getInitialContext();
    TestSessionEJBHome testSessionEJBHome = (TestSessionEJBHome)PortableRemoteObject.narrow(context.lookup("TestSessionEJB"), TestSessionEJBHome.class);
    TestSessionEJB testSessionEJB;
    // Use one of the create() methods below to create a new instance
    testSessionEJB = testSessionEJBHome.create();
    // Call any of the Remote methods below to access the EJB
    // testSessionEJB.insertClob( );
    catch(Throwable ex)
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException
    // Get InitialContext for Embedded OC4J.
    // The embedded server must be running for lookups to succeed.
    return new InitialContext();
    Test-oc4j-app.xml content
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application runtime 1.2//EN" "http://xmlns.oracle.com/ias/dtds/orion-application.dtd">
    <orion-application>
    <ejb-module path="file:/C:/jdev905WorkSpaces/testEJB/classes/"/>
    <library path="C:\jdev905WorkSpaces\testEJB\classes">jdev-generated</library>
    <library path="C:\Tools\oracle\jdev905\jdev\system9.0.5.0.1349\oc4j-config\.client">jdev-generated</library>
    <library path="C:\Tools\oracle\jdev905\lib\xmlparserv2.jar">jdev-generated</library>
    <library path="C:\Tools\oracle\jdev905\lib\xmlcomp.jar">jdev-generated</library>
    <log>
    <file path="Test-oc4j-app.log"/>
    </log>
    <jazn provider="XML" location="Test-jazn-data.xml" default-realm="jazn.com"/>
    <data-sources path="Test-data-sources.xml"/>
    </orion-application>
    Test-jazn-data.xml content
    <jazn-data>
    <jazn-realm>
    <realm>
    <name>jazn.com</name>
    <users>
    <user>
    <name>jdevuser</name>
    <credentials>!jdevuser</credentials>
    </user>
    </users>
    <roles>
    <role>
    <name>jdevrole</name>
    </role>
    </roles>
    </realm>
    </jazn-realm>
    </jazn-data>
    .../system9.0.5.0.1349\oc4j-config/server.xml
    <application-server application-directory="applications" deployment-directory="application-deployments" connector-directory="connectors" transaction-log="log/transaction.state" recovery-procedure="ignore" taskmanager-granularity="5000" taskmanager-interval="5000" auto-unpack-applications="true">
         <rmi-config path="./rmi.xml"/>
         <sep-config path="./internal-settings.xml"/>
         <!-- JMS-server config link, uncomment to activate the JMS service -->
         <jms-config path="./jms.xml"/>
         <log>
              <file path="log/server.log"/>
         </log>
    <java-compiler name="ojc" in-process="false" bindir="C:\Tools\oracle\jdev905\jdev\bin\"/>
         <global-application name="default" path="application.xml"/>
    <application name="bc4j" path="C:\Tools\oracle\jdev905\jdev\system9.0.5.0.1349\oc4j-config\applications\bc4j.ear"/>
    <application name="larcis" path="C:\larcis3\jdev905\larcis3-oc4j-app.xml"/>
    <application name="current-workspace-app" path="C:\jdev905WorkSpaces\Test-oc4j-app.xml"/>
         <global-web-app-config path="global-web-application.xml"/>
         <!-- <web-site path="./secure-web-site.xml" /> -->
         <web-site default="true" path="./default-web-site.xml"/>
         <!-- Compiler, activate this to specify an alternative compiler such
              as jikes for EJB/JSP compiling. -->
         <!-- <compiler executable="jikes" classpath="/myjdkdir/jre/lib/rt.jar" /> -->
    </application-server>
    I think this is a bug in XML/JAZN that Tim mentioned in the first post.
    I also tried the solution suggested by Tim. But it still did not work.
    Any one have another suggestion?

  • Bug report (easy to fix)

    The following exception was printed on screen, but not
    thrown to program. So, the program does not know
    what happed:
    java.lang.IllegalStateException: Monitorable component can not be registered because admin service
    as not been initialized.
    at com.iplanet.ias.admin.monitor.MonitoringHelper.registerORBMonitoringMBean(Unknown Source
    at com.iplanet.ias.admin.monitor.MonitoringHelper.registerSystemORBMonitoringMBean(Unknown
    ource)
    at com.sun.enterprise.util.ORBManager.initializeORBMonitoring(Unknown Source)
    at com.sun.enterprise.util.ORBManager.init(Unknown Source)
    at com.sun.enterprise.naming.SerialInitContextFactory.<init>(Unknown Source)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java
    39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorI
    pl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:296)
    at java.lang.Class.newInstance(Class.java:249)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:175)
    at com.acelet.s.i.if(Unknown Source)
    at com.acelet.s.i.a(Unknown Source)
    at com.acelet.s.ap.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:536)

    Hi Judy,
    I send a simple test program to [email protected] You can
    reproduce this bug from that program.
    NOTE: this bug report is for the way you handle the exception. The resean I sent test program to [email protected] was to find the root of the problem.
    It would be appreciated if both of the problems be fixed.

  • InitialContext and PROVIDER_URL

    I'm creating an InitialContext in a server-side object, relying on the WebLogic Server
    to use the local naming service. This works as expected. However, once created,
    I would like to determine the URL and initial context factory for the local naming
    service. When the following code is executed:
    InitialContext myCtx = new InitialContext();
    ht = myCtx.getEnvironment();
    myContext = (String)ht.get(Context.INITIAL_CONTEXT_FACTORY);
    myServer = (String)ht.get(Context.PROVIDER_URL);
    if(myServer == null)
    myServer = (String)ht.get(weblogic.jndi.WLContext.PROVIDER_RJVM);
    ..the initial context factory is returned as expected from the environment hashtable,
    but both PROVIDER_URL and PROVIDER_RJVM are null. Is there any way to determine
    what the correct URL for the local naming service is? (Assuming that there is no
    guarantee that it is at localhost:7001)
    Thanks in advance,
    Mike

    I figured this out myself . A bug (6089084) was reported and closed as Not-A-Bug. Sun App server has a workaround on it. Instead of using InitialContext() with programmatically specified properties, specify the ejb-name/jndi-name binding in ejb descriptor file (with jndiname format : 'corbaname:iiop:<host>:<iiop port>#<Bean's JNDI name>'), create an InitialContext without any added properties, and use 'java:comp/env/<ejb-name>' for lookup.

  • Re: Applet can't get an InitialContext in sp8 5.1

    Here's the latest on this issue...
    CASE_ID_NUM: 212375
    I had a talk with one of our engineer here, he said the patch that was given
    earlier, works for un secure protocols(http,t3). For secure protocols
    already two cases are field(CR42423,CR42598). I will let you know once i had
    feedback from engg team.
    "Joe Herbers" <[email protected]> wrote in message
    news:[email protected]...
    Well, we thought the patch on the service pack fixed things, and it sort of
    does, but not completely. I sent the following to BEA support a week and a
    half ago, but so far I've gotten no response on this. Anyone else encounter
    this?
    Please reopen case 212375. The patch provided (CR041497) fixes the initial
    problem we and others saw. However, the way the fix is implemented does not
    seem to be completely correct. When we try with other configurations, such
    as SSL, things don't completely work. Someone looked at a decompiled
    version of the patched Handler.class and it seems to be catching the
    exception as expected, but the catch is "outside" the code that still
    needs to be executed in order for everything to work as desired.
    We think that our prior workaround (reverting back to the version of the
    Handler.class that exists in the original 5.1 install and not using the one
    in sp8 or this patch) will continue to work for us, but that is not a
    solution that we should go to production with. Please correct the patch.
    "Joe Herbers" <[email protected]> wrote in message
    news:<[email protected]>...
    FYI: This was a weblogic bug (case 212375) in sp8 that is fixed by patch
    CR041497.
    "Sudheendra Galgali" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I have a simple applet that tries to create a context to the WL server. I am
    currently trying out WL 5.1, service pack 8 on Windows NT 4.0/service pack 5
    using JDK 1.3 and the 1.3.0.01 plugin on the client. I am attaching the
    applet source code and the weblogic.policy file with this post.
    When I try to create the context from the applet, I get the following
    exception. I have tried playing with the weblogic.policy file but to no
    avail. Can anybody help? The same code works when the server is run with WL
    4.5.1 or 4.5.2.
    java.lang.ExceptionInInitializerError: java.security.AccessControlException:
    access denied (java.util.PropertyPermission * read,write)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertiesAccess(Unknown Source)
    at java.lang.System.getProperties(Unknown Source)
    at weblogic.net.http.Handler.init(Handler.java:43)
    at
    weblogic.socket.JVMSocketHTTPClient.<clinit>(JVMSocketHTTPClient.java:26)
    at weblogic.socket.JVMSocketManager.create(JVMSocketManager.java:308)
    at
    weblogic.rjvm.ConnectionManager.findOrCreateSocket(ConnectionManager.java:93
    5)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:339)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:306)
    at
    weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:252)
    at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:223)
    at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:186)
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:200)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at Applet1.getInitialContext(Applet1.java:80)
    at Applet1.init(Applet1.java:50)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Any help would be appreciated. Thanks in advance.

    A further update on this: this patch fixes https for applets in sp8/9.
    However, it doesn't work with proxy servers with https (which used to work -
    http with proxy servers does still work). We've reported this to BEA and
    they are investigating...
    "Joe Herbers" <[email protected]> wrote in message
    news:[email protected]...
    There is now also a patch for this that makes SSL work:
    cr042423_rel510sp81.jar Not sure if this patch works with sp9. The
    original problem is fixed in sp9, but I don't think the SSL part is.
    "Joe Herbers" <[email protected]> wrote in message
    news:[email protected]...
    Here's the latest on this issue...
    CASE_ID_NUM: 212375
    I had a talk with one of our engineer here, he said the patch that was given
    earlier, works for un secure protocols(http,t3). For secure protocols
    already two cases are field(CR42423,CR42598). I will let you know once i had
    feedback from engg team.
    "Joe Herbers" <[email protected]> wrote in message
    news:[email protected]...
    Well, we thought the patch on the service pack fixed things, and it sort of
    does, but not completely. I sent the following to BEA support a week and a
    half ago, but so far I've gotten no response on this. Anyone else encounter
    this?
    Please reopen case 212375. The patch provided (CR041497) fixes the initial
    problem we and others saw. However, the way the fix is implemented does not
    seem to be completely correct. When we try with other configurations, such
    as SSL, things don't completely work. Someone looked at a decompiled
    version of the patched Handler.class and it seems to be catching the
    exception as expected, but the catch is "outside" the code that still
    needs to be executed in order for everything to work as desired.
    We think that our prior workaround (reverting back to the version of the
    Handler.class that exists in the original 5.1 install and not using the one
    in sp8 or this patch) will continue to work for us, but that is not a
    solution that we should go to production with. Please correct the patch.
    "Joe Herbers" <[email protected]> wrote in message
    news:<[email protected]>...
    FYI: This was a weblogic bug (case 212375) in sp8 that is fixed by patch
    CR041497.
    "Sudheendra Galgali" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I have a simple applet that tries to create a context to the WL server. I am
    currently trying out WL 5.1, service pack 8 on Windows NT 4.0/service pack 5
    using JDK 1.3 and the 1.3.0.01 plugin on the client. I am attaching the
    applet source code and the weblogic.policy file with this post.
    When I try to create the context from the applet, I get the following
    exception. I have tried playing with the weblogic.policy file but to no
    avail. Can anybody help? The same code works when the server is run with WL
    4.5.1 or 4.5.2.
    java.lang.ExceptionInInitializerError: java.security.AccessControlException:
    access denied (java.util.PropertyPermission * read,write)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertiesAccess(Unknown Source)
    at java.lang.System.getProperties(Unknown Source)
    at weblogic.net.http.Handler.init(Handler.java:43)
    at
    weblogic.socket.JVMSocketHTTPClient.<clinit>(JVMSocketHTTPClient.java:26)
    at weblogic.socket.JVMSocketManager.create(JVMSocketManager.java:308)
    at
    weblogic.rjvm.ConnectionManager.findOrCreateSocket(ConnectionManager.java:93
    5)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:339)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:306)
    at
    weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:252)
    at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:223)
    at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:186)
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:200)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at Applet1.getInitialContext(Applet1.java:80)
    at Applet1.init(Applet1.java:50)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Any help would be appreciated. Thanks in advance.

  • Applet can't get an InitialContext in sp8 5.1

    Well, we thought the patch on the service pack fixed things, and it sort of
    does, but not completely. I sent the following to BEA support a week and a
    half ago, but so far I've gotten no response on this. Anyone else encounter
    this?
    Please reopen case 212375. The patch provided (CR041497) fixes the initial
    problem we and others saw. However, the way the fix is implemented does not
    seem to be completely correct. When we try with other configurations, such
    as SSL, things don't completely work. Someone looked at a decompiled
    version of the patched Handler.class and it seems to be catching the
    exception as expected, but the catch is "outside" the code that still
    needs to be executed in order for everything to work as desired.
    We think that our prior workaround (reverting back to the version of the
    Handler.class that exists in the original 5.1 install and not using the one
    in sp8 or this patch) will continue to work for us, but that is not a
    solution that we should go to production with. Please correct the patch.
    "Joe Herbers" <[email protected]> wrote in message
    news:<[email protected]>...
    FYI: This was a weblogic bug (case 212375) in sp8 that is fixed by patch
    CR041497.
    "Sudheendra Galgali" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I have a simple applet that tries to create a context to the WL server. I am
    currently trying out WL 5.1, service pack 8 on Windows NT 4.0/service pack 5
    using JDK 1.3 and the 1.3.0.01 plugin on the client. I am attaching the
    applet source code and the weblogic.policy file with this post.
    When I try to create the context from the applet, I get the following
    exception. I have tried playing with the weblogic.policy file but to no
    avail. Can anybody help? The same code works when the server is run with WL
    4.5.1 or 4.5.2.
    java.lang.ExceptionInInitializerError: java.security.AccessControlException:
    access denied (java.util.PropertyPermission * read,write)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertiesAccess(Unknown Source)
    at java.lang.System.getProperties(Unknown Source)
    at weblogic.net.http.Handler.init(Handler.java:43)
    at
    weblogic.socket.JVMSocketHTTPClient.<clinit>(JVMSocketHTTPClient.java:26)
    at weblogic.socket.JVMSocketManager.create(JVMSocketManager.java:308)
    at
    weblogic.rjvm.ConnectionManager.findOrCreateSocket(ConnectionManager.java:93
    5)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:339)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:306)
    at
    weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:252)
    at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:223)
    at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:186)
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:200)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at Applet1.getInitialContext(Applet1.java:80)
    at Applet1.init(Applet1.java:50)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Any help would be appreciated. Thanks in advance.

    Well, we thought the patch on the service pack fixed things, and it sort of
    does, but not completely. I sent the following to BEA support a week and a
    half ago, but so far I've gotten no response on this. Anyone else encounter
    this?
    Please reopen case 212375. The patch provided (CR041497) fixes the initial
    problem we and others saw. However, the way the fix is implemented does not
    seem to be completely correct. When we try with other configurations, such
    as SSL, things don't completely work. Someone looked at a decompiled
    version of the patched Handler.class and it seems to be catching the
    exception as expected, but the catch is "outside" the code that still
    needs to be executed in order for everything to work as desired.
    We think that our prior workaround (reverting back to the version of the
    Handler.class that exists in the original 5.1 install and not using the one
    in sp8 or this patch) will continue to work for us, but that is not a
    solution that we should go to production with. Please correct the patch.
    "Joe Herbers" <[email protected]> wrote in message
    news:<[email protected]>...
    FYI: This was a weblogic bug (case 212375) in sp8 that is fixed by patch
    CR041497.
    "Sudheendra Galgali" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I have a simple applet that tries to create a context to the WL server. I am
    currently trying out WL 5.1, service pack 8 on Windows NT 4.0/service pack 5
    using JDK 1.3 and the 1.3.0.01 plugin on the client. I am attaching the
    applet source code and the weblogic.policy file with this post.
    When I try to create the context from the applet, I get the following
    exception. I have tried playing with the weblogic.policy file but to no
    avail. Can anybody help? The same code works when the server is run with WL
    4.5.1 or 4.5.2.
    java.lang.ExceptionInInitializerError: java.security.AccessControlException:
    access denied (java.util.PropertyPermission * read,write)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertiesAccess(Unknown Source)
    at java.lang.System.getProperties(Unknown Source)
    at weblogic.net.http.Handler.init(Handler.java:43)
    at
    weblogic.socket.JVMSocketHTTPClient.<clinit>(JVMSocketHTTPClient.java:26)
    at weblogic.socket.JVMSocketManager.create(JVMSocketManager.java:308)
    at
    weblogic.rjvm.ConnectionManager.findOrCreateSocket(ConnectionManager.java:93
    5)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:339)
    at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:306)
    at
    weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:252)
    at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:223)
    at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:186)
    at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:200)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at Applet1.getInitialContext(Applet1.java:80)
    at Applet1.init(Applet1.java:50)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Any help would be appreciated. Thanks in advance.

Maybe you are looking for

  • How to print a page in java ??

    Hi, i want to know how, after pushing a button, display the printer dialog box and then print the content of a JDialog box ?? If you have a link for documentation, it will be great. Thanks in advance Steve

  • Insertion in the xml document

    a-o-a i am trying to insert a block of elements in an xml file.infact in xml file there is an elemnt data. when last element of data is ended then i want to insert data element block in xml file in the end Document method of sax api. i am unable to d

  • Burn podcast to DVD

    Can you copy a podcast to a dvd disc so that you can watch from the TV as it is being played from a dvd player instead of watching it only from your computer?

  • HT4993 does the Iphone 4s have or support active x

    does anyone know if the Iphone 4S has active X or support active X for online security camera viewing

  • HT1414 white screen and not recognised by laptop

    my ipod touch froze and has now been stuck on a pure white screen. i have connected it to the computer to try to restore it but my computer will now not recognise the ipod. what should i do?