Synchronized modifier not allowed in interface

My understanding of an interface is that it defines a contract. The synchronized modifier can be an important part of the contract. So why doesn't Java allow for declaring some methods of an interface to be synchronized?
I just came across this again, let me try to illustrate:
public
interface IfcX
   void updateConsistently( double a, double b );
}As Java doesn't let me specify synchronized in the interface, I introduce an abstract class where I can make the method synchronized:
public
abstract
class someXBase
   public
   synchronized
   // Java does not let me make this an abstract method!
   void updateConsistently( double a, double b )
   { /* Java does not let me provide no body! */ }
}This class still has a problem: I provided an empty body, while actually I did want to keep that method abstract. The empty body produces a potential for bad surprises for naive extenders of someXBase. The empty body violates the principle of "minimum surprise". If I forget to redefine the method in an extension of someXBase, then I'm in trouble. And it will be easy to forget when there are many methods like this.
public
class someX
extends
   someXBase
   /* These attributes must not go into someXBase,
      as they belong to the concrete implementation only,
      not to the contract: */
   protected double _a ;
   protected double _b ;
   public
   synchronized
   void updateConsistently( double a, double b )
      synchronized (this)
         _a = a ;
         _b = b ;
}someX is how it should be. Only one client can be inside updateConsistently at any time, and the implementation of updateConsistently makes sure that method only updates a and b when nobody else is reading or writing any of them.

My understanding of an interface is that it defines a
contract. The synchronized modifier can be an
important part of the contract.
So why doesn't Java
allow for declaring some methods of an interface to be
synchronized?I disagree. Synchronization is an implementation detail only.
Thread safety however can be an important part of the contract, but the relevant part of the contract to specify that is in public documentation.
This class still has a problem: I provided an empty
body, while actually I did want to keep that method
abstract. I fail to see why you have done this - anybody can override the method anyway and not declare it synchronized. If you want to make sure somebody overrides the method, then it can help to throw an exception by default (the most appropriate in such a case would be an UnsupportedOperationException),
If you want client code to ensure thread safety, then document your code properly - If you provide an interface whose JavaDoc says "All methods are thread safe" or something similar, then anybody implementing the interface so that it is not thread safe has violated that contract. This is similar to providing documentation that says the draw method for a Shape, that takes a Canvas as a parameter, should draw the Shape on the Canvas - you have no way of forcing somebody to do that, so you rely on them conforming to the interface's contract (usually just its JavaDoc is enough).
If you were to force client code to synchronize a particular method, then you would be dictating the implementation. You need to bear in mind somebody may be able to write the code so that it is thread safe without declaring a particular method synchronized (in fact, this will always be the case), and in that situation you may be causing undue contention (and thus slowing down execution) by forcing the method to be synchronized; You might also make it difficult to avoid deadlock if the implementor wants to synchronize on different objects.

