Help need regarding Java Reflection

I need help in programming the following:
I have to generate a test Harness for OOP.This program that automatically tests
classes by instantiating them, selecting methods of these instantiated objects randomly or
using some criteria, invoking them, and using the returned values as input parameters to
invoke other methods. I have to use Java Reflection for this and methods must be of generic type!
For this
I have to generate a tree of functions(say 2 or 3).The functions could be say:int f(int){} and int g(int){}. or Int f(String), String g(float),Float h(int)..I have to create a tree of these function set and traverse them in BFS or DFS and generate combinations of these functions keeping some upper bound for the number of functions genrated(10) and size of combinations of functions(say 5).The output of one function should be the input to other function(so recursive).If any combination failed,then record(or throw exception).This all should be done using java reflection.The input can be provided though annotations or input file.This file can result in recording even the output for each function. I have tried using Junit for testing methods.My code with is following:I have two classes ClassUnderTestTests(which tests the methods of ClassUnderTest) and ClassUnderTest shown below
//Test Harness class
public class ClassUnderTestTests {
     Field[] fields;
     Method[] methods;
     Method minVal;
     Method maxVal;
     Method setVal1;
     Method setVal2;
     Method getVal1;
     Method getVal2;
     Class<?> cut;
     ClassUnderTest<Integer> obj1;
     ClassUnderTest<String> obj2;
     @Before public void setUp(){
          try {
               cut = Class.forName("com.the.ClassUnderTest");
          fields=cut.getDeclaredFields();
          methods=cut.getDeclaredMethods();
          print("Name of the CUT class >>"+ cut.getName());
          print("List of fields >>"+ getFieldNames(fields));
          print("List of Methods >>"+ getMethodNames(methods));
          //creating method objects for the methods declared in the class
          minVal=cut.getDeclaredMethod("minValue");
          minVal.setAccessible(true);
          maxVal=cut.getDeclaredMethod("maxValue");
          maxVal.setAccessible(true);
          setVal1=cut.getDeclaredMethod("setVal1", Comparable.class);
          setVal1.setAccessible(true);
          setVal2 = cut.getDeclaredMethod("setVal2", Comparable.class);
          setVal2.setAccessible(true);
          getVal1=cut.getDeclaredMethod("getVal1");
          getVal1.setAccessible(true);
          getVal2 = cut.getDeclaredMethod("getVal2");
          getVal2.setAccessible(true);
          } catch (ClassNotFoundException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
          } catch (Exception e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
     @Test public void cutIntegertest(){
          //instantiating the class using the argument constructor for Object 1
          Constructor<?> constr1;
          assertNotNull(cut);
          try {
               constr1 = cut.getDeclaredConstructor(Comparable.class,Comparable.class);
               obj1=(ClassUnderTest<Integer>)constr1.newInstance(Integer.valueOf(102),Integer.valueOf(20));
               assertNotNull(obj1);
               print("The object of CUT class instantiated with Integer Type");
               // invoking methods on Object1
          assertEquals(minVal.invoke(obj1),20);
          //Object x = minVal.invoke(obj1);
          print("tested successfully the min of two integers passed");
          assertEquals(maxVal.invoke(obj1),102);
          // maxVal.invoke(obj2);
          //print();
          print("tested successfully the max of two integer values" );
          } catch (Exception e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
@Test public void cutStringTest(){
     assertNotNull(cut);
     Constructor<?> constr2;
          try {
               constr2 = cut.getDeclaredConstructor(Comparable.class,Comparable.class);
               obj2=(ClassUnderTest<String>)constr2.newInstance(String.valueOf(obj1.maxValue().toString()),obj2.minValue().toString());
               //obj2=(ClassUnderTest<String>) cut.newInstance();
               assertNotNull(obj2);
               //assertNotNull("obj1 is not null",obj1);
               //print(obj1.maxValue().toString());
               print("Object 2 instantiated as String type ");
               print("setting values on object2 of type string from values of obj1 of type Integer by using toSting()");
               setVal1.invoke(obj2, obj1.maxValue().toString());
               setVal2.invoke(obj2, obj1.minValue().toString());//obj2.setVal2(obj1.minValue()
               assertEquals(getVal1.invoke(obj2),maxVal.invoke(obj1).toString());
               assertEquals(getVal2.invoke(obj2),minVal.invoke(obj1).toString());
               print("validating the Assert Equals set from object 1 after conversion to String");
               print("MinValue for Object2 when Integer treated as String>>> "+minVal.invoke(obj2));
               print("MaxValue for Object2 when Integer treated as String>>> "+maxVal.invoke(obj2));
          } catch (Exception e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
          //obj2.setVal1(obj1.maxValue()
     private static void print(String str){
          System.out.println(str);
     private String getMethodNames(Method[] methods) {
          StringBuffer sb= new StringBuffer();
          for(Method method: methods){
               sb.append(method.getName()+ " ");
          return sb.toString();
     private String getFieldNames(Field[] fields) {
          StringBuffer sb= new StringBuffer();
          for(Field field: fields){
               sb.append(field.getName()+ " ");
          return sb.toString();
//ClassUnderTest
public class ClassUnderTest <T extends Comparable<T>>{
     //Fields
     private T val1;
     private T val2;
     ClassUnderTest(){}
     public ClassUnderTest(T val1, T val2){
          this.val1=val1;
          this.val2=val2;
     * @return the val1
     public T getVal1() {
          return val1;
     * @param val1 the val1 to set
     public void setVal1(T val1) {
          this.val1 = val1;
     * @return the val2
     public T getVal2() {
          return val2;
     * @param val2 the val2 to set
     public void setVal2(T val2) {
          this.val2 = val2;
     public T maxValue(){
          T max=null;
          if(val1.compareTo(val2) >= 0){
               max= val1;
          }else {
               max= val2;
          return max;
     public T minValue(){
          T min=null;
          if(val1.compareTo(val2) < 0){
               min= val1;
          }else {
               min= val2;
          return min;
This code throws Null Pointer Exception if CutStringtest function(I think on calling obj1 in tht function) Please suggest!

Well, I can't help you specifically since I'm not into reflection too much, but here are some ideas:
* Either learn how to set breakpoints and single step through your code, or pepper your code with a lot more meaningful System.out.println() statements.
* Come up with simple test cases, pass them first, then progressively more complex test cases, until you test all possible situations. Try to get each test case to test only a single concept and not multiple concepts at the same time. If your code is broken on more than one concept, you will not be able to isolate each concept by itself to fix it without separating it.
* Consider refactoring your code so each sub-module accomplishes one task in isolation and verify that module can handle each possible situation that its asked to perform.
* The exception usually tells you what line in your code threw the exception. Look for a line in the exception printout that has the name of your package or class in it.

Similar Messages

  • Help needed with java

    Hello everyone
    I'm a Student and new to java and I have been given a question which I have to go through. I have come across a problem with one of the questions and am stuck, so I was wondering if you guys could help me out.
    here is my code so far:
    A Class that maintains Information about a book
    This might form part of a larger application such
    as a library system, for example.
    @author (your name)
    *@version (a version number or a date)*
    public class Book
    // instance variables or fields
    private String author;
    private String title;
    Set the author and title when the book object is constructed
    public Book(String bookAuthor, String bookTitle)
    author = bookAuthor;
    title = bookTitle;
    Return The name of the author.
    public String getAuthor()
    return author;
    Return The name of the title.
    public String getTitle()
    return title;
    and below are the questions that I need to complete. they just want me to add codes to my current one, but the problem is I don't know where to put them and how I should word them, if that makes sense.
    Add a further instance variable/field pages to the Book class to store the number of pages in the book.
    This should be of type int and should be set to 0 in the Constructor.
    Add a second Constructor with signature
    public Book(String bookAuthor, String bookTitle, int noPages) so it has a third parameter passed to it as well as the author and title;
    this parameter is used - obviously?? - to initialise the number of pages.
    Note: This is easiest done by making a copy of the existing Constructor and adding the parameter.
    Add a getPages() accessor method that returns the number of pages in the book.
    Add a method printDetails() to your Book class. This should print out the Author title and number of pages to the Terminal Window. It is your choice as to how the data is formatted, perhaps all on one line, perhaps on three, and with or without explanatory text. For instance you could print out in the format:
    Title: Robinson Crusoe, Author: Daniel Defoe, Pages:226
    Add a further instance variable/field refNumber() to your Book class. This stores the Library's reference number. It should be of type String and be initialised to the empty String "" in the constructor, as its initial value is not passed in as a parameter. Instead a public mutator method with the signature:
    public void setRefNumber(String ref) should be created. The body of this method should assign the value of the method parameter ref to the refNumber.
    Add a corresponding getRefNumber() accessor method to your class so you can check that the mutator works correctly
    Modify your printDetails() method to include printing the reference number of the book.
    However the method should print the reference number only if it has been set - that is the refNumber has a non-zero length.
    If it has not been set, print "ZZZ" instead.
    Hint Use a conditional statement whose test calls the length() method of the refNumber String and gives a result like:
    Title: Jane Eyre, Author: Charlotte Bronte, Pages:226, RefNo: CB479 or, if the reference number is not set:
    Title: Robinson Crusoe, Author: Daniel Defoe, Pages:347, RefNo: ZZZ
    Modify your setRefNumber() method so that it sets the refNumber field only if the parameter is a string of at least three characters. If it is less than three, then print an error message (which must contain the word error) and leave the field unchanged
    Add a further integer variable/field borrowed to the Book class, to keep a count of the number of times a book has been borrowed. It should (obviously??) be set to 0 in the constructor.
    Add a mutator method borrow() to the class. This should increment (add 1 to) the value of borrowed each time it is called.
    Include an accessor method getBorrowed() that returns the value of borrowed
    Modify Print Details so that it includes the value of the borrowed field along with some explanatory text
    PS. sorry it looks so messey

    1. In the future, please use a more meaningful subject. "Help needed with java" contains no information. The very fact that you're posting here tells us you need help with Java. The point of the subject is to give the forum an idea of what kind of problem you're having, so that individuals can decide if they're interested and qualified to help.
    2. You need to ask a specific question. If you have no idea where to start, then start here: [http://home.earthlink.net/~patricia_shanahan/beginner.html]
    3. When you post code, use code tags. Copy the code from the original source in your editor (NOT from an earlier post here, where it will already have lost all formatting), paste it in here, highlight it, and click the CODE button.

  • Help needed regarding the client server communication

    this is regarding my networking project which at present i am doing it in java...
    the project is abt establishing a server in my lab that controls all the other systems in that lab... now the problem is i have to shut down all the systems in the lab from the server on a click of a button.... this i need to do using socket programming to which i am new....
    So can anyone pls send me a sample code as to how to pass a command from server to shut shut down all the systems(clients) ..i need a java program that uses sockets concept to perform the above mentioned operation...pls note i am trying to establish a linux server
    regards
    lalita

    Dear hiwa
    i can use it but the constraint in my project is to use only the Socket programming due to time lacks.... i have to find a faster way to communicate between the server and the client...
    can u pls help me find a solution for this via sockets...
    hoping a favorable response
    regards
    Lalita

  • Help needed regarding the updation of "Relationships" in BP

    Hello Guys,
    This is to request you to kindly help me regarding the following.
    We have a scenario where all the employees assigned to an Organizational unit (in PPOMA_CRM) are not showing in the "Relationships" ("Has Employee")in the BP transaction of that Organizational Unit.
    Could anyone let me know whether there is any update program that updates the "Relationships" from the Organizational asssignment. Or we need to enter the employees manually in BP "Relationships". Please help. Thanks in anticipation.
    Regards,
    Kishore.

    Hi Amit,
    Thanks alot for your reply. Its really helpful for me.
    So,we usually enter these relationships manually only, right? Before going ahead with the custom program, could you please let me know whether there is any SAP note related to this.Once again thanks alot for you help.
    Regards,
    Kishore.

  • Help needed regarding Segment Qualifiers

    Hi,
    In my process of implementing Apps R12 afresh, we just created the segments and assigned them their flexfield qualifiers today. In that, the one assigned towards alancing segment shows the value qualifiers like that of natural accounting segment, unlike the bal. segment value qualifier.
    I mean, when we try to insert a a value in the bal.segment it asks for qualifiers such as nature:expense/revenue/liability/asset, instead of going for the allow posting and allow budgeting alone. This is crazy, and I need your support.
    Thanks,
    Mukunthan L

    Hi Amit,
    Thanks alot for your reply. Its really helpful for me.
    So,we usually enter these relationships manually only, right? Before going ahead with the custom program, could you please let me know whether there is any SAP note related to this.Once again thanks alot for you help.
    Regards,
    Kishore.

  • Help needed Regarding Project Server - 2013 Workflow

    Hi All,
    I am new to Project server 2013 Workflow, hence please help me regarding this. Pardon me if this question is too trivial. 
    I have created a project type associated with a workflow and my workflow is as follows :
    So I am not doing anything here, I am just testing the workflow as mentioned by technet site : http://technet.microsoft.com/en-us/library/dn458865(v=office.15).aspx
    But it is mentioned that, after a minute or 2, the workflow state will change, also they have mentioned to press the Submit button.
    But in my case, the workflow is not moving to next stage [It just says 'The workflow is still processing - which never changes after hours] or I am getting the submit button (Submit button is disabled on the ribbon). Below is the state of my workflow :
    PS : I have made the user added to Portfolio managers group as well. But still I am having this same issue. 
    The Workflow manager is installed properly, and it is working fine in case of List workflow. I am facing the issue only wrt Site workflow for Project server 2013.
    Please help me to solve this issue.
    Thanks,
    shanky

    Hi Kiran,
    I am now facing issue while assigning a task to a person in the workflow.
    I am having a person named say 'John' , who is included in Project Manager as well as Portfolio Manager.
    And I am using a workflow as :
    Stage : Conceptual
    Assign a task to John (Task outcome to Variable: Outcome5 | Task ID to Variable: TaskID3 )
    Transition to stage
    Go to Approval
    But this is again giving issue as :
    Workflow Internal status : Cancelled
    Details: System.ApplicationException: HTTP 401 {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have
    permission to perform this action or access this resource."}}}
    PS : I have used the same Sharepoint admin account for 'Account Name' in ‘User Profile Sync' , Is this causing the issue? Please let me know.
    Thanks,
    Shanky

  • Help needed regarding BADI.

    hi all,
    can anyone plz tell me how to define BADI and how create an interface.
    plz tell from everything regarding that, i have work with basic ABAP only.
    anykind of links and any kind of matter will be helpful and you will be rewarded with points for your help difinatly.
    regards.
    raman.

    Hi Raman,
    Please search the forum and you have lots and lots of links in it. For you to start with, try these links,
    The specified item was not found.
    BADI
    Best Regards.

  • Help needed regarding font sizes

    Iam generating pdf documents using oracle developer's report builder.
    When i generate and view those pdf's using the web previewer thay appear to be quite fine,whereas when i host them on ias the font sizes gets bigger, thus lot of text gets truncated.
    Is there any parameters that has to be set for it.Pls help

    Hi Amit,
    Thanks alot for your reply. Its really helpful for me.
    So,we usually enter these relationships manually only, right? Before going ahead with the custom program, could you please let me know whether there is any SAP note related to this.Once again thanks alot for you help.
    Regards,
    Kishore.

  • Help needed regarding replication in ds5.2sp4

    Hi ,
    I am new to ldap . I am able to establish replication between master and consumer and trying to update it is getting update but i am geting the following error
    in error log
    INFORMATION - NSMMReplicationPlugin - conn=-1 op=-1 msgId=-1 - Replication bind to consumer alpha.ad.com:19941 failed:
    [16/May/2007:13:48:26 -0700] - INFORMATION - NSMMReplicationPlugin - conn=-1 op=-1 msgId=-1 - Failed to connect to replication consumer alpha.ad.com:19941
    [16/May/2007:13:48:26 -0700] - ERROR<8318> - Repl. Transport - conn=-1 op=-1 msgId=-1 - [S] Bind failed with response: Failed to bind to remote (900).
    Please help me regarding this .
    Message was edited by:
    ap7926

    If data is getting replicated from master to consumer then the bind for that specific replication agreement is working.
    Check your timestamps and current log entries. Are the "Failed to connect to replication" messages currently being generated? As long as your replication agreement is enabled the supplier will try to keep things up and running, retrying a failed consumer regularly (and generating about 1 set of log messaages per minute on my systems). So you'll get those messages on the supplier when a good consumer is down (the nsslapd directory server process that is).
    If you don't have these messages being generated currently then this probably means that your consumer was down around "16/May/2007:13:48:26 -0700" but is ok now. In that case those messages aren't of big concern. They're just telling you that you had a problem, which you hopefully already knew about.
    If replication is working (test by making a change on the supplier and checking it on the consumer) AND you're still concurrently getting these messages regularly then you have something interesting going on, probably due to a configuration issue. Without seeing the details it's difficult say what it would be.

  • Help needed :- Regarding multi prompts usage in FF3.0* with java script

    Hey i used the java script given in link :- http://sranka.wordpress.com/2008/11/09/how-to-replace-multi-go-button-prompt-by-one/#comment-96
    to hide multi-go-button in prompts and it works for IE 7 and firefox 2.0* with 10.3.4.1.
    Now since 10.1.3.4.1 is certified with firefox 3.0* ,when i use this same script in firefox 3.0* for my prompts it doesn’t work .
    Any idea why ? Please help me with this,as i want to use this hide go button feature in firefox 3.0* too.
    Are these scripts browser to browser incompatible ? If yes from where can i get the script for firefox 3.0* ?
    Awaiting for the inputs.
    Thanks,
    Nisha

    Quadruple-posting your issue won't get it resolved quicker. Please stop that. If you feel your thread needs to be on top, bump it by adding a "Any input?" post to it or something. Ome would assume that forums are around long enough for this trick to be known.

  • Help needed Regarding a business logic

    Hi all,
    My business requirement is
    requires to get a checksum from the KIOSK field. This would be something like a rule that for a given KIOSK generates a number from 0 to 9.
    The Field value contains alphanumerical
    Can any of guys help me in this logic.how to generate a checksum for a given field..
    Thanks & Regards;
    Vinit

    Alright I found something  I am not  sure if it is of use to you , A checksum is generally used to  detect the integrity of file
    it is calculated oin basis of hash algorithms so  how it is useful to for incoming filed values i m not  sure
    Please find the links below
    http://en.wikipedia.org/wiki/Checksum
    http://www.fastsum.com/support/online-help/checksums.php
    http://www.flounder.com/checksum.htm
    http://www.mkyong.com/java/how-to-generate-a-file-checksum-value-in-java/
    If it is useful , you need to implement a hash algorithm
    regards
    Ninad

  • Help needed regarding a case study In Bpel

    Weblogic Server 10.3.3
    Soa Server 11.1.1.2.0
    Oracle JDeveloper 11.1.1.4.0
    Till now I have done the following things:
    1) created a JMS queue
    2)From a java program I can put messages and read messages from that queue
    What is my requirement?
    1) I want to put (produce) some JMS Messages in the queue from a BPEL process(Synchronous),
    Then I want to read (consume)only one of the above created JMS Messages in the main BPEL process(Synchronous/asynchronous), then needs to process it
    And based on my Business condition I have to write that message in the Database.
    After successful completion of this instance only my main process should go to consume the next message in the queue.
    Would anyone please help me in this issue?

    Alright I found something  I am not  sure if it is of use to you , A checksum is generally used to  detect the integrity of file
    it is calculated oin basis of hash algorithms so  how it is useful to for incoming filed values i m not  sure
    Please find the links below
    http://en.wikipedia.org/wiki/Checksum
    http://www.fastsum.com/support/online-help/checksums.php
    http://www.flounder.com/checksum.htm
    http://www.mkyong.com/java/how-to-generate-a-file-checksum-value-in-java/
    If it is useful , you need to implement a hash algorithm
    regards
    Ninad

  • Help needed regarding OIM login using wallet code

    Hi All,
    When i am trying to access the username and password from the weblogic credential store following exception occurred...Can any one help me plzzz....
    The exception is................
    javax.faces.el.EvaluationException: java.security.AccessControlException: access denied (oracle.security.jps.service.credstore.CredentialAccessPermission context=SYSTEM,mapName=oim,keyName=* read)
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:788)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:306)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:186)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         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:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.security.AccessControlException: access denied (oracle.security.jps.service.credstore.CredentialAccessPermission context=SYSTEM,mapName=oim,keyName=* read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
         at java.security.AccessController.checkPermission(AccessController.java:546)
         at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$3.checkPermission(JpsAuth.java:436)
         at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:496)
         at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:519)
         at oracle.security.jps.internal.credstore.util.CsfUtil.checkPermission(CsfUtil.java:611)
         at oracle.security.jps.internal.credstore.ssp.SspCredentialStore.getCredentialMap(SspCredentialStore.java:476)
         at view.backing.Task3.cb1_action3(Task3.java:403)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
         ... 44 more

    See if this helps:
    Failed to initialize the application 'oim due to error java.security.Access
    regards,
    GP

  • Help needed with Java 1.4 and xml Runtime problem

    I am working on a java 1.3 and JAXP1.1 written code. Now I want to compile and run it using J2SE 1.4. Here are the import statements from the existing code.
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.Locator;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.XMLReader;
    import org.xml.sax.InputSource;
    import java.sql.*;
    import java.net.*;
    import java.io.*;
    When I run the existing(using java 1.3 and Jaxp1.1) code I have to include the files crimson.jar and jaxp.jar in the windows 2000 CLASSPATH and works fine.
    But when I compile and run it using J2SE 1.4 which has the built in support for the saxp, I thought that I don't have to specify any CLASSPATH for the new 1.4 so I don't specify any Classpath and it gives me the Microsoft "ClassFactory cannot find the requested class" error which means that even thought the new java 1.4 has the xml classes as libraries yet it still requies some .jar files to be listed in the CLASSPATH.
    If I am right then what path will work(i.e what jar class I need to add to the CLASSPATH).
    Thanks for your help.
    RA.

    Thanks for your reply,
    I think I didn't specify when the error occurs. The ClassFactory related error occurs when I run the program, it compiles without any error.
    From what I understood somewhere in the java 1.4 docs, that the new 1.4 has the xml libraries built in by default so one doesn't need to give the classpaths just like we don't give any CLASSPATH for using swing and many of the other java packages. That is one thing.
    Second thing is that I also tried to use the java_xml_pack-spring02 and java_xml_pack-summer02; but non of them include the crimson.jar and the jaxp.jar files in them which are the 2 .jar files that makes the program run fine when used under the java 1.3 with combination of the jaxp1.1(which was downloaded seperately and then the CLASSPATH for it was set.).
    Can you please help what .jar files do I need to use instead. I tried to use the ones that the new java_xml_pack-spring02 and java_xml_pack-summer02 has for the jaxp in them.
    Thanks again.
    RA

  • Help need in Java Web Service method receiving object values as null

    Below is my web method and Package is the object received from dotnet client as a consumer. I have also defined the Package object structure. Now when I receive the data from dotnet I get only identifier value, but I get ownerid and price as null, even both values are sent by Dotnet client. I want to know whether only primitive datatype in java web service works or I need to do some configuration changes in order to have build in Wrapper class datatypes? It would be a great help if somebody explains.
    @WebMethod
    @WebResult(name = "PackageId")
    public long createNewPackage(@WebParam(name = "Package") com.db.radar.wl.data.Package data1,@WebParam(name = "PackageDetail") PackageDetail data2,@WebParam(name = "PackageTrade") PackageTrade data3);
    public class Package {
    Long ownerid;
    Double price;
    long identifier;
    }

    Hi ,
    I am getting the same error. I am running my application on jboss-4.0.4.GA. Please let me know the version of jboss that you to got it working.
    Thanks
    Viv

Maybe you are looking for

  • The Fan option does not appear for folders in the dock.

    The fan option does not appear on folders on the Dock. Stack option is checked, but all I get is grid list and automatic....running 10.5.2 any ideas?

  • How to create text box where input is time only.

    Hi , How can I create a textBox which accept Time only. Or how can i create a text Box so that it take two numbers before and after ":" Like -> 12 : 34. User can see : however have permission to edit numbers. Any suggestions. Regards Richa

  • Workitems getting stuck at expired users

    Hi, We have a case where workitems get stuck because the assigned users have expired validity. At the time of assignment, one user is set as agent. Then that user gets set to expired, however the Workitem still is assigned to that one user. This will

  • Change in item of  budget billing plan

    Dear all, I use CHANGEDOCUMET_READ  to find a change in Budget billing plan.   objektid = pa_opbel.   CALL FUNCTION 'CHANGEDOCUMENT_READ'        EXPORTING              changenumber      = nummer             date_of_change    = pa_erdat             ob

  • List, which contains the tax code of Cash dicount

    hello, does anyone know how I can create a list which contains following information. specific posting  period 1-5 tax code 16% or 19% plus their specific cash discount amount. e.g. period 1   tax code 16%   116€ period 1   tax code 19%   119€ I shou