Wish to prevent application starting threads

Hi,
I wish to prevent my standalone java application from executing threads.
I ensure the permission,      java.lang.RuntimePermission "modifyThreadGroup" is not in the policy file.
According to http://java.sun.com/j2se/1.4.2/docs/guide/security/permissions.html, I believe the application should not be able to instantiate new thread objects.
To test it, I run the code:
          Runnable tonyRunnable = new Runnable() {
               public void run() {
                    System.out.println("tony says it's cool!");
          Thread t = new Thread(tonyRunnable);
          t.start();
          t.join();And it runs. I expect a security exception but don't get it. I am 100% confident my application has a security manager and policy file.
Any ideas?
Thanks.

You're not doing anything with ThreadGroups in the code above. The modifyThreadGroup target of RuntimePermission is for allowing:
"modification of thread groups, e.g., via calls to ThreadGroup destroy, getParent, resume, setDaemon, setMaxPriority, stop, and suspend methods"
There is no way to prevent an application from creating and starting its own threads.

Similar Messages

  • How  can you load local server urls on application start?

    Background:
    I've been searching for close to two days for an answer to this question, it's full of gotchas and I can't quite get it figured out.
    I have an application which contains several web services. These services load up listeners when the services are invoked which makes them available for input. The user has the option of disabling automatic load of these services and invoking them manually by typing in the local url and starting the app. The can allow the autoload which uses a the or allowing the auto load to start. Currently the local url is hardcoded in a property file and this is how the services knows the local endpoint to envoke when it autostarts.
    <servlet id="AutoStart_01">
    <servlet-name>autoStart</servlet-name>
    <servlet-class>com.loadmy.StartupClass.Here</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    This works all fine and well until it's deployed onto a machine that runs a local weblogic cluster that has more than one jvm (and multiple ports) loading the application up.
    Problem
    The question is, how can you get the applicaton to recoginize the local url for the jvm that is running which can be on different ports? Here's what I've tried
    A - Using Inet.Address - This doesn't let you know what port your application is on
    B - Using the load servlet on start up ( Only the init() function is called and the request object hasn't been created and the request object is what contains ther protocol, server and port information)
    C - Loading a jsp page (READ... purposefully loading a jsp page) on application start. The thought here is that this contains a request object, but unfortunately on this doesn't work in my servlet container (currently tomcat 6 but the application is for a web logic machine)
    D - I thought about possibly using System.properties() but no luck there
    I'm at witts end on this one and I know there is something that can recoginze the local servlet container and extract the url and port from it.
    Any suggestions would be great.
    Flabergasted [sic]

    Hi,
    I had a simmilar requirement once, i also had to display some meaningful message with the busy mode icon, but i guess that comes directly from the WD Framework and is not possible to be changed. Refer the following thread, i raised that time.
    Web Dynpro ABAP
    Dont have much idea if somethig exists in portal for this.
    Regards,
    Runal

  • Pre-load the Cache during Application-Start Up

    Our requirement is to pre-load the cache during the application start-up most probably during Authentication/Authorization Service is invoked.
    We plan to load the data for other services from database into Coherence cache so that when user access that particular service he ends up hitting the Cache instead of database.
    Any pointers/suggestions on how to pre-load the cache during application start-up would be greatly appreciated. We are using Spring, Hibernate, Weblogic Web Services
    Regards,
    Bansi

    Hi Bansi,
    I were using following approach.
    First, we never use CacheFactory.getCache() in application code instead all instances of named cache were injected.
    On server side, I have an CacheInitializerBean which were starting cache preloading process (in separate thread). After preloading a special marker entry were put to the cache, indicating what data in the cache are consistent.
    When injecting named cache instance, we use a factory. This factory use CacheFactory.getCache() internally, but it check presence of marker object in cache an blocks until marker object will appear.
    Well in practice things are little more complicated but this is basic idea.
    Preload cache asynchronously and use marker to indicate completion of loading process.
    Hope this will help.
    Regards,
    Alexey

  • Error starting thread: Not enough storage is available to process...

    Hi all,
    We are seeing server going down frequently with below exception:
    [ERROR][thread ] Failed to start new thread
    [2010-04-08 14:36:54,046][ERROR][com.astrazeneca.portal.rss.ContentTransformer] - Error processing item:null
    ; SystemID: http://beaa.astrazeneca.net:10002/NewsBroker/resources/newsToRss.xsl; Line#: 21; Column#: 128
    javax.xml.transform.TransformerException: java.lang.Error: Error starting thread: Not enough storage is available to process this command.
         at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:403)
         at org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFunction(ExtensionHandlerJavaPackage.java:426)
         at org.apache.xalan.extensions.ExtensionsTable.extFunction(ExtensionsTable.java:220)
         at org.apache.xalan.transformer.TransformerImpl.extFunction(TransformerImpl.java:437)
         at org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunction.java:199)
         at org.apache.xpath.XPath.execute(XPath.java:268)
         at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:279)
         at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:247)
    I have a weblogic support SR open and they suggested to add -XXtlaSize and -XXlargeObjectLimit to our JVM parameter. With these parameters, we are getting below error in Windows frequently:
    Reporting queued error: faulting application java.exe, version 1.5.0.11, faulting module jvm.dll, version 27.3.1.1, fault address 0x0014b442.
    I have seen few threads on Sun forum, but answer was not posted there. Details of our environment are as below:-
    JVM : JROCKIT 1.5.0.11
    OS : Windows 2003
    Application Server : Weblogic 10
    Any inputs or pointers will be highly appreciated as this is a bit urgent for me...
    Thanks & Regards,
    Sanjeev

    Hi Henrik,
    I am running Weblogic with below parameters now:
    -Xnohup -Xms:1536m -Xmx:1536m -XXtlaSize:min=32k,preferred=768k -XXlargeObjectLimit:32K
    Weblogic crashed again with below dump:
    ===== BEGIN DUMP =============================================================
    JRockit dump produced after 0 days, 07:17:18 on Fri May 07 15:26:16 2010
    Additional information is available in:
    E:\PortalLIVDomaina\jrockit.5772.dump
    E:\PortalLIVDomaina\jrockit.5772.mdmp
    If you see this dump, please open a support case with BEA and
    supply as much information as you can on your system setup and
    the program you were running. You can also search for solutions
    to your problem at http://forums.bea.com in
    the forum jrockit.developer.interest.general.
    Error Message: Illegal memory access. [54]
    Exception Rec: EXCEPTION_ACCESS_VIOLATION (c0000005) at 0x005148AF - memory at 0x00000000 could not be written.
    Minidump : Wrote mdmp. Size is 1406MB
    SafeDllMode : -1
    Version : BEA JRockit(R) R27.3.1-1_CR344434-89345-1.5.0_11-20070925-1628-windows-ia32
    GC Strategy : Mode: throughput. Currently using strategy: genparpar
    GC Status : OC currently running, in phase: sweeping. This is OC#3000.
    : YC is not running. Last finished YC was YC#9937.
    OC History : Strategy genparpar was used for OC#1.
    : Strategy singleparpar was used for OC#2.
    : Strategy genparpar was used for OC#3 to OC#3000.
    YC History : Ran 11 YCs before OC#2996.
    : Ran 18 YCs before OC#2997.
    : Ran 11 YCs before OC#2998.
    : Ran 8 YCs before OC#2999.
    : Ran 1 YCs before OC#3000.
    Heap : 0x00900000 - 0x60900000
    Compaction : 0x06900000 - 0x0C900000
    Could you please provide some input on this?
    Thanks,
    Sanjeev

  • MaterialMaster_CreateIDOC Cannot start thread

    I am using the Material_Master AOI template with data services I wanted to loop through the IDOC for each plant starting with our main plant then as we loop material would be pushed (extended) to the other plants. When I looped the second time I go the error below. It appears because the connection is already opened for the IDOC another cannot thread be created. Can I close the connection when each plant is pushed and then re-open for the next plant?
    7036       7160       SYS-050703         9/20/2011 2:47:24 PM    |Session Job_P2CMM01_Res_Material_Master|Work flow WF_P2CMM01_Res_MaterialMaster_GenerateIDOC|Data flow DF_P2CMM01_Res_MaterialMaster_CreateIDOC
    7036       7160       SYS-050703         9/20/2011 2:47:24 PM    Cannot start thread.

    Tasks are meant to be run in the context of a JavaFX application, like in the example below:
    import javafx.application.Application;
    import javafx.concurrent.Task;
    import javafx.scene.Scene;
    import javafx.scene.layout.StackPane;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    import java.io.IOException;
    public class TaskApp extends Application {
      public static void main(String[] args) { launch(args); }
      @Override public void start(final Stage stage) throws IOException {
        //create task object
        Task<Integer> task = new Task<Integer>(){
          @Override
          protected Integer call() throws Exception{
            System.out.println("Background task started...");
            int iterations;
            for(iterations = 0; iterations < 10000; iterations++){
              if(isCancelled()){
                break;
              System.out.println("Iteration " + iterations);
              Thread.sleep(3000);
            return iterations;
        //start the background task
        Thread th = new Thread(task);
        th.setDaemon(true);
        System.out.println("Starting background task...");
        th.start();
        stage.setScene(new Scene(new StackPane(), 200, 100, Color.BLANCHEDALMOND));
        stage.show();
    }Also your code was setting the task thread as a daemon thread. The Java Virtual Machine exits when the only threads running are all daemon threads. So once your main routine finished (which would be really quickly), the program would just exit without doing anything much. Note that, in your example, even if you made the Task thread a non-daemon thread, it still doesn't work (likely because the Task class has some reliance on the JavaFX system being initialized). For your simple background process you could skip Task and just use a Runnable or a Callable (which doesn't require JavaFX and hence would work in a non-daemon thread invoked from main), but I guess it's just an experiment.

  • [Forum FAQ] Why does Office 2013 cost more network flow when the application starts by default?

    Recently, we’ve heard that our customers encounter high network traffic since they large-scalely deploy Office 365/2013 within the domain/site. Does this behavior relate to the new Office? Or does Office 365/2013 cost more network resources in this case?
    To troubleshoot this, we consider to analyze what happened during the process by Network Monitor tool. 
    Start a new capture first and launch Office Word 2013, get the following things as the screenshots:
    According to the information above,
    in addition to the network authentication flow, we could notice that the Word.exe would download a lot of PNG files from the link “/en-us/templates”. What about those PNG files?
    Let us try to directly visit them via IE:
    http://office.microsoft.com/en-us/templates/TM103463086.png?ts=AOLhIeGIzwg
    Beyond question, they are the thumbnails of the Office template which are downloaded while the Office application starts by default.

    In
    some certain circumstances,
    we might disable it by Office option or Group policy.
    Disable Start Screen by Office 2103 UI:
    Open Office 2013 application, go to File in Ribbon > Options tab > General page > under the section of Start Screen options, uncheck the options "Show the
    Start screen when this application starts"
    Disable Start Screen by Registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\General
    DisableBootToOfficeStart (DWORD): set the value
    to 1
    Disable Start Screen by Group Policy:
    Disable Start Screen by OCT:
    That's all. If you have any questions or concerns about this topic, feel free to post here.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

  • Drawing and some layout help for a simple control: thin lines and application start

    I am trying to create a new, simple control. The control should act as a grouping marker much like that found in the Mathematica notebook interface. It is designed to sit to the right of a node and draw a simple bracket. The look of the bracket changes depending on whether the node is logically marked open or closed.
    After looking at some blogs and searching, I tried setting the snapToPixels to true in the container holding the marker control as well as the strokewidth but I am still finding that the bracket line is too thick. I am trying to draw a thin line. Also, I am unable to get the layout to work when the test application is first opened. One of the outer brackets is cut-off. I hardcoded some numbers into the skin just to get something to work.
    Is there a better way to implement this control?
    How can I get the fine line drawn as well as the layout correct at application start?
    package org.notebook;
    import javafx.beans.property.BooleanProperty;
    import javafx.beans.property.IntegerProperty;
    import javafx.beans.property.SimpleBooleanProperty;
    import javafx.beans.property.SimpleIntegerProperty;
    import javafx.scene.control.Control;
    * Provide a simple and thin bracket that changes
    * it appearance based on whether its closed or open.
    public class GroupingMarker extends Control {
      private final static String DEFAULT_STYLE_CLASS = "grouping-marker";
      private BooleanProperty open;
      private IntegerProperty depth;
      public BooleanProperty openProperty() { return open; }
      public IntegerProperty depthProperty() { return depth; }
      public GroupingMarker(boolean open) {
      this();
      setOpen(open);
      public GroupingMarker() {
      open = new SimpleBooleanProperty(true);
      depth = new SimpleIntegerProperty(0);
      getStyleClass().add(DEFAULT_STYLE_CLASS);
      // TODO: Change to use CSS directly
      setSkin(new GroupingMarkerSkin(this));
      public boolean isOpen() {
      return open.get();
      public void setOpen(boolean flag) {
      open.set(flag);
      public int getDepth() {
      return depth.get();
      public void setDepth(int depth) {
      this.depth.set(depth);
    package org.notebook;
    import javafx.scene.Group;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.FillRule;
    import javafx.scene.shape.LineTo;
    import javafx.scene.shape.MoveTo;
    import javafx.scene.shape.Path;
    import com.sun.javafx.scene.control.skin.SkinBase;
    * The skin draws some simple lines on the right hand side of
    * the control. The lines reflect whether the control is considered
    * open or closed. Since there is no content, there is no
    * content handling code needed.
    public class GroupingMarkerSkin extends SkinBase<GroupingMarker, GroupingMarkerBehavior> {
      GroupingMarker control;
      Color lineColor;
      double shelfLength;
      double thickness;
      private Group lines;
      public GroupingMarkerSkin(GroupingMarker control) {
      super(control, new GroupingMarkerBehavior(control));
      this.control = control;
      lineColor = Color.BLUE;
      shelfLength = 5.0;
      thickness = 1.0;
      init();
      * Attached listeners to the properties in the control.
      protected void init() {
      registerChangeListener(control.openProperty(), "OPEN");
      registerChangeListener(control.depthProperty(), "DEPTH");
      lines = new Group();
      repaint();
      @Override
      protected void handleControlPropertyChanged(String arg0) {
      super.handleControlPropertyChanged(arg0);
        @Override public final GroupingMarker getSkinnable() {
            return control;
        @Override public final void dispose() {
        super.dispose();
            control = null;
        @Override
        protected double computePrefHeight(double arg0) {
        System.out.println("ph: " + arg0);
        return super.computePrefHeight(arg0);
        @Override
        protected double computePrefWidth(double arg0) {
        System.out.println("pw: " + arg0);
        return super.computePrefWidth(40.0);
         * Call this if a property changes that affects the visible
         * control.
        public void repaint() {
        requestLayout();
        @Override
        protected void layoutChildren() {
        if(control.getScene() != null) {
        drawLines();
        getChildren().setAll(lines);
        super.layoutChildren();
        protected void drawLines() {
        lines.getChildren().clear();
        System.out.println("bounds local: " + control.getBoundsInLocal());
        System.out.println("bounds parent: " + control.getBoundsInParent());
        System.out.println("bounds layout: " + control.getLayoutBounds());
        System.out.println("pref wxh: " + control.getPrefWidth() + "x" + control.getPrefHeight());
        double width = Math.max(0, 20.0 - 2 * 2.0);
        double height = control.getPrefHeight() - 4.0;
        height = Math.max(0, control.getBoundsInLocal().getHeight()-4.0);
        System.out.println("w: " + width + ", h: " + height);
        double margin = 4.0;
        final Path VERTICAL = new Path();
        VERTICAL.setFillRule(FillRule.EVEN_ODD);
        VERTICAL.getElements().add(new MoveTo(margin, margin)); // start
        VERTICAL.getElements().add(new LineTo(margin + shelfLength, margin)); // top horz line
        VERTICAL.getElements().add(new LineTo(margin + shelfLength, height - margin)); // vert line
        if(control.isOpen()) {
        VERTICAL.getElements().add(new LineTo(margin, height - margin)); // bottom horz line
        } else {
        VERTICAL.getElements().add(new LineTo(margin, height-margin-4.0));
        //VERTICAL.getElements().add(new ClosePath());
        VERTICAL.setStrokeWidth(thickness);
        VERTICAL.setStroke(lineColor);
        lines.getChildren().addAll(VERTICAL);
        lines.setCache(true);
    package org.notebook;
    import com.sun.javafx.scene.control.behavior.BehaviorBase;
    public class GroupingMarkerBehavior extends BehaviorBase<GroupingMarker> {
      public GroupingMarkerBehavior(final GroupingMarker control) {
      super(control);
    package org.notebook;
    import javafx.application.Application;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TextArea;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class TestGroupingMarker extends Application {
      public static void main(String args[]) {
      launch(TestGroupingMarker.class, args);
      @Override
      public void start(Stage stage) throws Exception {
      VBox vbox = new VBox();
      BorderPane p = new BorderPane();
      VBox first = new VBox();
      first.getChildren().add(makeEntry("In[1]=", "my label", 200.0, true));
      first.getChildren().add(makeEntry("Out[1]=", "the output!", 200.0, true));
      p.setCenter(first);
      p.setRight(new GroupingMarker(true));
      vbox.getChildren().add(p);
      vbox.getChildren().add(makeEntry("In[2]=", "my label 2", 100.0, false));
      Scene scene = new Scene(vbox,500,700);
      scene.getStylesheets().add(TestGroupingMarker.class.getResource("main.css").toExternalForm());
      stage.setScene(scene);
      stage.setTitle("GroupingMarker test");
      stage.show();
      protected Node makeEntry(String io, String text, double height, boolean open) {
      BorderPane pane2 = new BorderPane();
      pane2.setSnapToPixel(true);
      Label label2 = new Label(io);
      label2.getStyleClass().add("io-label");
      pane2.setLeft(label2);
      TextArea area2 = new TextArea(text);
      area2.getStyleClass().add("io-content");
      area2.setPrefHeight(height);
      pane2.setCenter(area2);
      GroupingMarker marker2 = new GroupingMarker();
      marker2.setOpen(open);
      pane2.setRight(marker2);
      return pane2;

    The test interfaces are already defined for you - the 3rd party session bean remote/local interfaces.
    It is pretty trivial to create implementations of those interfaces to return the test data from your XML files.
    There are a number of ways to handle the switching, if you have used the service locator pattern, then I would personally slot the logic in to the service locator, to either look up the 3rd party bean or return a POJO test implementation of the interface according to configuration.
    Without the service locator, you are forced to do a little more work, you will have to implement your own test session beans to the same interfaces as the 3rd party session beans.
    You can then either deploy them instead of the 3rd party beans or you can deploy both the test and the 3rd party beans under different JNDI names,and use ejb-ref tags and allow you to switch between test and real versions by changing the ejb-link value.
    Hope this helps.
    Bob B.

  • Running a control on application start up

    Hi,
    I am using Weblogic workshop with the netui and controls framework.
    Does anyone know if there is a way to be able to access a control when the application starts. I need to initialise some static data on application startup.
    Normally I would just use a struts plugin to run some init routine, but because we are using DBControls to access the database I can't do this because I am unable to access controls from a POJO.
    Thanks for your help,
    Adrian

    Well two ideas (if ur on windows) u could try are -
    one, if you had a class file you could simply create a
    batch file on windows that says java <class> and then
    put that batch file in your startup so that the class
    is run at startup or else you could think of modifying
    the registry keys on windows to run this class at
    startup - whichever works for you.Or you could just jar the program up, adding a Main-Class indicator in the manifest, and then add a shortcut to the jar to the startup folder, as someone else stated. Theres little need to go messing around with DOS batch in modern windows.

  • Applications Start Page Profile Option Causing Issues

    Hello Oracle Gurus,
    I'm having an issue in a 12.1.3 instance that I think may be related to the "Applications Start Page" profile option.
    For testing purposes, we set the profile to a specific Self-Service page at the Site level. We eventually removed the Site level profile and added it at the user level just for specific users, but since the Site-level profile was set, every time we click the Home link in the upper right-hand navigation, we get an "unexpected error." If we attempt to log in as a user that does not have the Applications Start Page profile defined, we also get an unexpected error.
    After getting the error using either of the methods listed above, if we then try to navigate back to the login page, the instance throws a 500 Internal Error.
    If we close the browser and navigate to the instance again, we're able to log in without any issues with user accounts that have an Applications Start Page profile defined.
    Our "Self Service Personal Framework Mode" is set to "Framework Only" at the site level.
    Bouncing Apache seems to resolve the issue temporarily, but then it comes back again a few hours later...
    We've opened a Service Request, but has anyone else run into this before / have any ideas on how to fix it?
    Here are some related Metalink notes from 11.5.10:
    729375.1 (About the Applications Start Page profile option)
    331814.1 (Error on Personal Home Page when returning to 'Home' link)
    Thanks!
    Anne

    The issue is not specific to a responsibility or application.
    Here is the error:
    Fatal NI connect error 12170.
    VERSION INFORMATION:
         TNS for Linux: Version 11.1.0.7.0 - Production
         Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 11.1.0.7.0 - Production
         Oracle Bequeath NT Protocol Adapter for Linux: Version 11.1.0.7.0 - Production
         TCP/IP NT Protocol Adapter for Linux: Version 11.1.0.7.0 - Production
    Time: 27-JAN-2011 09:46:02
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12535
    TNS-12535: TNS:operation timed out
    ns secondary err code: 12560
    nt main err code: 505
    TNS-00505: Operation timed out
    nt secondary err code: 110
    nt OS err code: 0
    Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=172.30.31.107)(PORT=1502))
    Thu Jan 27 09:53:30 2011
    Incremental checkpoint up to RBA [0x42.e3635.0], current log tail at RBA [0x42.e37e1.0]
    Thu Jan 27 10:13:31 2011
    Incremental checkpoint up to RBA [0x42.e602b.0], current log tail at RBA [0x42.e6146.0]
    Thu Jan 27 10:33:33 2011
    Incremental checkpoint up to RBA [0x42.e7bc9.0], current log tail at RBA [0x42.e7d51.0]
    Thu Jan 27 10:53:35 2011
    Incremental checkpoint up to RBA [0x42.e995f.0], current log tail at RBA [0x42.e9ac9.0]
    Thu Jan 27 11:13:37 2011
    Incremental checkpoint up to RBA [0x42.ec163.0], current log tail at RBA [0x42.ec3f7.0]
    Thu Jan 27 11:23:48 2011
    Starting background process CJQ0
    Thu Jan 27 11:23:48 2011
    CJQ0 started with pid=8, OS id=17239
    Thu Jan 27 11:33:39 2011
    Incremental checkpoint up to RBA [0x42.ee08f.0], current log tail at RBA [0x42.ee216.0]
    Thu Jan 27 11:53:41 2011
    Incremental checkpoint up to RBA [0x42.efd07.0], current log tail at RBA [0x42.eff13.0]
    Thu Jan 27 11:54:02 2011
    Stopping background process CJQ0
    Thu Jan 27 12:13:43 2011
    Incremental checkpoint up to RBA [0x42.f25c0.0], current log tail at RBA [0x42.f2e4b.0]
    Thu Jan 27 12:33:45 2011
    Incremental checkpoint up to RBA [0x42.f4cae.0], current log tail at RBA [0x42.f4e4b.0]
    Thu Jan 27 12:53:47 2011
    Incremental checkpoint up to RBA [0x42.f6e8a.0], current log tail at RBA [0x42.f6fb7.0]
    Thu Jan 27 13:13:50 2011
    Incremental checkpoint up to RBA [0x42.fa3d0.0], current log tail at RBA [0x42.fa845.0]
    Thu Jan 27 13:33:52 2011
    Incremental checkpoint up to RBA [0x42.fc7d9.0], current log tail at RBA [0x42.fc989.0]
    Thu Jan 27 13:53:55 2011
    Incremental checkpoint up to RBA [0x42.fed4e.0], current log tail at RBA [0x42.ff12e.0]

  • I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.Not working in USA timezone.

    I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.It works fine in our side (Timezone,kolkata ,india even for Timezone,slvaniya,USA) but our USA client is telling that on changing the date it not starts from start-up sequence.Can anyone plz suggest the reason for it.

    This is the code which we have used.
    //////////Return if it is first time for the day or not//////////////
    + (BOOL)isFirstTimeToday {
    BOOL result = YES;
    NSDate *now = [[NSDate alloc] init];     /// represents the current time
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate: now];
    NSDate *today = [gregorian dateFromComponents:components];
    [now release];
    [gregorian release];
    NSDate *savedDate = [[NSUserDefaults standardUserDefaults] objectForKey:LAST_TIME_VISITED];
    if (savedDate) {
    if ([today earlierDate:savedDate] == today) {
    result = NO;
    return result;
    ////////Stores the date/////////////
    + (void)userDidVisitReenforceScreenToday {
    [[NSUserDefaults standardUserDefaults] setObject:[NSDate todayAtMidnight] forKey:LAST_TIME_VISITED];
    ////////////What [NSDate todayAtMidnight] stores/////////////////////
    + (NSDate *)daysFromNowAtMidnight:(NSInteger)nOfDays {
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow: (86400*nOfDays)];
    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
    NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate: date];
    NSDate *dateAtMidnight = [gregorian dateFromComponents:components];
    [gregorian release];
    NSLog(@"dateAtMidnight : %@",dateAtMidnight);
    return dateAtMidnight;
    + (NSDate *)todayAtMidnight {
    return [self daysFromNowAtMidnight:0];
    Please Suggest..

  • I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.It works with iPod not with iPhone

    I created an application and in  that application if date is changed the application starts from splash screen on re-entering and if date is not changed and u re-enters the application then it open in page where u leaved.It works with iPod not with iPhone

    Try posting in the developer forums to see if you can get some assistance,you'll have to be a registered developer for access though.
    developer.apple.com

  • Start Thread method behaviour

    I'm using Oracle 10
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining optionsI created two Java classes and a wrapper procedure.
    1. The first class timeOutSAPEntry has a delay caused by sleep method of 10 sec. then updates a row in table sap_entry.
    2. The second class createMonitorSAPEntry creates an instance of timeOutSAPEntry, call start() method and ends.
    3. And the wrapper procedure just calls createMonitorSAPEntry.
    My problem: when I call the wrapper procedure, it hangs for 10 sec (consequence of sleep method). But, I expected that the thread could be created, started and then the control returns to procedure and finishes immediatelly. You can see in the execution below the sysdate before and after the procedure call.
    Is there any solution? I would like the same behaviour of others JVM, where the main thread continues the execution and not hangs out waiting for the started thread.
    create or replace
           and compile java source named "timeOutSAPEntry"
    as
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    public class timeOutSAPEntry
        extends Thread{
        public void run(){
            try{
                 this.sleep(10000);
                 Connection conn =
                        DriverManager.getConnection("jdbc:default:connection:");
                 PreparedStatement  st = conn.prepareStatement("update cmforna.sap_entry set status = 'Failed' where Status = 'Sent'");
                 st.executeUpdate();
                 st.close();
                 conn.commit();
                 conn.close();      
            }catch(Exception e){
                e.printStackTrace();
    create or replace
           and compile java source named "createMonitorSAPEntry"
    as
    public class createMonitorSAPEntry{
       public static void create(){
            timeOutSAPEntry to = new timeOutSAPEntry();
            to.start();
    create or replace procedure create_monitor_post
    as
    language java name 'createMonitorSAPEntry.create()';
    SQL> insert into sap_entry
      2  (id, posted_on, status)
      3  values
      4  (6, sysdate, 'Sent');
    1 row created.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> select to_char(sysdate, 'hh24:mi:ss') Before_Time from dual;
    BEFORE_T
    16:27:04
    SQL>
    SQL> exec create_monitor_post;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select to_char(sysdate, 'hh24:mi:ss') After_Time from dual;
    AFTER_TI
    16:27:14
    SQL> Many tks,
    Miguel

    Add a KeyAdapter like this:
    addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent ke) {
        int key = ke.getKeyCode();
        if (key == KeyEvent.VK_LEFT) x1--;
        if (key == KeyEvent.VK_RIGHT) x1++;
    });*Note that I added this just after the bouncing = true; ... which is on about line 33.
    **Note that you will need to click in the Applet before the keys will function.
    ***Note that you will also likely want to slow down the balls.
    ~Bill

  • Macbook upgrade to Lion.. how do i minimize what applications start up from boot ?

    how do i minimize what applications start up from boot (start-up) ??
    excel, word, safari and mail are all opening
    takes too long

    Disable Resume...
    How To Disable Lion's 'Resume' Feature - MacRumors.com
    And if you restart your Mac from the Apple menu > Restart
    Deselect:   Reopen windows when logging back in

  • Pre-loading the Cache from Database during application start-up

    We are using Spring, Hibernate, Oracle Coherence 3.5.2 Weblogic Webservices
    Our requirement is to pre-load the cache during the application start-up most probably during Authentication/Authorization Service is invoked.
    We plan to load the data for other services from database into Coherence cache so that whenever user access that particular service he ends up hitting the Cache instead of database.
    We would greatly appreciate sample code snippets on how to write CacheInitializerBean with marker to demonstrate the state of cache.

    Hi Rob,
    Thanks for pointing to the article: Pre-Loading the Cache
    In fact i already looked at that article before posting. It just mentions how to load the data from database into Cache.
    What i am looking for is how to make this happen during application start-up. This is my first hurdle.
    The second one is as mentioned in the article http://coherence.oracle.com/display/COH35UG/Pre-Loading+the+Cache
    i wrote following code which never gets populated into cache. Not sure whats going wrong even though i see Hibernate loadAll() method loading all the objects in the console
    public   void populateCache() throws SQLException
        Map<Long, Object>  buffer = new HashMap<Long, Object>();
        int count = 0;
         List<Contract> contractList = this.getHibernateTemplate().loadAll(Contract.class);
         log.debug("contractList size="+contractList.size());
         for(Contract contract : contractList)
             Long key   = new Long(contract.getId());
             Object  value = contract;
             buffer.put(key, value);
             // this loads 1000 items at a time into the cache
             if ((count++ % 1000) == 0)
                  contractCache.putAll(buffer);
                 buffer.clear();
         if (!buffer.isEmpty())
              contractCache.putAll(buffer);
        }We would greatly appreciate your time in helping us resolving two hurdle blocks.

  • You can't open the application Start.osx because PowerPC applications are no longer supported.

    what does this error message mean? I am trying to use a disc that came along with a book I ordered for studying. However, when I try and run it, this is the error message I receive. "You can't open the application Start.osx because PowerPC applications are no longer supported." Anything I can do to fix this and make it work?????

    Many educational CDs have not been upgraded due to lack of funds in the educational market to pay for such updates. 
    This situation is due primarily to the fact that one of the major political parties in this country favors tax cuts to the rich while cutting federal educational support funding (or eliminating the federal Department of Education altogether).
    However, you can restore Rosetta and run your educational CD if you install Snow Leopard Server ($20) into Parallels (up to $79) for use in Lion/Mt. Lion/Mavericks:
                                  [click on image to enlarge]
    More information here:
    http://forums.macrumors.com/showthread.php?t=1365439

Maybe you are looking for