Referencing Upper Generified Class in a Inline Class

This has been something that has been bugging me for quite some time.
AClass aClass = new AClass(){
  void aMethod(){
    BClass bClass = new BCLass(){
      void bMethod(){
        //How do I reference the generified version of aClass at this level
        AClass<AGeneric>.this //This causes a compiler error
        AClass.this //This works but returns the non generified version of AClass     
};Sure there are work arounds such as:
final AClass<AGeneric> aClass = this; //right before declaring bClassbut there must be a way to do this properly! Any help would be greatly appreciated.

Are you against inline class use in general? Because this code snippit has the exact same issue:
public class MyClass<T>{
public void doSomething(){
    MyInlineClass myInlineClass = new MyInlineClass(){
      public void doSomething(){
        MyClass<T>.this //error
}It doesnt have to be inline within inline. Its just referencing "this" from one level up when one level up has a generic on it.

Similar Messages

  • How to access an attribute(this is referencing to another class) in a class

    Dear Gurus,
    I have to read an attribute of a class and that attributes type another class.
    I have intantiated the class and my question is how to read the attribute. I know I can not dirrectly read the attribute since this is another class. I think I have to first reference the attribute right? Please advise me.
    My code looks like below:
    data: lo_fpm                                 type ref to if_fpm.
    data: lo_msg_mgr                        type ref to if_fpm_message_manager.
    data: lo_component_manager    type ref to cl_fpm_component_manager.
    lo_fpm = cl_fpm_factory=>get_instance( ).    " cl_fpm_factory is a class which has a static method get_instance
    lo_msg_mgr = lo_fpm->mo_message_manager.
    lo_component_manager = lo_fpm->mo_component_manager.
    The above statement is giving syntax error. I do not know why.
    The basic difference b/n the two methods is if_fpm~mo_message_manager    type ref to if_fpm_message_manager    and
    mo_component_manager     type ref to cl_fpm_component_manager.
    Any help would be appreciated.
    Thanks,
    GSM

    Hello
    I cannot test the following coding because I do not get the singleton instance yet it should work:
    *& Report  ZUS_SDN_CL_FPM_FACTORY
    *& Thread: How to access an attribute(this is referencing to another class) in a class
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1398429"></a>
    REPORT  zus_sdn_cl_fpm_factory.
    DATA: go_fpm TYPE REF TO cl_fpm.  " class implements if_fpm.
    DATA: go_msg_mgr TYPE REF TO if_fpm_message_manager.
    DATA: go_component_manager TYPE REF TO cl_fpm_component_manager.
    START-OF-SELECTION.
      BREAK-POINT.
      go_fpm ?= cl_fpm_factory=>get_instance( ). " cl_fpm_factory is a class which has a static method get_instance
      CHECK ( go_fpm IS BOUND ).
      go_msg_mgr           = go_fpm->mo_message_manager.
      go_component_manager = go_fpm->mo_component_manager.
    END-OF-SELECTION.
    Regards
      Uwe

  • Referencing between custom classes

    Hi,
    I need some help with the theory of referencing between custom class files.
    I have not worked much with custom classes before, but want to learn more.
    Is it possible to call for a function in one custom class file from another custom class file?
    The files are in the same package (folder).
    The first custom class is the one stat starts all the main activities on the movie clip when it is added to the stage.
    One of the activities it should start, is starting to add some movie clips to the stage.
    I would like to initiate that activity in the first custom class file, but have the detailed code (where, what and when to add) in another custom class file.
    Is that possible? When yes, how should it be referenced?
    Many thanks in advance!

    Hi,
    Thank you all for your replays.
    Got some new terminology – Singelton, Setters and Getters.
    Have not come across before:)
    I do know the inheritance and have used it. And my little experience with it told me as well – it’s something you shouldn’t go crazy or fanatic with. Overusing it makes things complicated.
    Amy, what you descibed is how I normally do use the classes – attach them to the Library symbols.
    In my question I meant one concrete Movie Clip which is one sub-part of the application.
    The Movie Clip is just an animated picture. That Movie Clip (girlSwim) is attached to the base class GirlSwim.
    And that class is at the moment handling the animation for that girl swimming. It would be good to have that code on a sub-level symbol, like the Girl, but as a mask is swimming along as well, it got too complicated for me to code, cross reference the nested symbols. So the code ended up on top level symbol.
    In that Movie Clip are other animating symbols as well and they are all handled with other custom classes.
    When the girlSwim Movie Clip is activated, it’s on screen, dragonflies start to fly in and fishes start to swim in as well. They are not on the original picture, so not on stage.
    And adding them is managed with timers and it continues as long as the Movie Clip is on screen.
    At the moment I have all the stuff related to dragonflies and fishes on the first keyframe.
    And it all functions nicely.
    But as I’m practicing now using class files and keeping my timeline action script free (except some stop and goto staff to handle the timeline animations), I want to get that part of the code into class file as well.
    I could but it all into the class GirlSwim and it would function.
    But as the animation code for the girl is long enough, I though it would be good to have the code for dragonflies and fishes separate.
    But it needs to be initiated by the GirlSwim class.
    So … in my little-simple world I thought the following could work .. but it didn’t:)
    1180: Call to a possibly undefined method timerStartDragonflies.
    package
    public class GirlSwim extends MovieClip
          public function GirlSwim()
               timerStartDragonflies ();
    package
    public class Dragonflies extends MovieClip
    public function Dragonflies ()
                                    //empty
                    internal function timerStartDragonflies():void
                                   //code for starting timer
                    etc.
    Is something like that possible or should I put it all into the GirlSwim class?

  • Referencing another's Class CardLayout to add cards.

    Hi, thanks for having a look at my question.
    I had some working code where the Frame was created in the main. Trying out MVC pattern with simple password screen.
    I used to create the CardLayout in the main and pass both the frame reference and the cardLayout reference (and a view) to another (controller)class where the view was added to the frame and the cardLayout. No complaints sofar.
    I then decided to put the frame in it's own class. In this class the layout is also set to cardLayout.
    In the main where I now (still) pass the reference for the frame reference I feel no need to pass the cardLayout reference.
    I thought I should be able to refer to the cardLayout by knowing the frame reference.
    However, the compiler does not appreciate my formulation. (As a newbie I tried a dozen 'combinations' already to no avail)
    I would appreciate if you could help me out here. I have the offending code snippets below, the error at the bottom.
    KR WimE
    The Main:
    import java.awt.*;
    import java.awt.event.*;
    public class Main {
        public static void main(String[] args) {
              Frame frame = new MVCFrame("Frame");
              MVCModelLogin     mvcModelLogin     = new MVCModelLogin();
              MVCView_Login     mvcView_Login     = new MVCView_Login(mvcModelLogin);
              MVCContrLogin     mvcContrLogin     = new MVCContrLogin(frame, mvcModelLogin, mvcView_Login);
              frame.setVisible(true);
              System.out.println("Main - ended");
        }     The Frame:
    import java.awt.*;
    import java.awt.event.*;
    public class MVCFrame extends Frame {
         public CardLayout cardLayout = new CardLayout();
         public MVCFrame (String title) {
              super(title);
              this.setLayout(cardLayout);
              this.setBounds(64,100,1024,768);
         public void pushStackCardLayoutShow(MVCView_Login view,java.lang.String title) {
              this.add(view, title);
              cardLayout.addLayoutComponent(this, title);          
    }The Controller:
    import java.awt.*;
    import java.awt.event.*;
    public class MVCContrLogin {
         private Frame frame;
         private MVCModelLogin model;
         private MVCView_Login  view;
         public MVCContrLogin(Frame frame, MVCModelLogin model, MVCView_Login view)
              System.out.println("Constructor - Controller - Login");
              this.model     = model;
              this.view     = view;
              frame.pushStackCardLayoutShow(view, "mvcView_Login");
    //     the offending line:
    //   _MVCContrLogin.java:29: cannot find symbol : method pushStackCardLayoutShow(MVCView_Login,java.lang.String)_

    You are referencing the MVCFrame as a Frame in MVCContrLogin. A Frame does not have the method pushStackCardLayoutShow. Change the reference type to MVCFrame.
    Kaj

  • Referencing files from classes

    Hi All,
    could someone help me out with the correct procedure to reference a file (not a java class) from a class? In my situation I have a directory structure for a web app of the form:
    /WEB-INF/my-config.xml
    /WEB-INF/classes/datautils/AppConfig.class
    (the two WEB-INFs being the same directory obviously)
    This structure could end up in any directory, depending on the arrangement of the webserver, or in a jar file for instance. AppConfig.class and my-config.xml will always have the same relative relationship.
    I want something like:
    File file = new File(***PathToFile***);
    In the AppConfig class, the problem is that ***PathToFile*** changes depending on where the app is installed and where its run from in the server.
    Is there a way of say finding out the path of the class AppConfig.class and then using that to construct the path to my-config.xml?
    Cheers
    Matt

    Thanks guys,
    a couple of issues though - first baddar:
    There are methods in the File API to tell me where a File is once I have located a reference to it. In my case I need to know where AppConfig.class is located before I can even find the file my-config.xml and set up a File object that wraps it. So those methods don't help me.
    akalex:
    That method works fine in if I am using these classes in a web app and have a Servlet context to use. I want a technique that doesn't rely on the Servlet api preferably. That way I can use the AppConfig.class in other situations. The name AppConfig.class doesn't sound like a class that would be used elsewhere I know, but in another situation I may have a general class I would like to set its behaviour with a file and use in other applications.
    So the question remains - is there anyway I can find out the path that a class is in when running any kind of Java app - not necessarily in a container, perhaps just on a JVM as a standalone app.
    thanks chaps
    matt

  • Referencing WMI Manageable class from another WMI Class

    Hi,
    I am trying to have WMI manageable class referring to another WMI manageable class
    Something like
    [ManagementEntity]
    Class A
    [ManagementEntity]
    Class B
            [ManagementReference(Type = "A")]
            [ManagementProbe]
            public A AClass;
    When trying to install the class, I am getting “Type unsupported”
    I tried the Microsoft
    ManagementReference sample,
    http://msdn.microsoft.com/en-us/library/system.management.instrumentation.managementreferenceattribute.aspx
    (working fine but the LetterPhonetic class won’t show on the WMI Object Browser)
    Ideas will be highly appreciated
    My Sample code
    using System;
    using System.Management.Instrumentation;
    using System.Collections.Concurrent;
    using System.Collections;
    [assembly: WmiConfiguration("root\\ConsoleC", HostingModel = ManagementHostingModel.Decoupled)]
    namespace ConsoleDecoupled
        [System.ComponentModel.RunInstaller(true)]
        public class TheInstaller : DefaultManagementInstaller
        public class Program
            public static void Main(string[] args)
                for (int i = 0; i < 10; ++i)
                    TestEnumWmi ms = TestEnumWmi.CreateTestEnumWmi();
                    ms.teststring = i.ToString();
                InstrumentationManager.RegisterType(typeof(TestEnumWmi));
                InstrumentationManager.RegisterType(typeof(RuntimeConfigSettings));
                Console.WriteLine("Press enter to exit");
                Console.ReadLine();
                InstrumentationManager.UnregisterType(typeof(TestEnumWmi));
                InstrumentationManager.UnregisterType(typeof(RuntimeConfigSettings));
        [ManagementEntity(Singleton = true, Name = "ConfigurationSample")]
        [ManagementQualifier("Description", Value = "Configuration Sample Application")]
        public class RuntimeConfigSettings
            [ManagementProbe]
            public string[] ReadMe;
            private int myVar;
            [ManagementConfiguration]
            public int MyProperty
                get { return myVar; }
                set { myVar = value; Console.WriteLine(value); }
            [ManagementReference(Type = "TestEnumWmi")]
            [ManagementProbe]
            public TestEnumWmi MSS;
            [ManagementBind]
            public RuntimeConfigSettings()
                ReadMe = new string[10];
                for (int i = 0; i < 10; ++i)
                    ReadMe[i] = "blah " + i;
        [ManagementEntity(Name = "TestEnumWmi")]
        public class TestEnumWmi
            private TestEnumWmi()
            static internal TestEnumWmi CreateTestEnumWmi()
                TestEnumWmi ms = new TestEnumWmi();
                ms._id = Guid.NewGuid().ToString();
                ms.teststring = "blah";
                ms.TestInt = new Random().NextDouble();
                instantlist.TryAdd(ms._id, ms);
                return ms;
            [ManagementConfiguration()]
            public double TestInt { get; set; }
            [ManagementConfiguration()]
            public string teststring { get; set; }
            [ManagementKey(Name = "ID")]
            public string _id;
            [ManagementBind]
            static public TestEnumWmi GetInstant([ManagementName("ID")] string ID)
                TestEnumWmi ms = null;
                if (instantlist.TryGetValue(ID, out ms))
                    return ms;
                else
                    throw new InstanceNotFoundException();
            [ManagementEnumerator]
            static public IEnumerable EnumerateTestEnumWmis()
                foreach (var i in instantlist)
                    yield return i.Value;
            static internal ConcurrentDictionary<string, TestEnumWmi> instantlist = new ConcurrentDictionary<string, TestEnumWmi>();

    Hi,
    The Microsoft ManagementReference sample you mentioned contains a bug:
    Instead of:
    inst.LetterNumber = "Letter = " + i;
    inst.PhoneticNumber = "Phonetic = " + i;
    The exact text (where spaces in the string are important and must be removed) should be:
    inst.LetterNumber = "NumberLetter.Number=" + i;
    inst.PhoneticNumber = "NumberPhonetic.Number=" + i;
    With this fix, the hierarchy can now be navigated properly.
    c.f. my response to the following blog post:
    http://juggledthoughts.blogspot.co.uk/2008/06/wmi-association-classes.html
    I have also
    logged a bug on MSDN Feedback so please vote on this if you'd like them to fix the sample.

  • Java stored procedures and referencing classes

    We are referencing to some classes/libraries which are not present in the database. In normal java world, you specify the libraries/classes needed to run your piece of code in the CLASSPATH and that forms part of your complete code.
    Can java stored procedures in the database refer to libraries or class files it requires on the file system rather than the database? Is it possible to make this happen?
    Thanks

    pshiva,
    Posting the same question to multiple forums usually doesn't increase your chances of getting an answer, and it just frustrates those wishing to answer you with the result being that any future questions you post may have less chance of being answered -- because of your uncourteous, initial behaviour.
    I have answered your other thread:
    java stored procedures and referencing classes
    In my opinion, that forum (the Database JVM forum) is the most appropriate for your question.
    Good Luck,
    Avi.

  • Static inner class causes deployment  on OC4J 10.1.2 to fail

    Hi,
    this issue has already been raised on OC4J 9.0.4 with J2SDK 1.4.2 (see EJB fails to compile - static inner class problem
    Recap: When referencing static inner classes in an EJB, the deployment fails. During the generation of the wrapper classes, a signature <package>.<outer class>.<inner class> gets converted to <package>.<outer class>$<inner class>, which is syntactically wrong. While the Java 1.4.1 compiler kindly ignores this syntax error, its 1.4.2 counterpart complains - and fails.
    @Oracle: When will this bug be fixed for OC4J 10.1.2?
    Best regards,
    Holger

    Holger,
    Don't static inner classes contradict the EJB specification?
    In any case, in answer to Andy's question: If you wish to file this as a bug, you can do so via the MetaLink Web site.
    [In fact, [i]MetaLink is your only option for submitting bugs for Oracle products -- as far as I know.]
    Good Luck,
    Avi.

  • How can i change the class in the Class Library project to be static or public so i can use it from the windows application project ?

    First i know that when i make any changes to the class library project i need to rebuild the project then to remove the Capture.dll from the TestScreenshot project and then to add again the updated Capture.dll
    The problem for example in this case i'm trying to use a public static variable i add in the DXHookD3D9.
    In the DXHookD3D9 i added this public static variable:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    //using SlimDX.Direct3D9;
    using EasyHook;
    using System.Runtime.InteropServices;
    using System.IO;
    using System.Threading;
    using System.Drawing;
    using Capture.Interface;
    using SharpDX.Direct3D9;
    namespace Capture.Hook
    internal class DXHookD3D9: BaseDXHook
    public DXHookD3D9(CaptureInterface ssInterface)
    : base(ssInterface)
    LocalHook Direct3DDevice_EndSceneHook = null;
    LocalHook Direct3DDevice_ResetHook = null;
    LocalHook Direct3DDevice_PresentHook = null;
    LocalHook Direct3DDeviceEx_PresentExHook = null;
    object _lockRenderTarget = new object();
    Surface _renderTarget;
    public static decimal framesperhourtodisplay = 0;
    protected override string HookName
    get
    return "DXHookD3D9";
    List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>(
    framesperhourtodisplay
    The problem is i can't even get to the Capture.Hook namespace and not to the DXHookD3D9 from the TestScreenshot application window project.
    This is a screenshot:
    For example fro the FramesPerSecond class i can use it get to it from the windows forms application.
    namespace Capture.Hook
    /// <summary>
    /// Used to determine the FPS
    /// </summary>
    public class FramesPerSecond
    int _frames = 0;
    int _lastTickCount = 0;
    float _lastFrameRate = 0;
    Since it's public i guess.
    But if i will change the DXHookD3D9 class from internal to public:
    public class DXHookD3D9: BaseDXHook
    I will get error on the DXHookD3D9: 
    Error 1
    Inconsistent accessibility: base class 'Capture.Hook.BaseDXHook' is less accessible than class 'Capture.Hook.DXHookD3D9'
    And the BaseDXHook class:
    namespace Capture.Hook
    internal abstract class BaseDXHook: IDXHook
    protected readonly ClientCaptureInterfaceEventProxy InterfaceEventProxy = new ClientCaptureInterfaceEventProxy();
    public BaseDXHook(CaptureInterface ssInterface)
    this.Interface = ssInterface;
    this.Timer = new Stopwatch();
    this.Timer.Start();
    this.FPS = new FramesPerSecond();
    Interface.ScreenshotRequested += InterfaceEventProxy.ScreenshotRequestedProxyHandler;
    Interface.DisplayText += InterfaceEventProxy.DisplayTextProxyHandler;
    InterfaceEventProxy.ScreenshotRequested += new ScreenshotRequestedEvent(InterfaceEventProxy_ScreenshotRequested);
    InterfaceEventProxy.DisplayText += new DisplayTextEvent(InterfaceEventProxy_DisplayText);
    ~BaseDXHook()
    Dispose(false);
    How can i solve it so i can use the variable framesperhourtodisplay in the DXHookD3D9 class with the TestScreenshot windows forms application ?

    Hi,
    I dont know if it will work here, since I dont know the complete structure, but the base call must be public, if the derived class is public, so the base class is at least as accessible as the derived class.
    Try make the base class public. (And maybe the base-class IDXHook of the base also...)
    Or use a different approach and make only the properties public that are needed to be public by adding an extra class...
    A structure could look like:(you need to create a class thats public in your dll and expose a property, and set this property in the internal class...)
    In the Accessing class (here Form1)
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    C c = new C();
    MessageBox.Show(B.F.ToString());
    and in the class Lib:
    internal class A
    public A()
    B.F = DateTime.Now.Millisecond;
    public class B
    public static int F { get; set; }
    public class C
    public C()
    A a = new A();
    (add a referenc to the class lib from the accessing project)
    Regards,
      Thorsten

  • Call functions between classes

    Hi all,
    I have two java classes compiled into the DB in different schemas. How could I call the static method in classA from classB?
    I suppose I need to get the schema name in there somehow, or is it just as simple as classA.method(arg1)
    havent dared trying yet ;)

    You need to change the resolver of the referencing class to include the schema of the referenced class.
    When a class is created, whether directly by create java ddl or by loadjava it has an attribute known as a resolver which is essentially a search path for schemas to look in when resolving names referenced in the class. The resolver is a list of pairs of the form ((<pattern> <schema name>)(<pattern> <schema name>)...). When the class is resolved any name X that it references is bound to a class object by iterating over the resolver from left to right identifying each term in which the name of X matches the pattern and looking to see whether a class with the name of X exists in the schema identified by the term. If such a class exists, the search stops and the name X is bound to that class. If after looking at all the terms there is no class found, then a resolution error occurs. The pattern can either be an explicit name, or an explicit prefix followed by '*' or simply '*'. The latter is the usual pattern used, and matches any name. The default resolver given when a class is created without explicitly specifying an alternate resolver is ((* <current schema>)(* PUBLIC)). A class with this resolver will be able to resolve names in its own schema or in PUBLIC. In your case you want the referencing class to have a resolver like
    ((* <current schema>)(* <the other schema>)(* PUBLIC))
    or some variation on this. An alternate resolver can be specified in loadjava using the -resolver argument, or in create or alter java ddl using the
    resolver ((...)...) syntax. This is all documented in the java developers guide.

  • Class is not appearing in "Java Batch Job Class Search" when trying to add.

    Hi,
    I have oracle CC&B 2.3.1, with SDK 2.2.0.12. I am trying to create new java batch job class by copying an existing one and modifying it to be used with new Batch Control .
    Steps are as follows:
    1-Created file by copying the exiting file
    CreateLatePaymentChargesProcess.java ; and only changing the name of the class:
    public class CmCreateLatePaymentChargesProcess
    extends CmCreateLatePaymentChargesProcess_Gen
    File location :
    D:\spl\ccb231\applycm\ssgc_patch\java\source\cm\ CmCreateLatePaymentChargesProcess.java
    D:\spl\ccb231\applycm\ssgc_patch\java\source\cm\ CmCreateLatePaymentChargesProcess_Gen.java
    2-Run ApplyCm build successfully , which generated these files:
    D:\spl\ccb231\java\target\cm\com\splwg\ccb\domain\billing\batch\ CmCreateLatePaymentChargesProcess.class
    D:\spl\ccb231\java\target\cm\com\splwg\ccb\domain\billing\batch\ CmCreateLatePaymentChargesProcess_Gen$1.class
    D:\spl\ccb231\java\target\cm\com\splwg\ccb\domain\billing\batch\CmCreateLatePaymentChargesProcess_Gen$CmCreateLatePaymentChargesProcessWorker_Gen$ThreadParameters.class
    D:\spl\ccb231\java\target\cm\com\splwg\ccb\domain\billing\batch\CmCreateLatePaymentChargesProcess_Gen$CmCreateLatePaymentChargesProcessWorker_Gen$ToDoProperties.class
    D:\spl\ccb231\java\target\cm\com\splwg\ccb\domain\billing\batch\CmCreateLatePaymentChargesProcess_Gen$CmCreateLatePaymentChargesProcessWorker_Gen.class
    D:\spl\ccb231\java\target\cm\com\splwg\ccb\domain\billing\batch\CmCreateLatePaymentChargesProcess_Gen$JobParameters.class
    D:\spl\ccb231\java\target\cm\com\splwg\ccb\domain\billing\batch\CmCreateLatePaymentChargesProcess_Gen.class
    All the above classes are part of CM.jar file
    ContextManagedObjects.xml ;  contains these information
    <com.splwg.shared.environ.ContextManagedObjectData>;
    <domainPackages/>
    <lookupFieldClasses class="tree-map">
    <no-comparator/>
    </lookupFieldClasses>
    <cobolAlgorithmInterfaceExtensions class="tree-map">
    <no-comparator/>
    </cobolAlgorithmInterfaceExtensions>
    </com.splwg.shared.environ.ContextManagedObjectData>;
    packageMetaInfo.xml was not created
    Still the class is not appearing in "Java Batch Job Class Search" when trying to add a new program name referencing this java class.
    I tried restarting the Tomcat application server, still not appearing.
    Where did I go wrong about it?
    Thanks
    Edited by: cc&amp;amp;amp;b-user on Jul 29, 2011 12:39 AM
    Edited by: ccb-user on Aug 2, 2011 9:28 PM
    Edited by: ccb-user on Aug 7, 2011 11:36 PM

    Hi,
    Did you copying the base file CreateLatePaymentChargesProcess.java?
    I also create a new batch job which copying the CreateLatePaymentChargesProcess batch code the only difference in getBills() method query and inner class CreateLatePaymentChargesProcessWorker extend CmCreateLatePaymentChargesProcessWorker_Gen, instead of CreateLatePaymentChargesProcessWorker_Gen.
    The batch is working fine in my end.
    Thanks,
    Atul Singh.

  • Java Class not apearing in Java Algorithm Class Search

    Hi,
    I installed oracle CC&B 2.3.1, with SDK 2.2.0.12. I am trying to create new java class by copying an exiting one and modifying it to be used with algorithm (Adhoc Char Value Validation).
    Steps are as follows:
    1-Created file by copying the exiting file AdhocNumericValidationAlgComp_Impl.java and only changing the name of the class:
    public class AK_AdhocNumericValidationAlgComp_Impl
    extends AK_AdhocNumericValidationAlgComp_Gen
    File location :
    C:\spl\CCB23DEV\java\source\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Impl.java
    2-Run Artificat generator successfully , which generated the files:
    C:\spl\CCB23DEV\java\sourcegen\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp.java
    C:\spl\CCB23DEV\java\sourcegen\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Gen.java
    C:\spl\CCB23DEV\java\target\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp.class
    C:\spl\CCB23DEV\java\target\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Gen.class
    C:\spl\CCB23DEV\java\target\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Impl.class
    Still the class is not appearing in "Java Algorithm Class Search" when trying to add a new algorithm type referencing this java class.
    I tried restarting the Tomcat application server, still not appearing.
    Where did I go wrong about it?
    Thanks

    Tomcat was down when I deployed the changes. It seems tomcat cannot find implemented interface AdhocCharacteristicValueValidationAlgorithmSpot
    The full error shows how tomcat is looking for the interface:
    Full error:
    - 2011-07-07 12:34:28,681 [main] ERROR (support.context.ContextFactory) Cannot find algorithm spot: 'com.splwg.base.domain.common.characteristicType.AdhocCharacteristicValueValidationAlgorithmSpot' for Cobol extension
    com.splwg.shared.common.LoggedException: Cannot find algorithm spot: 'com.splwg.base.domain.common.characteristicType.AdhocCharacteristicValueValidationAlgorithmSpot' for Cobol extension
         at com.splwg.shared.common.LoggedException.raised(LoggedException.java:65)
         at com.splwg.base.support.context.ContextFactory.extendAlgorithmSpots(ContextFactory.java:291)
         at com.splwg.base.support.context.ContextFactory.loadManagedObjectForApplication(ContextFactory.java:203)
         at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:106)
         at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:90)
         at com.splwg.base.support.context.ContextFactory.createDefaultContext(ContextFactory.java:498)
         at com.splwg.base.web.startup.SPLWebStartup.initializeApplicationContext(SPLWebStartup.java:178)
         at com.splwg.base.web.startup.SPLWebStartup.contextInitialized(SPLWebStartup.java:63)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:516)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
         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:592)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    - 2011-07-07 12:34:28,713 [main] INFO (web.startup.SPLWebStartup) Shutting Down the JMX Connectors...
    - 2011-07-07 12:34:28,713 [main] INFO (web.startup.SPLWebStartup) JMX Connectors shutdown successfully
    - 2011-07-07 12:34:28,713 [main] INFO (web.startup.SPLWebStartup) Shutting Down the Application Context...
    - 2011-07-07 12:34:28,728 [main] INFO (web.startup.SPLWebStartup) Application Context shutdown successfully
    Any advise ?
    Thanks

  • How to reference a DatabaseHandler servlet class from a jsp file in Tomcat

    Trying to create a database connection in the jsp file in webapps\project folder by referencing the DatabaseHandler class in webapps\project\WEB-INF\classes.
    Here is the code in the jsp to make the connection:
    DatabaseHandler db = new DatabaseHandler() ;
    String sql = "SELECT password FROM cms_users WHERE user =" + userName ;
    java.sql.ResultSet rs = db . selectQuery( sql ) ;
    Here is the DatabaseHandler class:
    import java.sql.*;
    public class DatabaseHandler
         // instance variables - replace the example below with your own
    private Connection connection;
         * Constructor for objects of class DatabaseHandler
         public DatabaseHandler()
    String url = "jdbc:odbc:javadatabase";
    // Load the driver to allow connection to the database
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    connection = DriverManager.getConnection( url );
    catch ( ClassNotFoundException cnfex )
    System.err.println( "Failed to load JDBC/ODBC driver." );
    cnfex.printStackTrace();
    System.exit( 1 ); // terminate program
    catch ( SQLException sqlex )
    System.err.println( "Unable to connect" );
    sqlex.printStackTrace();
    public ResultSet selectQuery( String query )
    Statement statement;
    ResultSet resultSet = null ;
    try
    statement = connection.createStatement();
    resultSet = statement.executeQuery( query );
    catch ( SQLException sqlex )
    sqlex.printStackTrace();
    System . exit( 1 ) ;
    return resultSet ;
    Here is the error i am getting when i try to run the jsp script:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 2 in the jsp file: /ValidateLogon.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\cms\ValidateLogon_jsp.java:47: cannot find symbol
    symbol : class DatabaseHandler
    location: class org.apache.jsp.ValidateLogon_jsp
    DatabaseHandler db = new DatabaseHandler() ;
    ^

    Just like in the class file you need to import any classes that you want to access in the JSP.
    http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html

  • How to reference an inner class with @link?

    Hi,
    Let's assume we have a class Test with an inner class namned InnerTest. If I want to put a @link to a method in InnerTest in another java-file, what do I write?
    To reference a method in Test, I write:
    {@link com.company.Test#method}
    My first thought when referencing the inner class' method was to just write:
    {@link com.company.Test.InnerTest#method}
    but this doesn't seem to be the correct way.
    Any help is greatly appreciated! Thank you in advance.

    You're calling the method in the inner class the right way.
    You're probably experiencing bugs with links.
    I don't know what version you're using, but 1.4.0 and
    1.4.1 have some severe bugs. Please see another
    thread in this forum entitled:
    "Some {@link} tags do not seem to generate hyperlinks"
    -Doug Kramer
    Javadoc team

  • Javadoc @throws clause at a class level for all methods

    hello
    If all my class's methods throw the same RuntimeException for the same reasons, is there a way to put a @throws clause at class level?
    I mean, I don't want to duplicate my comments for each of the methods I have. Say I want to add extra information... It would be a pain to copy paste same
    comment for all the methods.
    Thx in advance, any help welcomed :)

    kux wrote:
    hello again
    first of all, love your replay :). Nice to see people with good sense of humor :D
    Ok, I made the story shorter. Of course I don't throw a raw RuntimeException. What I have is a subclass of RuntimeException. Basicly all my methods use a sql Connection and do a certain querry on a database. What I do is that I don't let checked SQLException propagate through my methods because the clients of the persistance layer should not be required to handle the low level sql exeptions.Correct!
    Instead I catch them and rethrow them as DAOExceptions that SUBCLASS RuntimeException. Unusual... but... Hmmm... I can't say that's actually "bad practice", per se, but DAOException is traditionally a checked exception type thrown only from the very top of the DAO specifically so that clients must catch (or explicitly throw) it... Hmmm..
    Basicly I used sun's DAO pattern: http://java.sun.com/blueprints/patterns/DAO.html.
    That's be The GOF's pattern... but yeah, good choice.
    I made the question shorter because this is not the point. The question was about javadoc, not my programming practices :)But, but, but...
    Ok... Ah... Ok.... Ummm, No. At least Not That I Know Of... BUT, what you can do is summarise your exception handling strategy once in the class summary section, and just reference it in each throws clause... you can stick intra-page links in java doc (I've seen them, just not sure how they're done, I think the syntax is something like {@link:anchor}... but that's just something I once saw somewhere... not gospel.
    Also, if a method has throws DAOExceptions for an "odd" reason (like invalid data retrieved successfuly from the database (yes, it happens)) then you can still document that case in the method.
    If your exception handling is really worth talking about then an external article referenced in the class summary. We use a wiki (http://en.wikipedia.org/wiki/DokuWiki) for such purposes, and many others including research schedules and papers, and (increasingly) design doco, even though that's outside the "official process" we find the wiki so much more convenient (i.e. searchable), especially since it's become possible to convert (simple) word-doc's straigth to wiki markup.
    But, but, but... Programming practices are so much more interesting than documentation... who ever complained about in the documentation (besides me I mean).
    Cheers mate. Keith.

Maybe you are looking for

  • X11 / xterm won't even launch anymore

    I was using X11 with the minor glitches (i.e. cannot move x11 windows to secondary display). For some reason, x11 stopped working altogether today. I go to /Applications/Utilities/X11 and nothing happens. I checked /var/log/system.log and it has the

  • Contact Picture Size for iPhone Calls (4S, iOS 6.1.1)

    I recently updated to iOS 6.1, and even more recently to 6.1.1.  My problem is when I receive a phone call, the contact's picture is now full screen. Previously, it was a thumbnail size picture in the top right area of the screen.  I much rather pref

  • Text Content of Document is returned as null

    Hi All, I am trying to use the JTidy parser to parse an input HTML string. But when I am trying to type the content of the Document, it is returning null. I am new to DOM parsing, so is there anything that I am doing wrong? Any pointer will be very h

  • What is the best way of embedding a PDF in an article?

    The only way I was able to get this to work was using a web overlay to link to an online source. I don't want to create a button that links to the PDF. I want to embed a PDF that is in the HTMLResources.zip.

  • Possible new version of Flashback trojan

    Dear all, today I experienced some problems just like the people in these two threads: https://discussions.apple.com/thread/3355170?tstart=0 https://discussions.apple.com/message/16280207#16280207 Among others, my finder sidebar suddenly said SD5, SD