Stuck in HashMap

Thank you for your reply. I have re-worked my code and only issue I have in the compiler is with the displayMap method. I have no idea if this is going to work after I fix this issue. However, I'm reposting the requirements and my classes to see if you can spot my errors. It's such a shame that books and tutorials are so weak in such an important subject and I can't seem to find someone to talk to and to guide me on HashMaps. I do understand perfectly what it is suppose to do, but can't seem to grasp the concepts to implement them. Thank you again for your assistance.
Requirement 1: Implement your author tracking application. You do not have to read the book information from a file. You may enter it from the keyboard. You'll need to enter author last name and book title. No duplicate entries for an author last name should be stored; therefore be sure to use the appropriate collection class to store your author names. No book titles will be stored.
Requirement 2: Create an Author class that stores author's name and total royalties. Create an AuthorCode hashmap to store an author id and Author class. Use author id as the key and Author Class as the value.
Test application: Your test application should print the list of authors sorted alphabetically when done inputing authors and titles (tests implementation of requirement 1). Be sure to test multiple books for the same author to ensure you are not storing duplicates. To test requirement 2, your test application will prompt you for an author ID and using method(s) on HashMap, provide you a readable output of the Author's information for the entered author id.
Hint: You may want to look into overriding toString() method to provide a readable string representation of Author object. - with the help of NetBean and my revisions, this method was created.
First you need to take the author information read in and store in an author class. - Hopefully, I have done this step.
Call the constructor for your Author class with the author/book information you read in:
new Author(authorNameReadInString, bookTitleReadInString) - This one is not clear for me at all.
You'll want to put this in the map. Create an author id for the key. TO do this you can just increment i each time you add an author. Be sure to initialize i.
int i = 0;
map.put(i, new Author(authorNameReadInString, bookTitleReadInString); - when I do this step with variables, I get multiple errors.  This method took the call to my class AuthorRoyal and most of the erros were gone.
I didn't provide perfect syntax but hopefully this sheds some light.
I'm having to post my code in separate sections because of the forums' length limitation.

Oops the other class was my AuthorRoyal class. Here is the main class
import java.util.StringTokenizer;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.TreeSet;
import java.util.Scanner;
public class AuthorMapMain {
  private Map < Integer, AuthorRoyal> authorcode;
  private Scanner scanner;
  int i = 0;
  public AuthorMapMain()
     authorcode = new HashMap< Integer, AuthorRoyal > (); // create HashMap
     scanner = new Scanner( System.in ); // create scanner
     createMap(); // create map based on user input
     displayMap(); // display map content
  // method to create map from user input
  private void createMap()
    System.out.println( "Enter author fist name, last name, and book title:"); // prompt for user input
    String a = scanner.nextLine( ); // reads user input following the prompt
      // create StringTokenizer for input
      StringTokenizer tokenizer = new StringTokenizer( a );
      // processing input text
      while ( tokenizer.hasMoreTokens() ) // while more input
         // if the map contains the word
            String authorid = tokenizer.nextToken(); // get author
         if ( authorcode.containsKey( authorid ) ) // is key in map
             authorcode.put(i, new AuthorRoyal());
           } // end if
        // else
          //     authorcode.put ( );
          // add new word with a count of 1 to map
       } // end while
     // display map content
   private void displayMap()
      // sort keys
      Set< Integer > keys = authorcode.keySet(); // get keys
      TreeSet< String > sortedKeys = new TreeSet< String >( keys ); // ERROR after new TreeSet appears in NetBean underlined
      System.out.println( "Map contains:\nKey\t\tValue" );
      // generate output for each key in map
      for ( String key : sortedKeys )
         System.out.printf( "%-10s%10s%10s%n", key, authorcode.get( key ) );
      System.out.printf(
         "%nsize:%d%nisEmpty:%b%n", authorcode.size(), authorcode.isEmpty() );
   } // end method displayMap
    public static void main(String[] args) {
     // new AuthorRoyal();
      new AuthorMapMain();
}