Similar Messages

  • Private modifier not allowed within Interface

    hello,
    Can someone explain to me the logic behind not being able to declare a method's modifier as "private" when defining my Interface? When I do so the compiler generates the following error:
    "modifer private not allowed here at line 23, column 16"
    I change it back to public and its fine. One would think that the compiler would allow one to declare a method private within an Interface so long as the Implementation matches? Thanks in advanced.

    The idea behind interfaces is to provide information to the outside world about a class that implements the interface. Specifically, it lets the outside world know about certain methods that can be called on instances of that class. That way, a class can use instances of any class that implements a given interface rather than commiting itself to one specific implementation only.
    Since the outside world cannot see private methods, it doesn't make sense for interfaces to prescribe private methods in the first place. In fact, how a class deals with implementing a method is none of the interface's business...

  • Modify not allows to Edit file in Sequencer

    Hi,
    I am trying to edit a file in Sequencer (5.0 sp2) that can be opened with Notepad after local installation.
    When right click on file there are : Add Delete Modify.
    When click Modify it provides the box for a path. I guess Modify means Replace...
    Do I am missing something?
    --- When you hit a wrong note its the next note that makes it good or bad. --- Miles Davis

    Falco,
    thanks for explanation on editing in sequencer...
    Can I change/replace the file in c:\Program Files\Program_NAME after installation is done in sequencer and before clicking
    I am finished installing.
    I want to be sure that it will take effect in the package. I think Yes.
    I prefer to have the file replaced before Running the app for first feature block...
    And it will be more appropriate than replacing the file in sequencer before saving.
    Please confirm that I can replace file/files before clicking I am finished installing.
    --- When you hit a wrong note its the next note that makes it good or bad. --- Miles Davis

  • "modifier interface not allowed here" compiler error

    Consider the following code fragment:
    public void someMethod(int val){
    interface ISomeInterface {int anyval=10;}
    This does not compile ("modifier interface not allowed here"). What am I missing? Thanks in advance.
    Ref: http://www.norvig.com/java-iaq.html#fold

    Nothing to apologise. The posting is almost like ...
    public void someMethod(int val){
    static int x;
    but its is different. Thanks.
    It's completely different than that. It's just like this:
    public class SomeClass {
      public void someMethod(int val) {
        public class SomeClassWithinAMethodWhichIsNotAllowed {
          // members of illegal class go here
        // local variables and code for someMethod go here
      // other members of SomeClass go here

  • Modifier final not allowed here

    This code does not comile under 1.5 beta2 (it did under beta1 and I think it should)
    public interface Table<R extends Row>
    public static final enum OpenMode { READONLY,  NORMAL }; // <-- modifier final not allowed here

    The compiler said about the following code :
    A is not abstract and does not override abstract method m() in Test.I // static enum A implements I {
    enum A implements I {
    toto {
    public void m() {
    //public abstract void m();
    two remarks :
    1) In my opinion, this could should compile. A must be tagged abstract by the compiler
    and because all subtype of A implements I there is no problem.
    2) Note that there is some inconstancies in the compiler message, with the new rule,
    Testa.A acnnot be declared abstract.

  • VLANs 133-134 on Interface port-channel10 are being suspended. (Reason: Vlan is not allowed on Peer-link)

    I just added 2 vlans Port-channel10 on two of my Nexus 5000's that go from the to a 6509 Catalyst switch. I get this error when I do a show log:(VLANs 133-134 on Interface port-channel10 are being suspended. (Reason: Vlan is not allowed on Peer-link) When I do a sh int trunk I see Po10 (int Eth1/3) that Vlans Err-disabled on Trunk. Another odd thing when I do an spanning tree summary neith 133 or 134 is added in to the summary? Why would spanning-tree be ignoring these two new vlans?
    They are configured as so:
    interface port-channel10
    description "vpc 10 eth1/3 to 6506 po10 ten5/4"
    switch port mode trunk
    switchport trunk native vlan 999
    switchport trunk allowed vlan 130.,133-134,139,145,155,160-175,239,242,254,999
    vpc10
    What can I do to get 133 and 134 vlans to stop erroring on Port-channel 10 on both Nexus 5000's?

    Firstly I should say I have not used Nexus switches so the following advice should be treated with caution.
    Have you added the same vlans to the allowed vlans on your vPC peer link. That is what the error message seems to be telling you ie. they are not currently allowed.
    They need to be allowed otherwise the vlans are suspended which is what is happening.
    As I say I haven't used these switches so I can't say for sure if there is any downtime/disruption when you modify the allowed list but I think that is your problem from what I can see.
    Jon

  • Reg : "Error multiple Receivers are not allowed for Synchronous calls"

    Hi All,
    Can somebody tell me why I am getting this error "Error multiple Receivers are not allowed for Synchronous calls" when I am using Synchronous Soap Request to WebService and the response from webservice is being sent to multiple receivers which are Business services based on Receiver determination condition(Services W/o Party).

    Hi , If you are simply looking up data (and not updating tables ) using RFC you can use RFC Lookup APIs to create a java mapping
    The source message has to be a RFC request message interface and target should be RFC response message interface.
    Also you can use three step mappings in a single interface mapping.
    1. from your request message to RFC request message mapping
    2. java mapping which will do the lookup and give you rfc response back
    3.rfc response to your target response mapping.
    PS: RFC lookup can be used if there are not may hierarchy in the RFC Response structure. (i.e. may be 3 or 4 level nesting permitted)
    To help you further
    The following is a link which gives you access to a ready made source code. you just need to compile it and create a jar and import the mapping in imported archive
    http://knowhowsapxi.synthasite.com/rfc-loolup.php
    Edited by: Progirl Progirl on Oct 31, 2008 1:33 PM

  • No Plug-In specified and not allowed to bring up user interface

    Hello,
    We have several users here getting an error when trying to sign a pdf with Adobe's digital signature.  When they click in the field box to sign the document they are getting the following error,"No plug-in specified and not allowed to bring up user interface for selection."  We are using Adobe acrobat 9 standard with the latest updates.  I have done a total uninstall and reinstall and recreated the digital signature and still the error persists.  I have gone as far as renaming the windows profile and nothing seems to work.  Any thoughts?
    Aaron

    A signature field may have associated so-called "seed values" that specify certain signature properties and restrictions. The document's author can associate "seed values" with an unsigned signature field. One of the "seed values" specifies which external signature plug-in must be used to sign this signature field. If you do not have the required plug-in in the Acrobat installation then you cannot sign this signature field. This is the most likely reason that you get this error message. In some environments this is done to restrict the signing to only signing credentials that reside on hardware modules or signing pads. There might be other reason why the document's author chose to put in this restriction.
    Contact the author of the document you are trying to sign and find out whether this is the case and if it is then which plug-in you need and where you get it from.

  • Duplicate class, modifier private not allowed

    I can't get javadoc to create doc for any class I make, I keep on getting these errors
    here is the class:/**
    * Like Integer, but isn't.
    * @author Phillip Bradbury
    public class Int
      /** the internal value */
      private int i;
       * Creates an Int.
      public Int(int val)
        i = val;
       * Gets the value passed in the constructor.
       * @returns the value
      public int get()
        return i;
    }and the error:cspc49-c3018900: javadoc temppack -d doc
    Loading source files for package temppack...
    Constructing Javadoc information...
    /nfs/student1/csse/c3018900/./temppack/Int.java:5: duplicate class: Int
    public class Int
           ^
    /nfs/student1/csse/c3018900/./temppack/Int.java:8: modifier private not allowed here
      private int i;
                  ^
    javadoc: warning - No source files for package temppack
    Standard Doclet version 1.4.1
    Generating doc/constant-values.html...
    javadoc: No public or protected classes found to document.
    1 errors
    3 warningswhat am I missing?
    I've tried using -classpath and -sourcepath with a lot of different weird and wonderful paths (including ., temppack/ and somewhere completely unrelated to Java), i've tried it with a compiled .class file there and not there, i've tried remaning the class and package to random gibberish in case there was a conflict, and now I'm out of ideas.
    Thanks in advance,
    =====
    Phlip

    This is curious.
    classes
    +-doc
    +-temppack
    doc is empty, and temppack contains only Int.java
    ...but if I run
    javadoc temppack -d doc
    in the classes folder I get the duplicate class / private
    not allowed errorsIf you're using 1.4.1, it has a bug that you might be seeing
    that is present in 1.4.0 and 1.4.1 but in no other versions.
    I recommend you upgrade to 1.4.2, which fixes this bug:
    Execution: Fixed so duplicate classes are documented (4673477, tool, REGRESSION)
    http://developer.java.sun.com/developer/bugParade/bugs/4673477.html
    Here is the list of other enhancements in 1.4.2:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/whatsnew-1.4.2.html
    execute the following on the commandline
    javadoc -package temppack
    Yep, it works perfectly with -package there!The -package option should make a difference only if
    your class or members are package-private (which they are not).
    The default is to allow public and protected program elements
    to be documented. When you add -package, all it does is
    also package-private program elements to be documented:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#package
    -Doug

  • The Apple drivers that are downloaded for my HP printers do not allow me to modify the settings as I could when I was running a pc.

    The Apple drivers that are downloaded for my HP printers do not allow me to modify the settings as I could when I was running a pc.  Is there someway to get a printer driver that will permit full access to printer settings?

    Perhaps you don't have the correct driver selected.
    Try to Add it again, but instead of Auto-Select, choose Select Printer Software, then make sure you have the correct printer selected.
    If the driver you have says "Gutenprint" then that isn't the HP driver and might not have all the features.
    If you have the correct driver, the only thing you can do is contact HP and ask them to add the features.

  • ASA5550 port channel configuration ERROR: nameif not allowed on empty etherchannel interface

    Hi All,
    I am having problem when configure port channel on asa5550 
    IOS ver asa914-k8.bin also in ver 9.02   and 8.47.
    Please let me know how can I solve this problem.
    UK-LON-FW(config)# int port-channel 3
    UK-LON-FW(config-if)# vlan 245
                           ^
    ERROR: % Invalid input detected at '^' marker.
    UK-LON-FW(config-if)# nameif secure
    ERROR: nameif not allowed on empty etherchannel interface.
    UK-LON-FW(config-if)#
    here is my interfaces configuration:
    interface GigabitEthernet0/0
    description fw1:G0/0 to uk-lon-gw1:e1/8 fw2:G0/0 to uk-lon-gw2:e1/9 outside zone
    channel-group 1 mode on
    no nameif
    no security-level
    no ip address
    interface GigabitEthernet0/1
    description fw1:G0/1 to uk-lon-gw2:e1/8 fw2:G0/1 to uk-lon-gw1:e1/9 outside zone
    channel-group 1 mode on
    no nameif
    no security-level
    no ip address
    interface GigabitEthernet0/2
    description fw1:G0/2 to uk-lon-sw1a:1 fw2:G0/2 to uk-lon-sw1a:2 dmz
    channel-group 2 mode on
    no nameif
    no security-level
    no ip address
    interface GigabitEthernet0/3
    description fw1:G0/3 to uk-lon-sw1b: fw2:G0/3 to uk-lon-sw1b:2 dmz
    channel-group 2 mode on
    no nameif   
    no security-level
    no ip address
    interface Management0/0
    management-only
    nameif management
    security-level 0
    ip address 10.10.51.18 255.255.254.0
    interface GigabitEthernet1/0
    description fw1:G1/0 to uk-lon-sw1a:3 fw2:G1/0 to uk-lon-sw1a:4 secure zone
    no nameif
    no security-level
    no ip address
    interface GigabitEthernet1/1
    description fw1:G1/1 to uk-lon-sw1b:3 fw2:G1/1 to uk-lon-sw1b:4 secure zone
    no nameif
    no security-level
    no ip address
    interface GigabitEthernet1/2
    description LAN Failover Interface
    no nameif   
    no security-level
    no ip address
    interface GigabitEthernet1/3
    description STATE Failover Interface
    no nameif
    no security-level
    no ip address
    interface Port-channel1
    description outside zone
    no nameif
    no security-level
    no ip address
    interface Port-channel1.5
    description outside zone Bundle FW:G0/0-G0/1 connect to GW1:e1/8-GW2:e1/8
    vlan 5
    nameif outside
    security-level 0
    ip address 216.239.105.5 255.255.255.128 standby 216.239.105.6
    interface Port-channel2
    description dmz Bunlde uk-lon-fw:G0/2-3 to sw1a:1-2 sw1b:1-2
    no nameif
    no security-level
    no ip address
    interface Port-channel2.105
    description dmz
    vlan 105
    nameif dmz
    security-level 50
    ip address 216.239.105.193 255.255.255.192 standby 216.239.105.194
    interface Port-channel3
    description secure zone Bunlde uk-lon-fw:G1/0-1 to sw1a:3-3 sw1b:3-4
    no nameif
    security-level 100
    ip address 10.254.105.1 255.255.255.0 standby 10.254.105.2
    UK-LON-FW(config-if)# 

    Hi Marvin,
    Thank you for your answer.  I did everything but it did not work. Turn out it is a bug ver 8.45 will let you created the sub logical interface but actually it did not work right.  Verson 9.x  doesn't let you create more than 2 port channel (limitation of ASA5550 hardware).
    https://tools.cisco.com/bugsearch/bug/CSCtq62715/?reffering_site=dumpcr 
    Also, you can see the 8.4 release notes were you can see that it is not supported:
    http://www.cisco.com/c/en/us/td/docs/security/asa/asa84/release/notes/asarn84.html#pgfId-522232
    Interface Features
    EtherChannel support (ASA 5510 and higher)
    You can configure up to 48 802.3ad EtherChannels of eight active interfaces each.
    Note You cannot use interfaces on the 4GE SSM, including the integrated 4GE SSM in slot 1 on the ASA 5550, as part of an EtherChannel.
    We introduced the following commands: channel-group , lacp port-priority , interface port-channel , lacp max-bundle , port-channel min-bundle , port-channel load-balance , lacp system-priority , clear lacp counters , show lacp , show port-channel .

  • Static method allowed in interface?

    Hello,
    I've written the following code:
    package a.b.c.d;
    import java.util.Map;
    public interface Adapter
    public void execute(Mapping mapping) throws Exception;
    public static Map getParameters( ) throws Exception;
    My compiler complains thusly:
    "Adapter.java": Error #: 217 : modifier static not allowed here at line 8, column 23
    Is it illegal then to declare a static method in an interface and if so why? Thanks in advance!
    -Exits

    An interface itself is just a contract that says "I will implement thus-and-such methods with such-and-such a signature." The interface has no "meat" to it, so it can't implement the static.
    Now you're thinking, if MyClass implements MyInterface, then MyClass can just have a static method that is the one on MyInterface. The problem is with how you're getting your MyInterface-type object. You can do it like this:
    MyInterface obj = new MyClass();
    obj.myStaticMethod(); //Bzzzzzzzt! blows up at compile time...or...
    MyInterface obj = someMethodThatReturnsClassImplementingMyInterface();
    obj.myStaticMethod(); //Bzzzzzt! same problemYou can't call a static method on an instance; you have to call it on the class,
    MyClass.myStaticMethod();You can't call it on the interface directly because, again, the interface has no guts inside it. There's really no reason to put a static method on an interface because that's not what interfaces are for. If MyClass needs a static, put it there.

  • UPS and our iMac // Will not allow iMac to sleep.

    Hello,
    We have a Cyberpower UPS (CP685AVR) for our 20" iMac 2.66Ghz (last gen)and it works great. It has a USB interface to communicate with the iMac's power manager, and tells me how much juice is left, how the cells are doing, etc.
    The only problem is the UPS will not allow the iMac to sleep; if I try to manually put it to sleep, it will wake again in 10-15sec. If I disconnect the UPS, the iMac works just fine. There are no third-party drivers, either. Cyberpower relies on Apple's built-in UPS support. I've been leaving the USB cable unplugged but would like like to use it if possible.
    Has anyone had an issue like this, and what has been your experience? Thanks.

    I won't buy Cyberpower anymore since I had one burn up on me so I have not had any experience with their newer models. I have 2 APC's and they work fine with the built in Energy Saver settings.
    Are you connecting the USB directly to the back? I'm not sure if it will help but you might try resetting the SMC: http://support.apple.com/kb/HT1543?viewlocale=en_US
    George

  • The MacBook Pro will not allow me to cut-and-paste to and from or to click-and-drag to the external drive. I can copy-and-paste, but then I must send the original to the trash, which doubles the time and effort. Is there any way to cut-and-paste?

    I have recently switched from a PC to a MacBook Pro.
    I have a large number of documents and photographs on a multiterrabite external drive, backed up on a second multiterrabite external drive.
    Both external drives are formatted for MacIntosh. This has been verified by agents at an Apple store and also at Best Buy in two different cities.
    This is the problem:
    The MacBook Pro will not allow me to cut-and-paste to and from or to click-and-drag to the external drive. I can copy-and-paste, but then I must send the original to the trash, which doubles the time and effort. Is there any way to cut-and-paste?
    Also, the MacBook Pro will not allow me to rename multiple documents or photographs. I can click-and-rename a single one, but this is impossibly time consuming. I can batch-rename in iPhoto, but when I transfer the photographs to the external drive, the rename does not transfer.
    I’m reduced to using my wife’s Toshiba to cut-and-past, rename, and transfer documents. It works perfectly. Is there any way to do this on the MacBook Pro?
    Thanks!
    Roderick Guerry
    [email protected]

    Roderick Guerry wrote:
    The MacBook Pro will not allow me to cut-and-paste to and from or to click-and-drag to the external drive. I can copy-and-paste, but then I must send the original to the trash, which doubles the time and effort. Is there any way to cut-and-paste?
    No, this is a philosophical difference between Apple and Microsoft. Apple believes that it's dangerous to cut a file in case the user never pastes it; in that case the file is lost. Microsoft seems to not have this problem (if I remember Windows correctly) because they don't delete the originating file if it's cut but never pasted.
    Even though Macs have a lot of keyboard shortcuts, philosophically Macs have traditionally been mouse-first. This applies to file copy operations. In your case, what a Mac user would do is open the source window, open the destination window (on your second drive), and then Command-drag the selected files from the source to destination window. This is because a normal drag would leave the originals behind, while adding the Command modifier key tells OS X that this is a Move, not a Copy, so don't leave the originals behind.
    (In addition there are different rules for drag-copying within the same volume or between different volumes. If you drag between two folders on the same volume, the files are moved. If you drag between different volumes, the files are copied unless you hold down Command to delete the copies on the source volume.)
    Roderick Guerry wrote:
    Also, the MacBook Pro will not allow me to rename multiple documents or photographs. I can click-and-rename a single one, but this is impossibly time consuming. I can batch-rename in iPhoto, but when I transfer the photographs to the external drive, the rename does not transfer.
    Two problems in this case. First, batch file renaming is not built into OS X unless you build something with Automator. However, there are many utilities that can do batch file renaming which you can find at macupdate.com or on the App Store. Since I work with media I often batch rename using one of the media managers I have lying around like Media Pro or Adobe Bridge (comes with Photoshop).
    iPhoto is a database front end designed to shield the file system from the consumer and let them concentrate on creativity and sharing. As such it is often a poor choice for managing files directly. When you "transferred the photographs" chances are you moved the originals, not the ones iPhoto edited which are stored in a hidden folder.
    Roderick Guerry wrote:
    I’m reduced to using my wife’s Toshiba to cut-and-past, rename, and transfer documents. It works perfectly. Is there any way to do this on the MacBook Pro?
    There will not be a way to do it exactly like Windows. As described above, there are ways to do it "the Mac way." If it is possible to remove judgment on which way is "better" you might find the Mac way to be acceptable, but of course sometimes we simply prefer what we're used to.

  • Not allowed to look up a remote bean

    Hello everyone,
    I am getting the following error when I am attempting to do a remote lookup of a bean deployed within the same computer but in another OC4J instance. So I am using OC4J embedded into OracleAS.
    [ApplicationServerThread] DEBUG game.GameManager 2003-04-23 11:30:20,625 - Game Driver URL = localhost:3111/loto User= admin Pass:admin
    [ApplicationServerThread] DEBUG game.GameManager 2003-04-23 11:30:20,625 - Get Initial Context
    [ApplicationServerThread] DEBUG game.GameManager 2003-04-23 11:30:20,625 - Context Lookup ID=loto
    [ApplicationServerThread] ERROR game.GameManager 2003-04-23 11:30:20,640 - Game (loto)Driver Loading Error
    java.lang.SecurityException: Not allowed to look up loto, check the namespace-access tag setting in orion-application.xml for details
         at com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1530)
         at com.evermind.server.rmi.RMIConnection.lookup(RMIConnection.java:1701)
         at com.evermind.server.rmi.RMIServer.lookup(RMIServer.java:470)
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:109)
         at javax.naming.InitialContext.lookup(InitialContext.java:350)
         at com.mot.vla.game.GameManager.getGameDriverFromURL(GameManager.java:286)
         at com.mot.vla.game.GameManager.getGameDriver(GameManager.java:262)
         at com.mot.vla.game.GameManager.getGameDesc(GameManager.java:78)
         at com.mot.vla.kernel.VlaPlayerKernel.getGameDescription(VlaPlayerKernel.java:147)
         at VlaPlayerKernelRemote_StatefulSessionBeanWrapper8.getGameDescription(VlaPlayerKernelRemote_StatefulSessionBeanWrapper8.java:1039)
         at com.mot.vla.ui.core.CoreServices.getGameDescription(CoreServices.java:677)
         at com.mot.vla.ui.core.CoreEngine.actionDispatcher(CoreEngine.java:163)
         at com.mot.vla.ui.core.CoreEngine.renderDocument(CoreEngine.java:122)
         at com.mot.vla.ui.core.CoreEngine.processRequest(CoreEngine.java:106)
         at com.mot.vla.ui.servlet.RequestHandler.doPost(RequestHandler.java:204)
         at com.mot.vla.ui.servlet.RequestHandler.doGet(RequestHandler.java:179)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:244)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    I do not what is wrong with my code or other files. I included them for reference.
    static public Context getInitialContext(String url, String user,
    String password) throws Exception {
    Hashtable env = new Hashtable();
    // set the environment properties
    //env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClientInitialContextFactory");
    System.out.println("Get Initial Context");
    logger.debug("Get Initial Context");
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "jazn.com/"+user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    env.put(Context.PROVIDER_URL, "ormi://"+url);
    env.put("dedicated.connection","true");
    //env.put("dedicated.rmicontext","true");
    try {
    // create an initial context using the above environment properties
    return (new InitialContext(env));
    catch (Exception e) {
    System.out.println("Context initializtion error");
    e.printStackTrace();
    logger.error("Context initializtion error", e);
    return null;
    public GameDriverRemote getGameDriverFromURL(String id, String url,
    String user, String password) {
    try {
    Context context = getInitialContext(url, user, password);
    logger.debug("Context Lookup ID="+id);
    Object obj = context.lookup(id);
    if (obj!=null) {
    logger.debug("Context Lookup found :"+id+" Class Name = "+obj.getClass().getName());
    GameDriverHome gameDriverHome = (com.mot.vla.game.GameDriverHome) PortableRemoteObject.narrow(obj, com.mot.vla.game.GameDriverHome.class);
    if (gameDriverHome != null) {
    System.out.println("Game (" + id + ") Driver Home Interface Found");
    logger.debug("Game (" + id + ") Driver Home Interface Found");
    GameDriverRemote gameDriverRemote = (com.mot.vla.game.GameDriverRemote) PortableRemoteObject.narrow(gameDriverHome.create(), com.mot.vla.game.GameDriverRemote.class);
    return gameDriverRemote;
    catch (Exception e) {
    logger.error("Game (" + id + ")Driver Loading Error", e);
    return null;
    here are the parameters being passed
    url= localhost:3111/loto user = admin password=admin
    and here is my orion-application.xml
    <?xml version = '1.0'?>
    <!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application runtime 1.2//EN" "http://xmlns.oracle.com/ias/dtds/orion-application.dtd">
    <orion-application deployment-version="9.0.2.0.0" default-data-source="jdbc/OracleDS">
         <ejb-module remote="false" path="LotoGameDriver.jar"/>
         <persistence path="persistence"/>
         <principals path="principals.xml"/>
         <jazn provider="XML" location="jazn-data.xml"/>
         <log>
              <file path="application.log"/>
         </log>
         <namespace-access>
              <read-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role>">
                             <group name="jazn.com/administrators"/>
                        </security-role-mapping>
                   </namespace-resource>
              </read-access>
              <write-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role>">
                             <group name="jazn.com/administrators"/>
                        </security-role-mapping>
                   </namespace-resource>
              </write-access>
         </namespace-access>
    </orion-application>
    Any help would be appreciated

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Bernie Yee ([email protected]):
    If you want to lookup an environment variable from a remote client, you need to set "namespace-access" tag in orion-applica
    tion.xml. Otherwise, you will have no access to the jndi namespace.<HR></BLOCKQUOTE>
    I added this xml part to my orion-application.xml and it is working now. In the default application only the administrators group have access to the context.
    <namespace-access>
    <read-access>
    <namespace-resource root="">
    <security-role-mapping >
    <group name="users" />
    </security-role-mapping >
    </namespace-resource>
    </read-access>
    <write-access>
    <namespace-resource root="">
    <security-role-mapping >
    <group name="users" />
    </security-role-mapping >
    </namespace-resource>
    </write-access>
    </namespace-access>
    I found no documentation about this topic.

Maybe you are looking for

  • Secured WebDAV Mounted Volume Authorization Issues

    I use a secure WebDAV mounted volume from myDisk.se and up until the latest Security Update have had zero issues being able to manipulate files and folders as I would on a normal volume. However, since the installation of the Security Update (2009-00

  • Fiscal Period Definition

    Is there a way to use the 13 months setting for a fiscal year, but have the periods defined as 4-3-3-3, instead of 4 for all?

  • Once payment received  for bill system should not allow to cancel

    Hi  Experts , we have created  commercial  invoice  and posted to fi document and    payment  received  from party.but when  we  try to  cancel  the same billing document system allowing  to  cancel the document.So Client  requirement  is once  payme

  • Problem with my macbook -PLEASE HELP!

    when i swtch my macbook on the sceen lits up for two seconds and then goes black. i tried all the instructions in the booklet but when i was installing the mac os x again (had the first disc in) there came a note that i have to replase disc 1 by disc

  • Adjustments during HDR process in CS6

    During the HDR process in CS6 a menu come up with an assortment of adjustments. I am able to grab the sliders and slide them from end to end of the adjustments, however as far as I can tell there is no effect on the image.  Am I doing something wrong