Invoking Derived Class Method

Hi pls go through the below code, can any one give me solution how to access the Derived class method in this Point.
Note: In the below code , only in runtime we will come to know which Derived class method is going to invoke(So in runtime we will get Derived class name in the form of String). So Iam trying to Use Class.forName("Clas name") to create the instance of the Derived class and then type casting to base class.
Why iam casting to base class is , since only in the run time we are geting the Derived class name.
Result : iam geting the compiletime error says that no valid method fond in Mybase though it contains the reference of derived.
abstract class MyBase
public void display(int i)
System.out.println(" Base class Method");
class MyDerived extends MyBase
public void display(String str)
System.out.println("Derived class Mthode");
class MyMain
public static void main(String arg[])
String DrivObj=arg[0];
MyBase baseObj=(MyBase) Class.forName("DrivObj").newInstance();
baseObj.display("SomeString"); }
}

The problem is, can not have subclass reference bcoz
iam geting the subclass name only in the runtime and
one more thing is cant touch my base and subclass to
do changes as u said Your design is then definately very bad.
, is there any other way to do
it.Yes, you can use reflection to invoke the method.
Kaj

Similar Messages

  • Base class vs derived class

    We have entity classes that we use to access our database. We have subclasses derived from these entity classes that apply business rules. For instance, the base class AddressEntity has a
    setAddress2(string) that AddressEntity.select() uses to set a class variable with data retrieved from the database. The derived class Address also has a setAddress2(string) method that puts restrictions on the length of the data. I want the AddressEntity.select() method to use the base class method AddressEntity.setAddress2(). I've tried using this.setAddress2() in AddressEntity.select() but the derived class method is still used. Any suggestions?
    Thanks,
    Joe

    If you need to call some methods on the base class sometimes and some methods on the derived class other times, but using the same object, then yes dubwai is right you should revisit your Object hierarchy.
    One simple way to do what you are asking is to have your method(s) look like this:
    void setAddress2(String sAddress) { setAddress2(sAddress, true); }
    void setAddress2(String sAddress, boolean bRestrictLength) {
      // real method
    }then you could just look at the variable bRestrictLength to see if you need to restrict the length, and have it default to true. In this way you can use overloading to solve your problem.

  • Calling ABAP class methods from JAVA application

    Hi All,
    I want to fetch ITS related information (SITSPMON Tcode) in my JAVA application. But i didnt find much BAPIs for the same. While debugging I came accross few class methods with help of which I can get the required information. So is there any way we can call and execute methods of ABAP classes through java application?
    for e.g. I want to call GET_VERSION method of CL_ITSP_UTIL class.
    Thanks,
    Arati.

    Hi,
    Yes, as per my knowledge the only way to interact is using BAPI exposed as RFCs. So try to invoke those class methods in one CUSTOM BAPI and expose that BAPI as RFC and consume that RFC to get those details.
    Regards,
    Charan

  • Can i call non -abstract method in abstract class into a derived class?

    Hi all,
    Is it possible in java to call a non-abstract method in a abstact class from a class derived from it or this is not possible in java.
    The following example will explain this Ques. in detail.
    abstract class A
    void amethod()
    System.out.println(" I am in Base Class");
    public class B extends A
    void amethod()
    System.out.println(" I am in Derived Class");
    public static void main (String args[])
    // How i code this part to call a method amathod() which will print "I am in Base Class
    }

    Ok, if you want to call a non-static method from a
    static method, then you have to provide an object. In
    this case it does not matter whether the method is in
    an abstract base class or whatever. You simply cannot
    (in any object oriented language, including C++ and
    JAVA) call a nonstatic method without providing an
    object, on which you will call the method.
    To my solution with reflection: It also only works,
    if you have an object. And: if you use
    getDeclaredMethod, then invoke should not call B's
    method, but A's. if you would use getMethod, then the
    Method object returned would reflect to B's method.
    The process of resolving overloaded methods is
    performed during the getMethod call, not during the
    invoke (at least AFAIK, please tell me, if I'm wrong).You are wrong....
    class A {
        public void dummy() {
             System.out.println("Dymmy in A");
    class B extends A {
         public void dummy() {
              System.out.println("Dymmy in B");
         public static void main(String[] args) throws Exception {
              A tmp = new B();
              Class clazz = A.class;
              Method method = clazz.getDeclaredMethod("dummy", null);
              method.invoke(tmp, null);
    }Prints:
    Dymmy in B
    /Kaj

  • Implements interface method at the derived class

    Hi all.
    I have a class (Derived) that extends another class (Base).
    In the base class (Base) there is a method f() with its implementation.
    In the interface (C) there is also f() method exactlly like in the base class (Base).
    The derived class (Derived) is implements the interface (C).
    My question is:
    Do i have to implement the method f() in the derived class (Derived) ?

    My guess is that you probably have to, even if it's just to call the parent's method.
    This all sounds pretty sketchy. Why don't you just make the BASE class implement your interface?

  • Overloaded methods in a derived class

    Hello to everyone. I'm starting to learn java with the help of "Thinking in Java". I just want something to make it clearer for me.
    Suppose I have a base class with a method, and a derived class which overloads the method:
    class Base {
      void method() {
        System.out.println("Base method");
    class Derived extends Base {
      void method() {
        System.out.println("Derived method");
    }Now, in another class somewhere I create an instance of Derived:
    Derived dv = new Derived();
    dv.method();There is no way that I can access the method from the Base class, right? The only way I can do that is through
    class Derived extends Base {
      void method() {
        super();
        System.out.println("Derived method");
    }As I said, I'm almost sure that this is correct, I just want a confirmation.

    You can change the class
    class Derived extends Base {
      void method() {
        super.method();
        System.out.println("Derived method");
      // calls Base.method()
      void baseMethod() {
        super.method();
    }

  • Force Derived Class to Implement Static Method C#

    So the situation is like, I have few classes, all of which have a standard CRUD methods but static. I want to create a base class which will be inherited so that it can force to implement this CRUD methods. But the problem is, the CRUD methods are static. So
    I'm unable to create virtual methods with static (for obvious reasons). Is there anyway I can implement this without compromising on static.
    Also, the signature of these CRUD methods are similar.
    E.g. ClassA will have CRUD methods with these type of Signatures
    public static List<ClassA> Get()
    public static ClassA Get(int ID)
    public static bool Insert(ClassA objA)
    public static bool Update(int ID)
    public static bool Delete(int ID)
    ClassB will have CRUD signatures like
    public static List<ClassB> Get()
    public static ClassB Get(int ID)
    public static bool Insert(ClassB objB)
    public static bool Update(int ID)
    public static bool Delete(int ID)
    So I want to create a base class with exact similar signature, so that inherited derived methods will implement their own version.
    For E.g. BaseClass will have CRUD methods like
    public virtual static List<BaseClass> Get()
    public virtual static BaseClassGet(int ID)
    public virtual static bool Insert(BaseClass objBase)
    public virtual static bool Update(int ID)
    public virtual static bool Delete(int ID)
    But the problem is I can't use virtual and static due to it's ovbious logic which will fail and have no meaning.
    So is there any way out?
    Also, I have few common variables (constants) which I want to declare in that base class so that I don't need to declare them on each derived class. That's why i can't go with interface also.
    Anything that can be done with Abstract class?

    Hi,
    With static methods, this is absolutely useless.
    Instead, you could use the "Singleton" pattern which restrict a class to have only one instance at a time.
    To implement a class which has the singleton pattern principle, you make a sealed class with a private constructor, and the main instance which is to be accessed is a readonly static member.
    For example :
    sealed class Singleton
    //Some methods
    void Method1() { }
    int Method2() { return 5; }
    //The private constructor
    private Singleton() { }
    //And, most importantly, the only instance to be accessed
    private static readonly _instance = new Singleton();
    //The corresponding property for public access
    public static Instance { get { return _instance; } }
    And then you can access it this way :
    Singleton.Instance.Method1();
    Now, to have a "mold" for this, you could make an interface with the methods you want, and then implement it in a singleton class :
    interface ICRUD<BaseClass>
    List<BaseClass> GetList();
    BaseClass Get(int ID);
    bool Insert(BaseClass objB);
    bool Update(int ID);
    bool Delete(int ID);
    And then an example of singleton class :
    sealed class CRUDClassA : ICRUD<ClassA>
    public List<ClassA> GetList()
    //Make your own impl.
    throw new NotImplementedException();
    public ClassA Get(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Insert(ClassA objA)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Update(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Delete(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    private CRUDClassA() { }
    private static readonly _instance = new CRUDClassA();
    public static Instance { get { return _instance; } }
    That should solve your problem, I think...
    Philippe

  • Invoking the main() method of a class within another

    Greetings -
    Can someone tell me what happens when you invoke the main() method of a class from within another class?
    I have a third-party class, designed to be invoked from a command line, that I want to invoke from within a separate class. What appears to be happening is that following the successful execution of the third-party class, the invoking class is terminated as well. That's not the intended behavior I had envisioned. ^_^
    Is there a better way than invoking the main() method? I still need the invoking class to continue executing.
    Thanks!

    Navigate yourself around pitfalls related to the Runtime.exec() method

  • Invoke not known method in not known class.

    Everybody,
    I am confusing about loading, invoking a little-known class, method. 'Little-known' means, when
    designing we don't know the existence of that class, method. The application'll know names of
    class, method which are inputted by user (Those classes exist when the user input).
    For example: look at 'Little-known' class: FutureClass. It has method notKnownMethod as below
    package notnow
    public class FutureClass extends now.KnownClass {
      public void notKnownMethod() {
    }and the application main class MainApp.
      public class MainApp {
        public static void main(String[] args) {
          // these variable will be inputted by users
          // this is what we not known
          String className = "notnow.FutureClass";
          String methodName = "notKnownMethod";
          try {
            // create instance of the class
            // use the name inputted bye user
            Class futureClass = Class.forName("notnow.FutureClass");
            // get method in that class
            Method futureMethod = futureClass.getMethod("notKnownMethod", null);
            // and then invoke it -- Error dialog appears:
            // Prompt:  "Java Virtual Machine Launcher"
            // Content: "Fatal excption occurred. Program will exit"
            // with exception throw: java.lang.IllegalArgumentException: object is not an instance of  
            // declaring class. Point to next row.
            futureMethod.invoke(new now.KnownClass(), null);
            //futureMethod.invoke(new notnow.FutureClass(), null); -- No Error
            // but we don't know name of the class till user input it.
          }catch (Exception e) {}
      }You may think it's reflection, but reflection uses the known object in the invoke method(like the tutorial http://java.sun.com/docs/books/tutorial/reflect/object/invoke.html ). So how to invoke a method of a class known in the future (bussiness rule or update) ?
    Please help me out of this problem.
    Thanks for advance
    Liwh

    Take a closer look at the tutorial.
    To use a non-static method from the class, you must have an instance of the class. That means either calling one of the class' constructors or using the newInstance method to invoke the default no-args constructor.
    Object instance = futureClass.newInstance();
    futureMethod.invoke(instance, null);I will let you play with calling methods whose argument list you don't know...
    And if you know all you FutureClasses will extend a particular CurrentClass, make CurrentClass abstract with a few abstract methods that you would use in FutureClass... It will make life a lot easier:
    public abstract class CurrentClass {
      //All the other stuff
      public abstract void runPrimaryMethod();
    //Then in FutureClass
    public class FutureClass extends CurrentClass {
      //Other Stuff
      public void notKnownMethod () {
        //Stuff
      public void runPrimaryMethod() {
        notKnownMethod();
    //Then in main body
        CurrentClass instance = (CurrentClass)futureClas.newInstance();
        instance.runPrimaryMethid();Interfaces are also good for this.

  • How to recognize the name of invoked classes&methods&fields in a class

    I am now doing some programming used to recognize the name of all classes, methods, constructors and fields invoked from other classes in a given class. This recognition is required automatical. Now I really have no idea how to realize it. Can anyone please give me some suggestions how to programme it?
    Now I show you a specific example to make sure you understand my question.
    From the following example, firstly I've no idea what outer classes, methods and fields are used in class "PointShadowProtocol". However, the expected functionality of realization is to find out: 1, the name of two used outer classes: Shadow, Point; 2, invoked constructor: Shadow s=new Shadow(int x,int y); 3, invoked methods: Point.getX()&#65292; Point.getY()&#65292; Point.printPosition()&#65292;Shadow.offset&#65292;Shadow.printPosition(); and 4, invoked field: Point.x,Point.y,Shadow.x,Shadow.y
    public class PointShadowProtocol{
    private int shadowCount=0;
    public static Shadow getShadow(Point p){
    Shadow s=new Shadow(p.x,p.y);
    return s;
    public void setting(Point p){
    Shadow s=new Shadow(p.x,p.y);
    shadowCount++;
    public void settingX(Point p){
    Shadow s=getShadow(p);
    s.x=p.getX()+Shadow.offset;
    p.printPosition();
    s.printPosition();
    public void settingY(Point p){
    Shadow s=getShadow(p);
    s.y=p.getY()+Shadow.offset;
    p.printPosition();
    s.printPosition();
    Actually, after realizing this functionality, I will use these results to automatically generate the related class stub, method stub, field stub, which can be used to test the given class "PointShadowProtocol", probably equivalent to unit test.
    Any suggestions are welcome. Thank you in advance for your reply.

    Using BCEL sounds a good idea for a class in Java. Actually, I want to target an aspect, which is from AspectJ, without knowing any invoked classes, class methods and fields inside an aspect in the first place (examples of an aspect is as showed below). An aspect in AspectJ is just like a class in Java. But an aspect can't be compiled if the invoked outer classes and methods don't exist. (In fact, the weaving of an aspect into classes happens in the compile time, an aspect can't be compiled if the woven classes (or invoked classes) don't exist, which means I have to find out the all the invoked classes, class methods and fields in that aspect before the compile time) So BCEL could not apply into an aspect in AspectJ.
    I am sorry to introduce new concepts here. However,the solution to find out all the invoked outer classes, class methods and fields in a given class before the compile time can be applied to an aspect as well.
    Thank you for your time to think about my question.
    public aspect PointShadowProtocolAspect {
         private int shadowCount=0;
         public static Shadow getShadow(Point p){
              Shadow s=new Shadow(p.x,p.y);
              return s;
         pointcut setting(Point p): target(p)&&call(Point.new(int,int));
         pointcut settingX(Point p):target(p)&&call(void Point.setX(int));
         pointcut settingY(Point p):target(p)&&call(void Point.setY(int));
         after(Point p): setting(p){
              Shadow s=new Shadow(p.x,p.y);
              shadowCount++;
         after(Point p):settingX(p){
              Shadow s=getShadow(p);
              s.x=p.getX()+Shadow.offset;
              p.printPosition();
              s.printPosition();
         after(Point p):settingY(p){
              Shadow s=getShadow(p);
              s.y=p.getY()+Shadow.offset;
              p.printPosition();
              s.printPosition();

  • Invoking remote java classes/methods

    Hi,
    I just wanted to ask for opinions and suggestions regarding my attempt to call a remote java class method using PL/SQL. I didn't want to load it in the database since the configurations for the java class were already set using Spring Integration. I just wanted to supply constructor arguments and run the method and then retrieve the result. Are there any good or easier ways on doing this?
    Thanks in advance

    Very curious Susan,
    A server JVM might not want to host mobile code from other clients, not that it's unsafe, it's just that it allows clients to crash the server JVM at will. They should have it configured to automatically restart though.
    Did they delete the java.rmi.* packages from the server JVM runtime? I don't understand why they'd do that.
    If you can pry some reasons from them, I'd be very interested to hear them. Perhaps they just want more money, in order to allow you this privilige.
    John
    PS I've updated representation for you, and ejp, on the cajo project supporting The Land Down Under!

  • A basic question regarding derived class

    Hi,
    I am new to Java development, so this might be a very trivial question:
    class Base {
    public void b() {
    System.out.println("Base::b() method invoked");
    class Derived {
    public void d() {
    System.out.println("Derived::d() method invoked");
    class Testing1 {
    public static void main (String[] args) {
    Base val = new Derived();
    obj.d();
    I expected this to compile ( expecting d() to be treated as a virtual function). However I get an error message : "cannot find symbol : symbol d() : location: class Base".
    1. Is it possible to know where I went wrong ?
    2. How can I invoked d() method from val ?
    Regards,
    Anirvan

    two things I see are:
    1. obj isn't defined anywhere
    2. class derived should extend base by: class Derived extends Base
    Gregory

  • Strange about invoking web service method declared “string  method(void)”;

    Dear forum readers
    I’m experimenting with OpenESB and web services. I’ve create a simple web service using NetBeans 6.1. The method consists of a single method, getTime, that is declared:
    String getTime()
    My current experiment is to invoke this method from a BPEL-process using the “Invoke” process object. The strange thing is that it seems like I have to provide a “dummy” inbound variable from the BPEL-designer even though the method doesn’t take any parameters. I include a snippet from the BPEL process below which includes the section where I set the dummy GetTimeIn-variable and then invokes the WS method getTime().
    <assign name="Assign2">
    <copy>
    <from>'DummyValue'</from>
    <to variable="GetTimeIn" part="parameters"/>
    </copy>
    </assign>
    <invoke name="Invoke1" partnerLink="PartnerLink1" operation="getTime" xmlns:tns="http://ws/" portType="tns:MyWebService" outputVariable="GetTimeOut" inputVariable="GetTimeIn"/>
    If I don’t initiate the dummy variable or remove it altogether, I can’t successfully call the method. If I include the dummy in-parameter the call works just fine and I get back the current time as a string.
    I must admit that I’m still a rookie to web services, especially when calling them from a BPEL-process, so it may be a very trivial reason for this behaviour. Anyway, any help on this matter would be greatly appreciated.
    Regards, Ola

    Thank you both for the response. Regarding Rennay’s posting I have an additional question. When I create a new web service I don't have the "Document Literal" option nor a "Concrete Configuration" tab. I've created the web service using the "Web Application" project type and then adding a web service using the "Web Service..." wizard. This wizard doesn't have the configuration properties you mention, but if I add a WSDL-file to a BPEL-project the wizard has the properties you mention.
    Is it possible to create a web service, programmed as an ordinary Java-class, from an existing WSDL-file? In that case it may solve the problem with the “Document Literal” property. Currently I don’t know any other way to create such a web-service other than the through the web service wizard in a web application project. Of course, it’s possible to craft it from scratch but that’s to much work to be practical.
    Regards, Ola

  • Failed to invoke startup class "MyStartup Class"

    Hi,
    I configured StartUpClass.java in Weblogic server through Admin Console . Also I set the required jar files in the classpath of the server in WL_HOME\server\bin\startWLS.cmd.
    This StartUPClass is written to initialize and create the minimum number of objects in the pool, needed for URLConnection using ObjectPooling API.
    I am getting Exceptions while starting the server after deployment of the application. I am pasting the full stack trace.
    <Feb 1, 2007 9:49:55 AM IST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.4.2_12-b03 from Sun Microsystems Inc.>
    <Feb 1, 2007 9:50:10 AM IST> <Info> <Configuration Management> <BEA-150016> <This server is being started as the administration server.>
    <Feb 1, 2007 9:50:10 AM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 8.1 SP4 Mon Nov 29 16:21:29 PST 2004 471647
    WebLogic XMLX Module 8.1 SP4 Mon Nov 29 16:21:29 PST 2004 471647 >
    <Feb 1, 2007 9:50:11 AM IST> <Notice> <Management> <BEA-140005> <Loading domain configuration from configuration repository at D:\bea\user_projects\domains\nessdomain\.\config.xml.>
    <Feb 1, 2007 9:50:15 AM IST> <Notice> <Log Management> <BEA-170019> <The server log file D:\bea\user_projects\domains\nessdomain\myserver\myserver.log is opened. All server side log events will be written to this file.>
    <Feb 1, 2007 9:50:18 AM IST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
    <Feb 1, 2007 9:50:18 AM IST> <Notice> <WebLogicServer> <BEA-000327> <Starting WebLogic Admin Server "myserver" for domain "nessdomain">
    <Feb 1, 2007 9:50:31 AM IST> <Warning> <HTTP> <BEA-101248> <[Application: 'D:\MSM\Workspace\MSM2.0Jan9', Module: 'MSM31']: Deployment descriptor "web.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)". (line 96, column 11).>
    <Feb 1, 2007 9:50:31 AM IST> <Warning> <HTTP> <BEA-101248> <[Application: 'D:\MSM\Workspace\MSM2.0Jan9', Module: 'MSM31']: Deployment descriptor "weblogic.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: The content of element type "weblogic-web-app" must match "(description?,weblogic-version?,security-role-assignment*,run-as-role-assignment*,reference-descriptor?,session-descriptor?,jsp-descriptor?,auth-filter?,container-descriptor?,charset-params?,virtual-directory-mapping*,url-match-map?,preprocessor*,preprocessor-mapping*,security-permission?,context-root?,wl-dispatch-policy?,servlet-descriptor*,init-as*,destroy-as*)". (line 23, column 20).>
    <Feb 1, 2007 9:50:35 AM IST> <Critical> <WebLogicServer> <BEA-000286> <Failed to invoke startup class "MyStartup Class", java.lang.ClassNotFoundException: com.helio.msm.ws.util.StartUpClass
    java.lang.ClassNotFoundException: com.helio.msm.ws.util.StartUpClass
         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:141)
         at weblogic.t3.srvr.StartupClassService.invokeClass(StartupClassService.java:156)
         at weblogic.t3.srvr.StartupClassService.access$000(StartupClassService.java:36)
         at weblogic.t3.srvr.StartupClassService$1.run(StartupClassService.java:121)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.t3.srvr.StartupClassService.invokeStartupClass(StartupClassService.java:116)
         at weblogic.t3.srvr.PostDeploymentStartupService.resume(PostDeploymentStartupService.java:63)
         at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
         at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
         at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
         at weblogic.Server.main(Server.java:32)
    >
    <Feb 1, 2007 9:50:36 AM IST> <Error> <Socket> <BEA-000438> <Unable to load performance pack. Using Java I/O instead. Please ensure that wlntio.dll is in: 'D:\j2sdk1.4.2_12\bin;.;C:\WINDOWS\system32;C:\WINDOWS;D:\j2sdk1.4.2_12\bin;c:\windows\system32;C:\apache-ant-1.6.5\bin;'
    >
    <Feb 1, 2007 9:50:36 AM IST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "myserver" for domain "nessdomain" running in Development Mode>
    <Feb 1, 2007 9:50:36 AM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    <Feb 1, 2007 9:50:36 AM IST> <Notice> <WebLogicServer> <BEA-000355> <Thread "ListenThread.Default" listening on port 7001, ip address *.*>
    <Feb 1, 2007 9:50:55 AM IST> <Warning> <Socket> <BEA-000402> <There are: 5 active sockets, but the maximum number of socket reader threads allowed by the configuration is: 4. You may want to alter your configuration.>
    Please help me in resolving this problem. I need it asap
    Thanks,
    Dharani

    I should be more specific and have a bit more to add....
    We have our app in an .ear file. I find that when I put the startup
    classes in a seperate directory which is in the classpath specified in the
    startWeblogic.cmd file they will be run on startup. I don't think I should
    have to do this since these files exist in the ear file. I think this is
    causing other problems too such as an illegalAccessError I get when an EJB
    tries to load a class which was previously accessed by the startup classes.
    Thanks,
    Steve
    Steve Snodgrass wrote:
    Hi,
    I am beggining to upgrade our app from Weblogic 5.1 to 6.0. So far it
    has been progressing nicely and everything works with one exception. I
    can not get the start up classes to run. I get the following exception:
    <Failed to invoke startup class "MyStartup Class",
    java.lang.ClassNotFoundException:
    followed by my fully qualified class name. The class is reference
    elsewhere in the code and works fine. Is a seperate classpath used for
    startup classes? If not why might Weblogic have a hard time finding my
    class?
    Thanks,
    Steve

  • My derived class suddenly doesn't recognize the parent class

    I had my assignment coded, debugged, working and ready to go. So I bring my flash drive upstairs to play around with it on my other computer. When I compile the base class it compiles fine, but now when I try to compile the derived class, and the test class with the main method, I'm coming up with errors.
    They have something to do with the base class not being recognized, because I can't instantiate any objects of the class now, and i get an error when attempting to compile the derived class to the effect of "cannot find symbol; symbol: class BaseClass". i get this error throughout the derived class, from the initial declaration of the class (public class DerivedClass extends BaseClass), to any references made toward methods of the parent class.
    My base class compiles with no problem, but it's like nothing else is able to "use" it. I'm not sure if it has something to do with the PC im using now, and I can't confirm this at the moment because the PC I used to write the code is down (waiting on an upgrade).
    ehhh.....help.
    Message was edited by:
    asphaltninja
    null

    It's not the fault of the computer hardware.
    It's not the fault of the operating system.
    It's not the fault of the JDK.
    So don't go rebooting or reinstalling anything. The problem is that you didn't set up things on the new computer in the same way they were set up on the old computer.
    In particular the compiling problem is that the compiled version of BaseClass isn't in the classpath when you try to compile DerivedClass. I can't tell why from your description.

Maybe you are looking for

  • My phone has locked me out, but i am putting in the correct pasword every time?what do i do ?

    i have recently changed my pasword from a word, to the standard 4 diget pasword. my phone has decided that my pasword is incorect when i know for definate that it is correct! what do i do ?!

  • Create and edit mp3 CDs of my trainings

    Please advise software I should use for simple editing to create mp3 CDs or DVDs of my trainings to give to my students. I own Logic Pro and of course have Garage Band. Should I use one of these programs or buy another? And what about printing onto t

  • OBIEE 11g - Analysis & Administration Tool questions

    Dear Experts, I have two question in OBIEE 11g version 11.1.1.5.0: 1. How can we display timezone in the analysis result, we have formatted the mask "MM_DD_YYYY hh:mm:ss tt z" but the "z" does not apply, it display character "z" in our result. 2. Can

  • Seeting cookies for different domain with port number

    Hi, I've been desperately trying to solve this for a few days now so thought i'd give up and ask. Basically, when a user logs into the website, the idea is for them to be automatically logged into the bulleting board. This is being done by setting a

  • Watching Videos on Blackberry 8310

    I am new to the RIM family and I love it so far.  I have been having some problems with it though.  The first is my desktop software which can be a different thread in itself.  The reason for this message is viewing videos on my phone.  Both my frien