Similar Messages

  • Stuck in HashMap + equals() behaviour

    I am studying the SCJP 6, and got stuck in one example from the book.
    package map583;
    import java.util.*;
    public class Dog {
        public Dog(String n) {
            name = n;
        public String name;
        public boolean equals(Object o) {
            if(o instanceof Dog){
                Dog dog = (Dog) o;
                if(dog.name.equalsIgnoreCase(this.name)){
                    return true;
                }else{
                    return false;
            } else {
                return false;
        public int hashCode() {
            return name.length();
    package map583;
    import java.util.*;
    public class MapTest {
        public static void main(String[] args) {
            Map<Object, Object> m = new HashMap<Object, Object>();
            Dog d1 = new Dog("clover");
            m.put(d1, "Dog key");
            d1.name = "123456";
            System.out.println(m.get(d1));
    }The output is "Dog Key", what I question is when changing d1.name to "123456", hashcode() returns same value, BUT equals() method compares to String values, obviously the Dog object name value in HashMap is "clover", but the d1.name value is "123456", and they are not the same.
    This gives me another assumption. Is the changing of name to "123456" actually changes the dog object name value in the HashMap? Because the dog object stored in the HashMap is d1. But when I changed the code to :
            d1.name = "1234567890";
            System.out.println(m.get(d1));It outputs null now. So it proves that the dog object stored in the HashMap CANNOT be changed by changing d1.name value, so how to explain my first question?

    roamer wrote:
    Now same question again, then how to explain this?
    d1.name = "1234567890";
    System.out.println(m.get(d1));   // returns "null". #2the key in the HashMap stores the variable name d1, which points to the Dog object modified by the above statement, which name is "1234567890" now. So when searching the HashMap, the argument passed (d1) is actually referencing the SAME object as the variable in the HashMap (which is also d1), same hashcode AND returns true in equals() method.
    So what the hell why this statment fails but #1 succeeded. When thinking in the same logic flow.Okay, you are REALLY missing the point here. We never get to the equals check because the hashCode is different, so it doesn't matter if it's the same object. This is what I tried to explain to you earlier: The messed up hash code might make you not even have a chanceto compare the object. With this very simple hashCode, changing the name to a different one of the same length didn't alter the hashCode, but changing it to a different length did, so we searched the wrong bucket, and therefore never had a chance to find the object.
    Dog d1 = new Dog("clover"); // A
    m.put(d1, "Dog key"); // B
    System.out.println(m.get(d1)); // C   // returns "Dog key". ---- Yes, it is normal.
    d1.name = "123456"; // D
    System.out.println(m.get(d1)); // E   // returns "Dog key". #1
    d1.name = "1234567890"; // F
    System.out.println(m.get(d1)); // G   // returns "null". #2A: Create an instance of Dog. name = "clover", stick a reference to it in variable d1
    B. Put a an entry in the map where the key is that Dog and the value is "Dog Key". The reference to the key is stored in the bucket for hashCode=6
    C. Search for d1 in the map. This means 1) Get hashCode of object pointed to by d1 (6). 2) Find that bucket. 3) For each element in that bucket, check if it equals(d1) 4. When we find the Dog in that bucket that equals(d1) because its name equals(d1.name), we return the corresponding value: "Dog key"
    D. Set the name of the only Dog object we've created to "123456". This does not change its bucket in the map, because hashCode() uses name.length(), which is still 6.
    E. Same as C, except now we're loooking for name of "123456" instead of "clover"
    F. Set the Dog object's name to "1234567890". This changes its hashcode, so it is (probably) no longer in the same bucket.
    G. Search for d1 in the map. This means 1) Get hashCode of object pointed to by d1 (10). 2) Find that bucket. 3) For each element in that bucket, check if it equals(d1) 4. Since it's a different bucket, it doesn't matter if equals() is true, or even if == is true. The object is not found because we searched the wrong bucket.
    Note also what would happen if we had two different Dog objects. If we change the one in the map from "clover" to "123456", we'll still search the same bucket, but we won't return anything because d1 is a different object and "clover".equals("123456") is false. The second case would still return null for the same reason it currently does--we'd never even get to search the right bucket.
    Edited by: jverd on Feb 2, 2010 7:34 PM

  • How to store data in hashmap so that it can be used by different methods.

    Hello,
    I have an ADF/JSF application and the database is DRM. The program gets data from DRM into this hashmap. Program needs this data frequently. Getting this HashMap is very resource intensive due to a lot of data it has.
    I want to get the data in HashMap once ( I can do this - no problem).  But where/how do I keep it so that different methods can just use this and not make individual trips to DRM? It may be a very basic java question but I seem to be stuck :)
    I am not very concerned about the HashMap part, it can be any collection - the question is of storing it so that it can be used over and over.
    Thanks,

    User,
    If I understand you correctly, you have a JSF application that needs to store data in a HashMap such that it can be accessed over and over? You could put the hashmap into an appropriately-scoped managed bean and access it from there. I'm not sure what a "DRM" is (a digital rights management database, perhaps, in which case it's a "database"), so there is something special about a "DRM" that we need to know, please share.
    John

  • Hashmap and array list problems

    This is an assignment I have to do and I do NOT expect anyone to do the coding for me. I am just looking for some direction as I have no clue where to go from here. Any guidance would be very welcomed.
    We were given code that used just an Array lisThis is an assignment I have to do and I do NOT expect anyone to do the coding for me. I am just looking for some direction as I have no clue where to go next. Any guidance would be very welcomed.
    We were given code and told to "Modify the MailServer so that it uses a HashMap to store MailItems. The keys to the HashMap should be the names of the recipients, and each value should be an ArrayList containing all the MailItems stored for that recipient. " Originally it was just an ArrayList named messages. There is also a MailClient and MailItem class.
    I think I can post the messages using the HashMap now, but can't test it. I get a compiler error saying else without if even though I have an if statement. Even if I can compile, I need to make sure I am on the right track with the getNextMailItem method. It is the one I am stuck on and if I can get it to work, I can probably modify the other methods.
    I would really appreciate feedback on that one method.
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    public class MailServer
         // Storage for the arbitrary number of messages to be stored
         // on the server.
         private HashMap messages;
         private ArrayList list;
         private MailItem item;
          * Construct a mail server.
         public MailServer()
             messages = new HashMap();
             list = new ArrayList();
          * Return the next message for who. Return null if there
          * are none.
          * @param who The user requesting their next message.
         public MailItem getNextMailItem(String who)
              Iterator it = list.iterator();
              while(it.hasNext())
                MailItem item = (MailItem)it.next();
                if(messages.containsKey(who));
                    return item;
               else
                   return null;
          * Add the given message to the message list.
          * @param item The mail item to be stored on the server.
         public void post(String name, MailItem item)
             if(messages.containsKey(name))
                    list = (ArrayList) messages.get(name);
                    else {
                        list = new ArrayList();
                        list.add(item);
                        messages.put(name, list);
    }[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The way I understand this is that MailItems are stored in per user ArrayLists, and that the ArrayLists are stored in the HashMap, and use the username as a key,
    HashMap messages = new HashMap();
    //ArrayList userMailItems = new ArrayList(); this should not be declared here, only the messages mapso given a User name, you need to get the list of mail items for that user out of the hashMap, and then return the next MailItem from the list. So given that, you don't even need to Iterate over the list:
    public MailItem getNextMailItem(String who)
    ArrayList list = (ArrayList)messages.get(who);
    if(list == null || list.size() == 0)
    return null;
    //now we get the next item from the list, we can call remove, since it returns the object we are removing.
    MailItem item = (MailItem)list.remove(0);
    return item;
    }

  • Weblogic 9.2 BEA-000337 [STUCK]  error on DuplicateChecker.register

    Hi,
    We are having trouble with our weblogic 9.2 server hanging after the following stack dump:
    &lt;[ACTIVE] ExecuteThread: '11' for queue: 'weblogic.kernel.Default (self-tuning)'&gt; &lt;&lt;WLS Kernel&gt;&gt; &lt;&gt; &lt;&gt; &lt;1220237289307&gt; &lt;BEA-000337&gt; &lt;[STUCK] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "617" seconds working on the request "Http Request: /dsm/skins/common/templateInjector.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
    java.util.HashMap.put(HashMap.java:385)
    weblogic.descriptor.internal.DuplicateChecker.register(DuplicateChecker.java:52)
    weblogic.descriptor.internal.DuplicateChecker.registerIfNoDuplicate(DuplicateChecker.java:18)
    weblogic.descriptor.internal.ReferenceManager.registerBean(ReferenceManager.java:205)
    weblogic.j2ee.descriptor.wl.WeblogicWebAppBeanImpl.setContainerDescriptors(WeblogicWebAppBeanImpl.java:1484)
    weblogic.j2ee.descriptor.wl.WeblogicWebAppBeanImpl.addContainerDescriptor(WeblogicWebAppBeanImpl.java:1430)
    weblogic.j2ee.descriptor.wl.WeblogicWebAppBeanImpl.createContainerDescriptor(WeblogicWebAppBeanImpl.java:1501)
    sun.reflect.GeneratedMethodAccessor1206.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    weblogic.descriptor.utils.DescriptorUtils.invokeMethod(DescriptorUtils.java:154)
    weblogic.descriptor.utils.DescriptorUtils.getFirstChildOrDefaultBean(DescriptorUtils.java:113)
    weblogic.servlet.internal.WebAppConfigManager.getServletReloadCheckSecs(WebAppConfigManager.java:358)
    weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.java:424)
    weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:135)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:232)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:499)
    weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:427)
    weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:152)
    weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:173)
    jsp_servlet._skins._skin07.__skin07globalnavigationpanel._jspService(__skin07globalnavigationpanel.java:261)
    weblogic.servlet.jsp.JspBase.service(Js...
    I have a few of questions:
    1. Is there a thread safety problem in weblogic.descriptor.internal.DuplicateChecker.register?
    2. I can only seem to find __skin07globalnavigationpanel.class. For some reason on my weblogic server the java file is deleted, so I'm not sure exactly which line this came from.
    Thanks,
    Tim

    It is XD5P that fixes that issue, the previous patch mentioned was when it app server was own by BEA

  • How can I use instance methods created with HashMap

    class Template
    static HashMap customer;
    a few methods created various customer
    public static display() //to display a particular customer information among i've created above
                 String objectName,currentObjectName;
              Customer customer;
              Scanner scan=new Scanner(System.in);
              System.out.print("Please enter the customer name");
              objectName=scan.nextLine();
              Iterator iteratorForCustomer=CustomerMap.entrySet().iterator();
              Map.Entry customerEntry=(Map.Entry)iteratorForCustomer.next();
             while(iteratorForCustomer.hasNext())
                    customerEntry=(Map.Entry)iteratorForCustomer.next();
                    if(objectName.equals((String)customerEntry.getValue()))
              System.out.println("Name : " +customer.getName()); //I'm trying to reference to an instance method getName() here but i can't do that .
    }The problem is I've created as many as I want and later in the program I tried to redisplay a particular customer information based on the input (objectName). User type in the objectName and I tried to look for a particular customer Object in the HashMap and display only the relevant customer information. Is there any way to do it ? Thanks everyone in advance.

    Peter__Lawrey wrote:
    use the get method
    [http://www.google.co.uk/search?q=map+tutorial+java]
    [http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html]
    And then either look at a generics tutorial, or, if you're stuck on a pre-1.5 version of Java, find out about casting

  • Help on stuck thread

    Hi, From my server log I noticed that there are some stuck threads. After looked at the thread dump thread 18 is blocking. MainPortalServlet.java is extends PortalServlet and line 96 is super.service(request,response); Please help me to analyse why it is blocking. Thanks.
    "ExecuteThread: '20' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x0090e6b0 nid=0x3b waiting for monitor entry [0x600fd000..0x600ffc28]
         at com.bea.wlw.netui.script.el.util.ParseUtils.parse(ParseUtils.java:100)
         - waiting to lock <0x8d3a3f18> (a com.bea.wlw.netui.script.el.util.ParseUtils$Cache)
         at com.bea.wlw.netui.script.el.ExpressionEvaluatorImpl.containsExpression(ExpressionEvaluatorImpl.java:239)
         at com.bea.wlw.netui.pageflow.ProcessPopulate.populate(ProcessPopulate.java:295)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processPopulate(PageFlowRequestProcessor.java:402)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:691)
         at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:527)
         at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:152)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at com.bea.wlw.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1786)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:561)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:121)
         at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:98)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:154)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:113)
         at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:228)
         at com.bea.netuix.nf.ControlLifecycle$3.visit(ControlLifecycle.java:171)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:356)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:126)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:173)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:137)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:324)
         at com.bea.netuix.servlets.manager.UIServlet.processControlTree(UIServlet.java:220)
         at com.bea.netuix.servlets.manager.PortalServlet.doPost(PortalServlet.java:820)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:150)
         at com.cd.servlets.portal.MainPortalServlet.service(MainPortalServlet.java:96)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    "ExecuteThread: '19' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x0090dab8 nid=0x3a runnable [0x601fb000..0x601ffc28]
         at java.util.HashMap.getEntry(HashMap.java:361)
         at java.util.LinkedHashMap.get(LinkedHashMap.java:266)
         at com.bea.wlw.netui.script.el.util.ParseUtils.parse(ParseUtils.java:84)
         at com.bea.wlw.netui.script.el.util.ParseUtils.evaluate(ParseUtils.java:123)
         at com.bea.wlw.netui.script.el.ExpressionEvaluatorImpl.evaluateStrict(ExpressionEvaluatorImpl.java:87)
         at com.bea.wlw.netui.tags.AbstractBaseTag.evaluateExpressionInternal(AbstractBaseTag.java:573)
         at com.bea.wlw.netui.tags.AbstractBaseTag.evaluateExpression(AbstractBaseTag.java:362)
         at com.bea.wlw.netui.tags.databinding.script.GetData.doEndTag(GetData.java:249)
         at jsp_servlet._portlets.___portlet1._jspService(_portlet1.jsp:27)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilter.java:250)
         - locked <0x78ccf6c8> (a portlets.Portlet1Controller)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:652)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
         at com.bea.wlw.netui.pageflow.scoping.internal.ScopedRequestDispatcher.include(ScopedRequestDispatcher.java:120)
         at com.bea.netuix.servlets.controls.content.JspContent.beginRender(JspContent.java:534)
         at com.bea.netuix.servlets.controls.content.NetuiContent.beginRender(NetuiContent.java:425)
         at com.bea.netuix.nf.ControlLifecycle$1.visit(ControlLifecycle.java:495)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:543)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:247)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:356)
         at com.bea.netuix.nf.UIControl.render(UIControl.java:536)
         at com.bea.netuix.servlets.controls.PresentationContext.render(PresentationContext.java:405)
         at com.bea.netuix.servlets.util.RenderToolkit.renderChild(RenderToolkit.java:123)
         at com.bea.netuix.servlets.jsp.taglib.RenderChild.doStartTag(RenderChild.java:58)
         at jsp_servlet._framework._skeletons._cd.__flowlayout._jspService(flowlayout.jsp:30)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:646)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
         at com.bea.netuix.servlets.controls.JspRenderer.renderAlt(JspRenderer.java:194)
         at com.bea.netuix.servlets.controls.JspRenderer.beginRender(JspRenderer.java:96)
         at com.bea.netuix.nf.ControlLifecycle$1.visit(ControlLifecycle.java:491)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:543)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:247)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:356)
         at com.bea.netuix.nf.UIControl.render(UIControl.java:536)
         at com.bea.netuix.servlets.controls.PresentationContext.render(PresentationContext.java:405)
         at com.bea.netuix.servlets.util.RenderToolkit.renderChild(RenderToolkit.java:123)
         at com.bea.netuix.servlets.jsp.taglib.RenderChild.doStartTag(RenderChild.java:58)
         at jsp_servlet._framework._skeletons._cd.__flowlayout._jspService(flowlayout.jsp:30)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:646)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
         at com.bea.netuix.servlets.controls.JspRenderer.renderAlt(JspRenderer.java:194)
         at com.bea.netuix.servlets.controls.JspRenderer.beginRender(JspRenderer.java:96)
         at com.bea.netuix.nf.ControlLifecycle$1.visit(ControlLifecycle.java:491)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:543)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursiveRender(ControlTreeWalker.java:554)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:247)
         at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:204)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:153)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:324)
         at com.bea.netuix.servlets.manager.UIServlet.processControlTree(UIServlet.java:220)
         at com.bea.netuix.servlets.manager.PortalServlet.doPost(PortalServlet.java:820)
         at com.bea.netuix.servlets.manager.PortalServlet.doGet(PortalServlet.java:671)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:147)
         at com.cd.servlets.portal.MainPortalServlet.service(MainPortalServlet.java:116)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    "ExecuteThread: '18' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x0090cec0 nid=0x39 runnable [0x602fd000..0x602ffc28]
         at java.util.LinkedHashMap.transfer(LinkedHashMap.java:224)
         at java.util.HashMap.resize(HashMap.java:452)
         at java.util.LinkedHashMap.addEntry(LinkedHashMap.java:399)
         at java.util.HashMap.put(HashMap.java:392)
         at com.bea.wlw.netui.script.el.util.ParseUtils.parse(ParseUtils.java:100)
         - locked <0x8d3a3f18> (a com.bea.wlw.netui.script.el.util.ParseUtils$Cache)
         at com.bea.wlw.netui.script.el.ExpressionEvaluatorImpl.containsExpression(ExpressionEvaluatorImpl.java:239)
         at com.bea.wlw.netui.pageflow.ProcessPopulate.populate(ProcessPopulate.java:295)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processPopulate(PageFlowRequestProcessor.java:402)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:691)
         at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:527)
         at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:152)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at com.bea.wlw.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1786)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:561)
         at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:121)
         at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:98)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:154)
         at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:113)
         at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:228)
         at com.bea.netuix.nf.ControlLifecycle$3.visit(ControlLifecycle.java:171)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:356)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:366)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:126)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:105)
         at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:173)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:137)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:324)
         at com.bea.netuix.servlets.manager.UIServlet.processControlTree(UIServlet.java:220)
         at com.bea.netuix.servlets.manager.PortalServlet.doPost(PortalServlet.java:820)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:150)
         at com.cd.servlets.portal.MainPortalServlet.service(MainPortalServlet.java:96)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

    Hi user9503787,
    Can you please confirm if the Weblogic instance / java process you took the Thread Dump from was showing high CPU utilization?
    Your Thread Dump data is quite interesting and a perfect example of a non Thread safe HashMap combined with a read/write race condition:
    Thread #23 (hanging for 600 seconds+) is showing a potential infinite looping condition in at java.util.HashMap.getEntry(HashMap.java:361)
    Thread #22 (hanging for 600 seconds+) is showing a potential infinite looping condition while performing a resize() following a put() operation
    Weblogic Portal has some known issues which regards to usage of non Thread safe HashHap data structures; which under load can cause infinite looping and sharp surge of CPU (due to corruption of the internal HashMap index preventing exiting the internal loop); ultimately hanging the whole JVM.
    We had the same issue for one of our Weblogic Portal 10.0 production environment and Oracle provided a patch (via Collections.synchronizedMap() ).
    Please open a SR and Oracle, share these 2 Threads and discuss with the engineer about a patch / know issues regarding non Thread safe HashMap and infinite looping.
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • JAXB 2.0, XMLAdaptor and HashMap for customized mapping

    I have a requirement to implement a custom mapping of HashMap in JAXB. Basically I want to be able to use a HashMap structure to represent key/value pairs instead of the default List. So I need to be able to store (marshal) a HashMap structure into XML, and then be able to read (unmarshal) the XML back into a HashMap.
    I've discovered the XMLAdaptor class and I think this is the way to do it:
    https://jaxb.dev.java.net/nonav/jaxb20-pr/api/javax/xml/bind/annotation/adapters/XmlAdapter.html
    However, my knowledge of generics and annotations in 5.0, and XML schemas are somewhat elementary - so I'm a bit stuck.
    If someone has a complete working example of the HashMap example they show in the API doc linked above, I would greatly appreciate it if you could post it here.
    Otherwise, perhaps you could answer a couple of questions for me.
    1) I tried using the XSD directly from the example in the API doc (Step 2).
         <xs:complexType name="myHashMapType">
           <xs:sequence>
             <xs:element name="entry" type="myHashMapEntryType"
                            maxOccurs="unbounded"/>
           </xs:sequence>
         </xs:complexType>
         <xs:complexType name="myHashMapEntryType">
           <xs:simpleContent>
             <xs:extension base="xs:string"/>
           </xs:simpleContent>
           <xs:attribute name="key" type="xs:int"/>
         </xs:complexType>xjc complains when I generate the classes and says that the 'xs:attribute name=key' shouldn't be there. If I move it up into the 'xs:extension' node it works. But then I get strange XML when I create some key/value pairs and marshal them. The first XML node looks okay, but the rest of the List items start with '<xsi:entry ...', e.g.
    <entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="myHashMapEntryType" key="key0">value0</entry>
    <xsi:entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="myHashMapEntryType" key="key1">value1</xsi:entry>
    ...So my first question is, what is the proper XSD to represent a HashMap with XML like the following:
         <hashmap>
             <entry key="id123">this is a value</entry>
             <entry key="id312">this is another value</entry>
          </hashmap>2) Now for the HashMap part of it; you need to create a class that extends XmlAdaptor<HashMap, MyHashMapType> with marshal and unmarshal methods. This is where I get a little fuzzy on exactly what these methods need to do. The example in the API doc doesn't show this.
    3) And finally; once I have all this in place, how do I actually marshal and unmarshal, presumably using the value types that I created instead of the value types that were auto generated by xjc? At least I think that's what I'm supposed to do.
    Thanks.

    Download the javaeetutorial5
    Under this path is a working example.
    \examples\jaxb\j2s-xmlAdapter-field
    I've tried following the bad example you sited, and even with a great deal of work it still fails to work.
    I think the example will help clarify how marshall and unmarshall methods are to be implemented. What would be really nice is for whoever wrote the example you sited to finish the job instead of expecting the reader of their documentation to figure it out.
    I fail to understand why JaxB has failed to directly support a collection so prevalent in its use as a HashMap. I also don�t know why they can�t support a Map interface that by default maps to a HashMap.
    Best of luck to you,
    Robert

  • STUCK thread equals elevated CPU

    Agile PLM 9.3.0.1
    Weblogic 10.0
    Solaris 10
    Recently installed Agile 9301 in production. Three times in the week since go-live CPU has elevated up to 100% (twice on one managed host, once on the other), forcing me to kill Agile on that managed host and restart. We sure did not see anything like this on the development environment.
    * I'd like to know why this is happening.
    * Obviously I'd like to make it stop.
    * If I can't do that I can take steps to make the problem less deadly to the system.
    Installed VisualVM to look inside the JVM. I've got a STUCK thread that seems to be elevating the CPU past 25% (baseline appears to be around 10%). Now I have more data to confuse myself with. Here are the snipped bits relating to this thread from the thread dump.
    * Does this mean anything to anyone?
    * Any advice on how to track down a problem like this?
    Thread Dump snip with the STUCK threads
    "[STUCK] ExecuteThread: '14' for queue: 'weblogic.kernel.Default (self-tuning)'" - Thread t@101
    java.lang.Thread.State: RUNNABLE
    at java.util.HashMap.get(HashMap.java:303)
    at com.agile.ui.web.action.ClientSession.getAttribute(ClientSession.java:154)
    at com.agile.ui.web.action.ActionContext.getAttribute(ActionContext.java:385)
    at com.agile.ui.pcm.common.model.AbstractDataModel.saveContext(AbstractDataModel.java:1701)
    at com.agile.ui.pcm.common.CMBaseModuleHandler.removeAll(CMBaseModuleHandler.java:153)
    at com.agile.ui.pcm.common.CMBaseModuleHandler.tabContextChanged(CMBaseModuleHandler.java:136)
    at com.agile.ui.web.action.ActionServlet.raiseRequestEvents(ActionServlet.java:1240)
    at com.agile.ui.web.action.ActionServlet.handleRequest(ActionServlet.java:658)
    at com.agile.ui.web.action.ActionServlet.doPost(ActionServlet.java:309)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.pcm.common.filter.RemoteFSRequestFilter.doFilter(RemoteFSRequestFilter.java:148)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.web.filter.LoggingFilter.doFilter(LoggingFilter.java:108)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.pcm.common.filter.WebClientLog.doFilter(WebClientLog.java:78)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.jspbook.GZIPFilter.doFilter(GZIPFilter.java:21)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.pcm.common.filter.SSOTicketFilter.doFilter(SSOTicketFilter.java:84)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Locked ownable synchronizers:
    - None
    "[STUCK] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" - Thread t@14
    java.lang.Thread.State: RUNNABLE
    at java.util.HashMap.get(HashMap.java:303)
    at com.agile.ui.web.action.ClientSession.getAttribute(ClientSession.java:154)
    at com.agile.ui.web.action.ActionContext.getAttribute(ActionContext.java:385)
    at com.agile.ui.pcm.common.ObjectViewHandler.setGridPage(ObjectViewHandler.java:20617)
    at sun.reflect.GeneratedMethodAccessor231.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.agile.ui.web.action.ActionServlet.invokeMethod(ActionServlet.java:1062)
    at com.agile.ui.web.action.ActionServlet.handleRequest(ActionServlet.java:667)
    at com.agile.ui.web.action.ActionServlet.doPost(ActionServlet.java:309)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.pcm.common.filter.RemoteFSRequestFilter.doFilter(RemoteFSRequestFilter.java:148)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.web.filter.LoggingFilter.doFilter(LoggingFilter.java:108)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.pcm.common.filter.WebClientLog.doFilter(WebClientLog.java:78)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.jspbook.GZIPFilter.doFilter(GZIPFilter.java:21)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.agile.ui.pcm.common.filter.SSOTicketFilter.doFilter(SSOTicketFilter.java:84)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Locked ownable synchronizers:
    - None

    Did you take multiple thread dumps to see if the thread is always in the same place? It seems that a "Runnable" thread is making progress and not blocked on any locks.
    There is additional troubleshooting steps at support.oracle.com with a document called Oracle WebLogic Server Core Server / JVM / Memory Issues Support Patterns - Unexpected High CPU Usage with WLS
    Document ID 874292.1 in the Knowledge Base
    The article is a bit old, but the approach should still be sound. I'm not sure if VisualVM gives you CPU by thread or not, but I know it has a profiler.

  • Node server0 stuck on starting framework exitcode = -11113

    Hello experts, <br><br>
    After installation, i'm able to start the SAP Server via mmc, the ABAP part is up and running, but my Java stack stucks on starting framework.<br><br>
    Bellow, the "tail" of my developer trace<br><br>
    612       com.microsoft.sqlserver.jdbc.Parameter$GetTypeDefinitionOp::setTypeDefinition (833 bytes)
    613       com.microsoft.sqlserver.jdbc.DTV$SendByRPCOp::<init> (50 bytes)
    614       java.lang.Math::min (12 bytes)
    615  !    com.sap.engine.services.deploy.server.DeployServiceImpl::getApplicationInfo (2773 bytes)
    616       com.microsoft.sqlserver.jdbc.SQLServerStatement::getNextResult (155 bytes)
    617       com.sap.engine.lib.xml.parser.handlers.NamespaceEntry::levelDown (98 bytes)
    618 s     com.sap.engine.lib.util.cache.Cache::getByKey (145 bytes)<br><br>
    Tue Apr 19 16:37:34 2011<br><br>
    619       com.microsoft.sqlserver.jdbc.SQLServerResultSet::close (105 bytes)
    620       java.io.ObjectInputStream$HandleTable::markDependency (171 bytes)
    621  !    com.sap.engine.lib.xml.parser.XMLParser::scanEndTag (638 bytes)
    622       java.lang.ref.ReferenceQueue::reallyPoll (58 bytes)
    623       java.io.ObjectInputStream::checkResolve (48 bytes)
    624       com.sap.sql.jdbc.basic.BasicResultSet::getString (11 bytes)
    625       com.sap.engine.core.configuration.impl.cache.ConfigurationCache::releaseConfiguration (112 bytes)
    626       com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement::buildServerCursorExecParams (202 bytes)
    627       com.sap.tc.logging.LogController::<init> (206 bytes)
    628       com.sap.engine.lib.xml.parser.handlers.NamespaceHandler::levelUp (44 bytes)
    629       com.sap.engine.services.deploy.ReferenceObject::encode (294 bytes)
    630       com.microsoft.sqlserver.jdbc.TDSReader::readLong (56 bytes)
    631       com.microsoft.sqlserver.jdbc.SQLServerStatement$1NextResult::onRetStatus (28 bytes)
    632       com.microsoft.sqlserver.jdbc.StreamDone::hasUpdateCount (1544 bytes)
    633       com.microsoft.sqlserver.jdbc.SQLServerStatement$1NextResult::onDone (213 bytes)
    634       java.lang.Math::max (11 bytes)
    635 s     com.sap.tc.logging.LogController::addLogNormalInt (139 bytes)
    636  !    com.sap.engine.core.configuration.impl.cache.AccessController::getAccess (156 bytes)
    637       com.sap.sql.jdbc.basic.BasicPreparedStatement::setInt (12 bytes)
    Tue Apr 19 16:37:35 2011
    638       com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer$FetchBufferTokenHandler::onDone (24 bytes)
    639       com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader::scanByte (17 bytes)
    640       com.sap.engine.lib.xml.dom.AttrImpl::<init> (66 bytes)
    641       com.microsoft.sqlserver.jdbc.TDSWriter::writeLong (211 bytes)
    642       com.sap.engine.core.configuration.impl.PersistentDataInputStream::read (29 bytes)
    643       com.sap.engine.lib.xml.parser.XMLParser::scanComment (377 bytes)
    644       com.sap.engine.lib.xml.dom.DOMDocHandler1::getChd (115 bytes)
    645       com.sap.engine.services.deploy.server.DUtils::getApplicationID (82 bytes)
    646       com.sap.engine.services.deploy.server.DUtils::replaceForbiddenSymbols (122 bytes)
    647       com.sap.engine.services.deploy.server.DeployServiceImpl::listApplications (53 bytes)
    648       com.sap.engine.services.deploy.server.ReferenceResolver::getApplicationForComponent (59 bytes)
    14.575: [GC 14.575: [ParNew: 181723K->20372K(245760K), 0.0281875 secs] 181723K->20372K(2015232K), 0.0282645 secs]
    649  !    java.lang.ref.Reference$ReferenceHandler::run (108 bytes)
    650       com.sap.engine.services.deploy.server.DUtils::getWord (84 bytes)
    651       com.sap.engine.services.deploy.server.DeployServiceImpl::addApplicationInfo (227 bytes)
    652       com.sap.engine.services.deploy.server.DUtils::isAlreadyAdded (45 bytes)
    653       java.util.StringTokenizer::nextToken (92 bytes)
    654       com.sap.engine.services.deploy.ReferenceObject::setCompositeName (269 bytes)
    Tue Apr 19 16:37:36 2011
    655  !    sun.security.provider.PolicyFile::getPermissions (250 bytes)
    656       com.sap.engine.core.classload.impl0.LoadContextImpl::dfsCycleDetection (74 bytes)
    657       java.util.ArrayList::RangeCheck (48 bytes)
    658 s     com.sap.engine.core.classload.impl0.LoadContextImpl::getReferences (23 bytes)
    37%      com.sap.engine.core.classload.impl0.LoadContextImpl::dfsCycleDetection @ 38 (74 bytes)
    659       java.util.ArrayList::get (12 bytes)
    660       java.util.ArrayList::remove (70 bytes)
    661       java.util.ArrayList::ensureCapacity (68 bytes)
    662       com.sap.engine.core.service630.container.LoadContextWrapper::checkName (54 bytes)
    663  !    com.sap.engine.services.deploy.server.DeployServiceImpl::initializeApplications (1194 bytes)
    664 s!    java.net.URLStreamHandler::getHostAddress (54 bytes)
    665       com.sap.engine.services.deploy.server.DeploymentInfo::getApplicationLoaderFiles (212 bytes)
    666  !    java.util.zip.Inflater::reset (52 bytes)
    667 s     java.util.Vector::remove (82 bytes)
    668 s!    com.sap.engine.services.log_configurator.admin.LogConfigurator::adjustConfiguration (4223 bytes)
    669  !    sun.nio.cs.SingleByteEncoder::encodeArrayLoop (356 bytes)
    670*      java.lang.System::currentTimeMillis (0 bytes)
    38% !    sun.security.provider.SeedGenerator$ThreadedSeedGenerator::run @ 114 (243 bytes)
    671       com.sap.engine.lib.xml.dom.DocumentImpl::updateDTDForAllElements0 (67 bytes)
    672       com.sap.engine.lib.xml.dom.ElementImpl::setAttributeNodeNS (187 bytes)
    673       java.util.LinkedList$ListItr::hasNext (20 bytes)
    Tue Apr 19 16:37:37 2011
    16.325: [GC 16.325: [ParNew: 184212K->21281K(245760K), 0.0204138 secs] 184212K->21281K(2015232K), 0.0204826 secs]
    674  !    java.util.zip.Inflater::inflate (74 bytes)
    675       sun.misc.URLClassPath$JarLoader::getResource (48 bytes)
    676       java.io.ObjectOutputStream$BlockDataOutputStream::getUTFLength (124 bytes)
    677       java.io.ObjectOutputStream$BlockDataOutputStream::writeBytes (144 bytes)
    678       sun.misc.SoftCache::processQueue (47 bytes)
    679       java.io.ObjectStreamClass::writeNonProxy (148 bytes)
    680*      java.lang.System::identityHashCode (0 bytes)
    681       java.io.ObjectOutputStream$HandleTable::lookup (56 bytes)
    682       java.io.ObjectOutputStream::clear (15 bytes)
    683       com.sap.engine.lib.util.HashMapObjectObject::contains (60 bytes)
    684       java.io.ObjectOutputStream::writeSerialData (135 bytes)
    685  !    java.io.ObjectOutputStream::writeObject0 (551 bytes)
    686       javax.naming.NameImpl::stringifyComp (604 bytes)
    687       java.io.ObjectOutputStream$HandleTable::insert (39 bytes)
    688       javax.naming.NameImpl::equals (126 bytes)
    689 s     java.util.Vector::elementAt (49 bytes)
    690*      java.security.AccessController::doPrivileged (0 bytes)
    691       java.io.ObjectOutputStream$BlockDataOutputStream::writeShort (47 bytes)
    39%      java.security.Security::getProviderProperty @ 15 (60 bytes)
    692       java.lang.String::charAt (33 bytes)
    693       java.io.ObjectOutputStream$BlockDataOutputStream::writeUTF (46 bytes)
    694       java.util.Vector$1::hasMoreElements (20 bytes)
    695       com.sap.engine.frame.core.load.res.JarsResource::getClassInfo (43 bytes)
    696       com.sap.engine.boot.FrameClassLoader::loadClass (7 bytes)
    40%      com.sap.tc.logging.LogController$Regarders::put @ 54 (104 bytes)
    697 s!    java.security.Security::reloadProviders (144 bytes)
    41%      javax.crypto.SunJCE_b::a @ 17 (55 bytes)
    698       com.sap.engine.lib.xml.parser.XMLParser::<init> (403 bytes)
    42%      iaik.utils.Base64InputStream::read @ 134 (360 bytes)
    699       javax.crypto.SunJCE_b::a (55 bytes)
    43%      iaik.utils.Base64InputStream::read @ 18 (360 bytes)
    700       iaik.security.cipher.j::a (643 bytes)
    44%      iaik.utils.Base64InputStream::read @ 55 (360 bytes)
    701       iaik.utils.Base64InputStream::read (360 bytes)
    702  !    com.sap.engine.lib.xml.parser.URLLoaderBase::pop (58 bytes)
    703       com.sap.engine.lib.xml.parser.helpers.AdvancedXMLStreamReader::getLastChar (6 bytes)
    704  !    javax.crypto.SunJCE_b::c (271 bytes)
    705       iaik.utils.CryptoUtils::squashBytesToInts (84 bytes)
    706       com.sap.engine.services.dbpool.deploy.XMLUtils::processAliasesXML (377 bytes)
    707       sun.reflect.AccessorGenerator::emitBoxingContantPoolEntries (1417 bytes)
    708       java.security.Security::getEngineClassName (216 bytes)
    45%      java.util.Arrays::fill @ 10 (28 bytes)
    709       java.io.ObjectOutputStream$HandleTable::<init> (45 bytes)
    710       java.text.MessageFormat::applyPattern (360 bytes)
    711       com.sap.engine.core.classload.impl0.LoaderInfo::getReferencesTo (83 bytes)
    712       com.sap.engine.core.configuration.impl.persistence.rdbms.DBAccessDefault::switchType (212 bytes)
    713       com.sap.engine.core.configuration.impl.ValueEntry::<init> (40 bytes)
    714       com.sap.engine.boot.ControlledCryptographyProvider::useProvider (50 bytes)
    Tue Apr 19 16:37:38 2011
    715       com.sap.tc.logging.LogController$Regarders::put (104 bytes)
    46%      com.sap.sql.sqlparser.SQLLexer::yy_unpack_cmap @ 32 (57 bytes)
    716       sun.text.resources.DateFormatZoneData::handleGetObject (92 bytes)
    717 s     java.security.Security::insertProviderAt (92 bytes)
    718       com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement::doExecutePreparedStatement (207 bytes)
    719       com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer::<init> (42 bytes)
    720       com.microsoft.sqlserver.jdbc.SQLServerConnection::setMaxFieldSize (49 bytes)
    721       com.microsoft.sqlserver.jdbc.SQLServerConnection::setMaxRows (39 bytes)
    722       com.sap.sql.jdbc.mss.MssInetJdbcObjectFactory::createResultSet (11 bytes)
    723       com.sap.sql.jdbc.basic.BasicResultSet::close (10 bytes)
    724       com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement::buildPreparedStrings (87 bytes)
    725       com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd::doExecute (10 bytes)
    726  !    com.sap.engine.core.configuration.impl.utilities.ConfigurationPath::getConfigurationPathInternal (154 bytes)
    727       com.microsoft.sqlserver.jdbc.TDSTokenHandler::onRetStatus (13 bytes)
    728  !    java.io.ObjectOutputStream::writeObject0 (551 bytes)
    729  !    com.sap.engine.services.jndi.implclient.ClientContext::checkOperation (140 bytes)
    730 s     java.io.ByteArrayOutputStream::write (117 bytes)
    731       com.sap.engine.lib.xml.parser.helpers.CharArray::trim (104 bytes)
    732       javax.naming.NameImpl::extractComp (761 bytes)
    733       java.io.ObjectOutputStream::writeOrdinaryObject (68 bytes)
    734       java.lang.Long::appendTo (47 bytes)
    Tue Apr 19 16:37:39 2011
    735       java.io.ObjectInputStream::readHandle (110 bytes)
    736  !    java.lang.StringCoding::encode (127 bytes)
    737       java.lang.String::<init> (52 bytes)
    738       com.sap.engine.core.configuration.impl.ConfigurationDataCacheAllImpl::existsValue (9 bytes)
    739       com.sap.engine.frame.core.load.res.JarsResource::getClassInfo (43 bytes)
    47%      sun.misc.URLClassPath::getResource @ 3 (38 bytes)
    740       com.sap.engine.lib.xml.parser.XMLParser::scanContent (197 bytes)
    741       com.sap.engine.frame.core.load.NegativeCache::contains (69 bytes)
    Tue Apr 19 16:37:40 2011
    742 s!    java.util.Hashtable::clone (99 bytes)
    743  !    java.util.zip.ZipFile$ZipFileInputStream::close (63 bytes)
    744 s     java.util.Vector::size (5 bytes)
    48% !    com.sap.engine.lib.xml.parser.readers.EncodedDataReader::readData @ 127 (175 bytes)
    745       sun.misc.URLClassPath::getResource (38 bytes)
    746  !    com.sap.engine.lib.xml.parser.readers.EncodedDataReader::readData (175 bytes)
    747  !    com.sap.engine.lib.xml.parser.XMLParser::scanAttList (644 bytes)
    748       com.sap.engine.lib.xml.dom.CharacterDataImpl::setParent (6 bytes)
    749       com.sap.engine.lib.xml.dom.NodeImpl::ensureChildren (61 bytes)
    750       com.sap.engine.lib.xml.dom.NodeImpl::checkChildNodeType (84 bytes)
    751       com.sap.security.core.role.imp.xml.XMLServiceAction::addPermission (100 bytes)
    752  !    com.sap.engine.lib.xml.dom.DOMDocHandler1::addAttribute (179 bytes)
    753       com.sap.engine.lib.xml.dom.ElementImpl::init (99 bytes)
    754       java.nio.ByteBuffer::<init> (45 bytes)
    755       com.sap.engine.lib.xml.dom.Base::getChildNodes (4 bytes)
    756       com.sap.engine.lib.xml.dom.NodeListImplEmpty::getLength (2 bytes)
    757       java.util.HashMap::put (113 bytes)
    758*      java.util.zip.Inflater::inflateBytes (0 bytes)
    759  !    java.util.zip.InflaterInputStream::read (127 bytes)
    Tue Apr 19 16:37:49 2011
    760  !    com.sap.engine.frame.core.load.ResourceLoader::loadClass (171 bytes)
    761       sun.misc.URLClassPath$JarLoader::getResource (48 bytes)
    762  !    java.io.ObjectStreamClass::lookup (236 bytes)
    763       com.sap.engine.services.jndi.implclient.Schema::init (85 bytes)
    764       java.io.ObjectOutputStream$HandleTable::assign (52 bytes)
    765  !    com.sap.engine.lib.xml.parser.XMLParser::scanAttList (644 bytes)
    766       com.sap.engine.lib.xml.dom.AttrImpl::getNodeType (2 bytes)
    767       com.sap.engine.lib.xml.dom.Base::getParentNode (2 bytes)
    768       com.sap.engine.lib.xml.dom.DOMDocHandler1::startElementStart (95 bytes)
    769       com.sap.engine.lib.xml.parser.helpers.DefaultAttributesHandler::clearDefaultCheck (43 bytes)
    Tue Apr 19 16:37:50 2011
    770       com.sap.engine.lib.xml.parser.helpers.CharArray::set (47 bytes)
    771       com.sap.sql.sqlparser.SQLKeywords::hash (169 bytes)
    772       iaik.security.md.Md5::engineReset (59 bytes)
    773  !    com.sap.sql.jdbc.direct.DirectPreparedStatement::setLong (196 bytes)
    774*      java.lang.reflect.Array::newArray (0 bytes)
    775       iaik.security.md.SHA::engineReset (67 bytes)
    49%      com.sap.tc.logging.ListFormatter::escape @ 31 (153 bytes)
    776       java.lang.StackTraceElement::toString (140 bytes)
    777       com.sap.tc.logging.ListFormatter::escape (153 bytes)
    778  !    com.sap.engine.core.classload.impl0.LoaderInfo::loadClassByReference (57 bytes)
    779  !    java.net.URL::<init> (531 bytes)<br><br>
    [Thr 6788] JLaunchIExitJava: exit hook is called (rc = -11113)<br>
    [Thr 6788] **********************************************************************<br>
    ERROR => The Java VM terminated with a non-zero exit code.<br>
    Please see SAP Note 943602 , section 'J2EE Engine exit codes'<br>
    for additional information and trouble shooting.<br>
    **********************************************************************<br>
    [Thr 6788] JLaunchCloseProgram: good bye (exitcode = -11113)<br>
    <br><br>
    Could anybody help? I have already checked the note mentioned above, but got no sucess.
    Edited by: egamer on Apr 19, 2011 9:52 PM

    I have also found this at my std.server0.out:
    Core service security failed. J2EE Engine cannot be started.
    com.sap.engine.services.security.exceptions.SecurityServiceException: Unexpected exception:
         at com.sap.engine.services.security.SecurityServerFrame.start(SecurityServerFrame.java:194)
         at com.sap.engine.core.service630.container.ServiceRunner.startApplicationServiceFrame(ServiceRunner.java:214)
         at com.sap.engine.core.service630.container.ServiceRunner.run(ServiceRunner.java:144)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:83)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:156)
    Caused by: com.sap.engine.services.security.exceptions.BaseSecurityException: No active userstore is set.
         at com.sap.engine.services.security.server.UserStoreFactoryImpl.getActiveUserStore(UserStoreFactoryImpl.java:80)
         at com.sap.engine.services.security.server.jaas.LoginModuleHelperImpl.update(LoginModuleHelperImpl.java:405)
         at com.sap.engine.services.security.server.jaas.LoginModuleHelperImpl.<init>(LoginModuleHelperImpl.java:84)
         at com.sap.engine.services.security.server.SecurityContextImpl.<init>(SecurityContextImpl.java:58)
         at com.sap.engine.services.security.SecurityServerFrame.start(SecurityServerFrame.java:147)
         ... 5 more
    com.sap.engine.services.security.exceptions.SecurityServiceException: Unexpected exception:
         at com.sap.engine.services.security.SecurityServerFrame.start(SecurityServerFrame.java:194)
         at com.sap.engine.core.service630.container.ServiceRunner.startApplicationServiceFrame(ServiceRunner.java:214)
         at com.sap.engine.core.service630.container.ServiceRunner.run(ServiceRunner.java:144)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:83)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:156)
    Caused by: com.sap.engine.services.security.exceptions.BaseSecurityException: No active userstore is set.
         at com.sap.engine.services.security.server.UserStoreFactoryImpl.getActiveUserStore(UserStoreFactoryImpl.java:80)
         at com.sap.engine.services.security.server.jaas.LoginModuleHelperImpl.update(LoginModuleHelperImpl.java:405)
         at com.sap.engine.services.security.server.jaas.LoginModuleHelperImpl.<init>(LoginModuleHelperImpl.java:84)
         at com.sap.engine.services.security.server.SecurityContextImpl.<init>(SecurityContextImpl.java:58)
         at com.sap.engine.services.security.SecurityServerFrame.start(SecurityServerFrame.java:147)
         ... 5 more
    [Framework -> criticalShutdown] Core service security failed. J2EE Engine cannot be started.
    Apr 19, 2011 4:39:32 PM             com.sap.engine.core.Framework [SAPEngine_System_Thread[impl:5]_27] Fatal: Critical shutdown was invoked. Reason is: Core service security failed. J2EE Engine cannot be started.
    781  !    java.util.zip.ZipFile$ZipFileInputStream::close (63 bytes)

  • HashMap or Treemap Help needed

    Hi all.
    I have posted some code up in java programming but so far the returns i have been given are to comlicated for me to understand. I am only a novice at java, and i have been given an assignment which involves connecting multiple clients to a server. This part of the assignment has been completed with no hassles. The part I am stuck at is I need to create a list of online users everytime a client logs on. The problem is i create a new thread which gets handled in anotherclass from my server Class called SocketHandler. Because each time a client logs on a new instance of socketHandler is created for that client, i can't establish a proper list of online users.
    Now i have been told that I can achieve what i am after by using a hashmap or treemap, but what some ppl have posted back if far to complex for me.
    I have posted my code below for an example of what i am after.
    Hopefully someone can help.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Server/
         Socket socket = null;
         ServerSocket serverSocket = null;
         public static void main(String args[])
              Server server = new Server();
              server.createSocket();
         public void createSocket()
              try
                   serverSocket = new ServerSocket(10000);
                   System.out.println("Waiting for client connections...");
                   System.out.println("");
              catch(IOException e)
                   System.out.println("Port in use... Exiting");
                   System.exit(0);
              while(true)
                   try
                        socket = serverSocket.accept();
                        System.out.println("New connection accepted " + socket.getInetAddress() + ":" + socket.getPort());
                        System.out.println("waiting...");
                        System.out.println();
                        list.add(socket.getInetAddress() + ":" + socket.getPort());
                        System.out.println(list);
                   catch(IOException e)
                        System.out.println(e.getMessage());
                   Thread thread = new Thread(new SocketHandler(socket));
                   thread.start();
    class SocketHandler extends Server implements Runnable
         int count = 0, attempt = 0;
         BufferedReader reader, auth;
         PrintWriter writer;
         Socket incoming = null;
         SocketHandler(Socket socket)
              this.incoming = socket;
         public void run()
              try
    }

    Now i have been told that I can achieve what i am
    after by using a hashmap or treemap, but what some
    ppl have posted back if far to complex for me.Then you should ask those people to explain it differently.
    Start here.
    http://java.sun.com/docs/books/tutorial/collections/

  • Sending an XML file to a hashmap, using one of the elements as a key?

    I am looking for a way to read an XML file to a hashmap.
    So far I have learned to use javax.xml.parsers.*; tools to read the XML file
    and I can send different elements of the XML file to the screen all day.
    here is some snippets of what I'm doing now:
    public class GLDefaultLoader {
      protected String xmlFileName = "gl.xml";
      private Document loadXML(String filename) throws Exception {
        filename= "gl.xml";
        Document doc = null;
        try {
          DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
          DocumentBuilder db = dbf.newDocumentBuilder();
          db.setErrorHandler(new com.abcsinc.fwk.dom.MySaxErrorHandler());
           doc = db.parse(new File("gl.xml").getAbsolutePath());
        } // after this we do variuos catches
    // here Im getting started on my hashmap
    private HashMap buildGLDefaultsItems(Document doc) throws IOException,
          ParserConfigurationException,
          SAXException {
        HashMap hashMap = new HashMap();
        doc.getDocumentElement().normalize();
        System.out.println("Root element of the doc is " + doc.getDocumentElement().getNodeName());
        NodeList listOfQueries = doc.getElementsByTagName("glDefaultsItem");
        int totalQueries = listOfQueries.getLength();
        System.out.println("Total number of Queries : " + totalQueries);----------------------------------------
    I think I'm going In the right direction but I'm kinda stuck, wallowing in ignorance maybe, lol

    front

  • Java.util.HashMap cannot be cast to org.apache.struts.action.ActionForm

    Hi!
    anybody could help me?
    i am getting java.util.HashMap cannot be cast to org.apache.struts.action.ActionForm error when I run my jsp...
    heres my code :
    CommentAction.java
    package com.provintl.rmis.actions;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Map;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.sql.DataSource;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.provintl.rmis.forms.CommentForm;
    public class CommentAction extends Action {
         Statement stmt = null;
         Connection con = null;
         javax.sql.DataSource dataSource;
         PreparedStatement ps = null;
         ResultSet rs=null;
         byte updFlg = 0;
         Map commentlist = new HashMap();
         /* (non-Javadoc)
         * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         @Override
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
         throws Exception {
              CommentForm commentForm = new CommentForm();
              Date date = commentForm.getDaterecord();
              String comment = commentForm.getComment();
              //TODO : temporary 1 == rose
              int userID =1;
              int appID =1;
              String SelectQry = "SELECT "+
                                       "APPLICANT_TBL.CHFNAME, "+
                                       "APPLICANT_TBL.CHLNAME, "+
                                       "APPLICANT_TBL.INTAPPID, "+
                                       "USERHST_TBL.CHCOMMENT, "+
                                       "USERHST_TBL.DTDATECREATED, "+
                                       " USERHST_TBL.INTHSTID "+
                                       "FROM "+
                                       "APPLICANT_TBL "+
                                       "INNER JOIN USERHST_TBL ON (APPLICANT_TBL.INTAPPID = USERHST_TBL.INTAPPID) " +
                                       "WHERE APPLICANT_TBL.CHFNAME ='"+request.getParameter("first")+"' " +
                                                 "AND APPLICANT_TBL.CHLNAME ='"+request.getParameter("last")+"'";
              try {
                   dataSource = (DataSource)getDataSource(request, "RMIS");
                   con = dataSource.getConnection();
                   con.setAutoCommit(false);
                   stmt = con.createStatement();
                   System.out.println("database connected");
                   rs = stmt.executeQuery(SelectQry);
                   System.out.println("database connected");
                   int ctr = 1;
                   while(rs.next()){
                        commentlist.put(ctr,new CommentForm(rs.getString("CHFNAME"),rs.getDate("DTDATECREATED")));
                        ctr++;
                   if(updFlg !=0){
                        String insQry = "INSERT INTO RECRUIT.USERHST_TBL (CHCOMMENT, INTUSERID, INTAPPID)" +
                        "VALUES ('"+comment+"',"+userID+","+appID+")";
                        stmt.executeUpdate(insQry);
                        con.commit();
                        updFlg = 0;
                   HttpSession session = request.getSession();
                   session.setAttribute("commentlist", commentlist);
                   //con.setAutoCommit(true);
              } catch (SQLException se) {
                   System.out.println("We got an exception while preparing a statement:" +
                   "Probably bad SQL.");
                   System.out.println(SelectQry);
                   se.printStackTrace();
                   //System.exit(1);
              finally {
                   try {
                        rs.close();
                        stmt.close();
                        con.close();
                   } catch (SQLException e) {
                        e.printStackTrace();
              return mapping.findForward("comment");
    commentform.jsp
    =============
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html"     prefix="html"%>
    <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
    <%@ taglib uri="http://java.sun.com/jstl/sql_rt" prefix="sql"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <script>
    function putLabel(lbl, formName){
    if (opener && !opener.closed){
    opener.document.addapp.jobposition.value=lbl;
    window.close();
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>List of open positions</title>
    </head>
    <body>
    <h2>Job Positions Available</h2>
    <%
    int ctr = 1; %>
    <logic:iterate id="myString" name="commentlist" scope="session">
    <table width="100%" border="0">
    <%
    String bakcolor;
    if((ctr % 2) == 0){
         bakcolor = "WHITE";
         ctr++;
    else{
         bakcolor = "SILVER";
         ctr++;
    %>
    <tr><td bgcolor="<%= bakcolor %>">
    <bean:write name="myString" property="value" />
    </td></tr>
    ${commentlist}
    </table>
    </logic:iterate>
    </body>
    </html>
    thank you in advance!

    Shilnag wrote:
    Hello guys,
    I am new to java... I am trying to develop a web application using
    1.Struts1.2
    2.tomcat 5.5
    3.eclipse 3.2.2Big mistake. Nobody new to Java should jump straight into webapps, let alone using a framework like Struts. Debatably, even Eclipse should be left alone.
    It's precisely because of this that you're having problems. Presumably you're following a tutorial or something, but - as demonstrated - as soon as it goes wrong, you're stuck. Learn some core Java first, trust me

  • HashMap Meltdown!

    I have a text file with about 160,000 example sentences. Each sentence is formatted across two lines like so:
    A: sentence and translation
    B: words contained in the sentence
    I want to create a 'dictionary' of all the words contained in the sentences, and store the IDs of all the sentences they appear in.
    I decided to use two HashMaps: dictionary<word, IDs> and content<ID, sentence>. The problem is, after the 50,000th sentence or so the program slows down, and by the 100,000th it's practically crawling along. I've been playing around with the initialCapacity and loadFactor, but it hasn't made any difference at all (strangely).
    static HashMap<Integer, String> content = new HashMap<Integer, String>(400000, 0.5f);
    static HashMap<String, String> dictionary = new HashMap<String, String>(3300000, 0.3f);
    int count = 1;
    String value;
    String line;
    /* Begin reading file */
    while ( (line = in.readLine()) != null) {
    /* Process a words (B) line */
         if (count%2 == 0) {
         /* Get an array of the words and iterate them */
              String[] words = line.split(splitter);
              for (int ind=1; ind<words.length; ind++) {
                   /* Append sentence ID to existing entry */
                   if (dictionary.containsKey(words[ind])) {
                        value = dictionary.get(words[ind]);
                        value = value + "," + Integer.toString(count/2);
                        dictionary.put(words[ind], value);
                   /* Add new entry */
                   else if (words[ind].length() > 0) {
                        value = Integer.toString(count/2);
                        dictionary.put(words[ind], value);
         /* Process an example sentence (A) line */
         else {
              String[] example = line.split("A: |#ID=");
              content.put((count-1)/2+1, example[1]);
         count++;
    }I've tried everything I can think of, but I'm really stuck on this one. It's frustrating, because I only need to run it once before I serialize it. All I know is that if I remove the line
    value = dictionary.get(words[ind]);the whole thing finishes in a flash... If anybody can help me I'd be really grateful.

    There are a few things you can do to make this simpler and faster.
    You can;
    - reduce the number of duplicated operations.
    - Use a List as an ordered collection. Using a String as a collection like this is very inefficient. I bet its actually the real cause of your performance problem.
    - use a List for a numbered collection rather than a HashMap.
    - include the first word of each sentence (index 0). Its simpler and probably what you intended.
    try
    List<String> content = new ArrayList<String>(); // lines start at number 0. add 1 as required.
    Map<String, List<Integer>> dictionary = new HashMap<String, List<Integer>>();
    Pattern idPattern = Pattern.compile("A: |#ID=");
    Pattern splitterPattern = Pattern.compile(splitter);
    String line;
    /* Begin reading file */
    while ((line = in.readLine()) != null) {
        Integer count = content.size();
        /* Process an example sentence (A) line */
        String[] example = idPattern.split(line, 3);
        content.add(example[0]);
        if ((line = in.readLine()) == null) break;
        /* Process a words (B) line */
        /* Get an array of the words and iterate them */
        for (String word : splitterPattern.split(line)) {
            /* Append sentence ID to existing entry */
            List<Integer> value = dictionary.get(word);
            if (value == null)
                dictionary.put(word, value = new ArrayList<Integer>());
            value.add(count);
    }Edited by: Peter__Lawrey on 14-Oct-2009 08:06

  • OSB STUCK THREAD at LoadBalanceFailoverListener

    Hi,
    We get the following stuck threads on our OSB servers.
    Can someone help?
    Due to this, our servers are experiencing a huge resource crunch.
    "[STUCK] ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=3 tid=0x0000000110704800 nid=0x94 runnable [0xfffffffa1d0fc000]
    java.lang.Thread.State: RUNNABLE
    at java.util.HashMap.get(HashMap.java:303)
    at com.bea.wli.sb.service.ServiceStats.getOperationStats(ServiceStats.java:104)
    at com.bea.wli.sb.pipeline.MessageProcessor.startOperationalTimer(MessageProcessor.java:431)
    at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:93)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
    at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:375)
    at com.bea.wli.sb.transports.CoLocatedMessageContext$1.run(CoLocatedMessageContext.java:162)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.security.Security.runAs(Security.java:61)
    at com.bea.wli.sb.util.security.SecurityUtils.runAs(SecurityUtils.java:58)
    at com.bea.wli.sb.transports.CoLocatedMessageContext.send(CoLocatedMessageContext.java:157)
    at com.bea.wli.sb.transports.http.wls.HttpTransportProvider.sendMessageAsync(HttpTransportProvider.java:215)
    at sun.reflect.GeneratedMethodAccessor914.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
    at $Proxy123.sendMessageAsync(Unknown Source)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:558)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:426)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:670)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:585)
    at stages.routing.runtime.DynamicRouteRuntimeStep.processMessage(DynamicRouteRuntimeStep.java:161)
    at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
    at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
    at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
    at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
    at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:96)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
    at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:375)
    at com.bea.wli.sb.transports.jms.JmsInboundMDB.onMessage(JmsInboundMDB.java:132)
    at sun.reflect.GeneratedMethodAccessor915.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)

    What i have not understood is how disabling log tracing will prevent the STUCK thread?The stuck threads which you are seeing are because of a known bug in the tracing functionality. So if you will disable the tracing then you will not hit that bug and hence no stuck threads will appear. To use tracing, get a fix for this problem from Oracle Support by raising a SR with them.
    Regards,
    Anuj

Maybe you are looking for