Changing the System time in the JVM where Weblogic runs

Hi,
I am trying to change the System time where the Web-logic server (11g) runs using Mocking. I use "jmockit.jar" to mock the System.class. A Spring bean is created and through that I try to change the System time. I need to change the time for testing scenarios. For example, I need to backdate and do the testing for some scenarios. For the moment I do this manually and I want to automate this by changing only the time in the JVM where the application server runs. When I try to automate this using the Spring bean, I get an error as follows. Do anyone have any idea about this.
[WLServer adminserver] Exception in thread "Timer-5" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
[WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
[WLServer adminserver] Exception in thread "DynamicListenThread[Default]" java.lang.IllegalArgumentException: No class with name "com.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at java.util.logging.LogRecord.<init>(LogRecord.java:139)
[WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:33)
[WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:48)
[WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:70)
[WLServer adminserver] at weblogic.logging.WLLogRecord.<init>(WLLogRecord.java:63)
[WLServer adminserver] at weblogic.logging.JDKLoggerFactory.createBaseLogRecord(JDKLoggerFactory.java:74)
[WLServer adminserver] at com.bea.logging.LoggingService.log(LoggingService.java:216)
[WLServer adminserver] at weblogic.server.ServerLogger.logListenThreadFailure(ServerLogger.java:205)
[WLServer adminserver] at weblogic.server.channels.DynamicListenThread.run(DynamicListenThread.java:197)
[WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
[WLServer adminserver] Exception in thread "weblogic.timers.TimerThread" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at weblogic.timers.internal.TimerThread$Thread.run(TimerThread.java:256)
[WLServer adminserver] Exception in thread "Timer-4" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
[WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
[WLServer adminserver] Exception in thread "ClusterNode-localhost" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at EDU.oswego.cs.dl.util.concurrent.Latch.attempt(Unknown Source)
[WLServer adminserver] at org.apache.jackrabbit.core.cluster.ClusterNode.run(ClusterNode.java:261)
[WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
[WLServer adminserver] Exception in thread "Timer-1" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
[WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
[WLServer adminserver] Exception in thread "ClusterNode-localhost" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at EDU.oswego.cs.dl.util.concurrent.Latch.attempt(Unknown Source)
[WLServer adminserver] at org.apache.jackrabbit.core.cluster.ClusterNode.run(ClusterNode.java:261)
[WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
[WLServer adminserver] Exception in thread "Timer-2" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
[WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
[WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
[WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
[WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
[WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
[WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
[WLServer adminserver] Exception in thread "weblogic.time.TimeEventGenerator" java.util.MissingResourceException: Can't locate bundle for class 'weblogic.common.T3MiscLogLocalizer'
[WLServer adminserver] at weblogic.i18ntools.L10nLookup.getLocalizer(L10nLookup.java:427)
[WLServer adminserver] at weblogic.i18n.logging.CatalogMessage.<init>(CatalogMessage.java:47)
[WLServer adminserver] at weblogic.common.T3MiscLogger.logThrowable(T3MiscLogger.java:325)
[WLServer adminserver] at weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:126)
[WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
OR
Do anyone know any other way to overcome this issue using some other mocking jar.
Thanks
Edited by: 913136 on Feb 8, 2012 2:32 AM

Hi,
I could manage to change the time in JVM where the Weblogic server runs. I loaded an Spring bean from my Test class and from that bean I set an offset (to shift the time) in the Mock class (say, MockSystem class). In this case I used the jmockit implementation for instrumentation purposes. The MockSystem class should not be instantiated by us and jmockit takes care of that part. What I had to do was defining the javaagent and another parameter ("-Djmockit-mocks=com.abc.common.service.impl.MockSystem") in the Weblogic server build XML (mentioned in the following URL[1]). But to work this the MockSystem.class file should be wrapped in a JAR file and included in Weblogic server/lib directory and define it in the Weblogic build XML file as a classpath. For more explanations visit this URL [2].
[1]. http://jmockit.googlecode.com/svn/trunk/www/javadoc/mockit/Mockit.html#setUpStartupMocks%28java.lang.Object...%29
[2]. http://code.google.com/p/jmockit/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Tool%20Type%20Status%20Priority%20Summary&groupby=&sort=&id=207
Thanks
-thiwanka-

Similar Messages

  • How can i get the System Time from the other host

    I want to get the System Time from the other host in the LAN,How can I get the Time using Java.
    Such as I am in WIN 2000 and I have a Unix host in LAN, I want to get unix host System time, How can I do it.

    Open a socket to port 13 and read a string with the time.
    -or-
    Open a socket to port 27 and read 4 bytes that are a network order timestamp
    Assuming that your UNIX machine has those services running, most do

  • How to set the system time in the program

    Hi All,
    How do we update the system time inside java programme.

    AFAIK there is no easy (pure java) way: either you exec something (depending on your paltform) or use native code. Appropriate privileges will be necessary.

  • How to change the system time in (E-Business Suite)

    Hi,
    I need to change the system timings in E-Business Suite.
    My Database & Application is on different nodes..
    How could i change system timings on both...
    Thanks,
    Alig

    Alig,
    Changing the OS date/time will have no impact on the data (except for the scheduled jobs at the database and the OS levels). As mentioned in the threads I referenced above, you have to stop the application/database, change the date/time at the OS level, and start the application.
    The application is just an interface which connects to the database, so it gets all the data from the database server. However, if you want to change the date/time it has to be done on both nodes (stop all the services first as mentioned above).
    Btw, what is the point of changing the date/time because of Ramadan? The business requirement of your client does not make sense (how does it differ from the application/database perspective if you start working at 9:00 AM instead of 7:00 AM for example)?
    The steps in the document should be enough, and if you do not trust any of the replies here you could simply log a SR and confirm this with Oracle support.
    Thanks,
    Hussein

  • The impact of changing SAP system time zone.

    Hello gurus,
    We are in the company located in UTC+8 Time Zone. but during the system installation, the setting in SAP (tcode:STZAC) of the system time zone is CET, which is, not correct, and cause some issues: such as, when we try to send mail via SAP smtp, the sent time in the mail is always wrong.
    We tried to modify it to UTC+8, but since we already go live for several months, there're lots of application data in the system. Before that we need to make sure that this change will not affect the current implementation.
    Do you experts know the impact or risk of changing the system time zone after going live?
    Regards,
    Charlie

    Lets look at this from a logic perspective,  if your system is CET and you are moving to UTC+8 you are going a few hours ahead... so basically you'll find a gap in time in between the documents but you wont find any time conflict. So based on that it should be safe. You certainly need to check your jobs and make sure all necesary jobs will run so you can reschedule them if skipped by the time change (I guess).
    Regards
    Juan

  • Changing the System Time

    I am using a SunBlade 1000 and C++ with Workshop 6.1. I would like to change the system time via a program written in C++ without having to log in as super-user. Is that possible ? I was thinking about using the settimeofday function, but according to the man information I only can use it as super-user.

    You are correct. Only root can set the system time. You should
    probably consult your local system admin or discuss the implications
    of trying to do this in the Solaris forum. There are possible security
    holes opened up by trying to do root's job programatically.
    In general, a C program can use the system() call to run a command
    that would be typed in at the shell. A program can also have the
    Set UID bit and run as root, but you should be well aware of the
    risks associated with that before you try to use it.

  • When i change os system time to 1987 before, the database is crashed.

    What impact to oracle when change os system time? and how to do this?

    Question is why you want to do that?
    Some tester to do it, i need an explain to it.
    Did you already tried this and database crashed?
    Yes.
    Did you stop the database?
    No.
    What's Oracle version? OS?
    oracle
    11.1.0.7.0
    os
    SUSE Linux Enterprise Server 10 (i586)
    VERSION = 10
    PATCHLEVEL = 2

  • HT5639 The system time is always changing by about 7 hours

    I am running windows 8 64bit pro upgrade on my mac 27inch i2.7GHz. The system time is always changing by about 7 hours, I reset it by clicking on internet time update and it is OK until the next sync or if I restart then it goes back to being out by the 7 hours. Timezone setting are correct and language setting are all pointing to the correct zone/area. I have the latest bootcamp drivers installed too. Any help to get this fixed will really help as it is making my emails very hard to follow when I have noticed the change..
    Thanks

    I used the "Registry Fix" method in this article to fix it in Win7/64 on my BootCamp partition. Worked perfectly.
    http://prasys.info/2010/01/fixing-time-sync-issue-with-osxwindows/
    The article was written before Win 8 was supported by Bootcamp but, as the Registry fix is handled entirely within Win OS, it may work with Win 8.

  • Remove Local System from Change The System Time

    Hello,
    Is there any way to remove the Local Service account from policy "Change the system time"?
    I created a policy to only give permission for the Administrators and Power Users group, but when I run the AccessChk tool, the result is:
    administrators
    Power Users
    Local System
    Regards

    > Is there any way to remove the Local Service account from policy "Change
    > the system time"?
    No. Local System is the "godfather of your computer" and cannot be
    restricted.
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • I have lost my toobar menu. F9 brings it back but the system reverts to a screen where the File/Edit/View/..  list disappears.  Have run a repair but no change. Any suggesteions ? Mike

    Hi
    I have lost my toobar menu - Adobe Acrobat X Pro. F9 brings it back but the system reverts to a screen where the File/Edit/View/..  list disappears.  Have run a repair but no change. Any suggesteions ?
    Mike

    Hi Mike ,
    You can refer to the following link to seek help regarding the missing tool bar issue .
    https://helpx.adobe.com/freehand/kb/restore-missing-toolbars-panels.html
    Hope this will help.
    Let us know how it goes.
    Regards
    Sukrit Dhingra

  • How to display the Date Time using the System Time zone

    Friends,
    Can anyone help me with below scenario..
    I have to display Date Time on a jsff page, This value associated to one of Transient View object populated from the database.. Is there any way I can handle on the screen to display the same date /time bassed on the system time zone ?
    I know one way how we can handle it.. while populating to View object we can set the time based on the system time zone.. but it would be easy and simple if there is any approach I can use on UI layer itself..
    thanks

    I don't understand why this display doesn't pay attention to the date/time format settings that are set in the language and text prefs.
    Those settings are used for date OR time, and provide for different displays depending on the space available. The menu bar does not have a fixed space available, and wants both date and time.
    In Leopard, it used the medium time format. To get the date and time, you could modify that format to include the date, but that could cause problems with software that happened to use the medium time format and expectede just the time. Also, you might want to change the medium time format without changing the menu bar display. For these reasons, Snow Leopard's menu bar clock uses its own formatting for data and time display.

  • Can the system name of the Fabric Interconnects be changed

    I need to change the system name of the Fabric interconnects
    I have given eg. EDCD
    the FI now have EDCD-A
    EDCD-B
    I need to change it to ... ECCD-A
    ECCD-B..
    is it possible ?

    Shyam,
    You can definitely do it and for sure is not disruptive and take effect right away.    Just go to the Admin tab> All> Management Interfaces> Name > Edit it with what you need > Apply.
    It is so easy and fast that if at the same time you have an SSH session, as soon as you change the name, the system makes the change on your SSH session too.
    Note: There is no need to look for the way to do this on each fabric. The name you are changing is for both FIs and the system will then add the xya-A or xya-B by itself.
    Rate ALL helpful answers.
    -Kenny

  • How to View Outlook Messages in Timezone different from the Systems Time.

    Hi Team,
    My Name is Abhishek. I am from India.
    I just want to know one thing related to MS Outlook 2007 Version.
    To deal with Hongkong customers and to work in database we have kept the systems time as HongKong Time (GMT + 07: 30) in my official Laptop.
    So. when I receive any email in the Inbox it shows the message received time in Hong Kong Time which is the systems Time right now.
    But As I stay in India, I just want to see my all Outllook received Messages in Indian Time (GMT + 05: 30), without disturbing the systems time.  I just get confused when I receive any email and it shows in systems Hong Kong Time.
    Is it possible to change my outlook message receiving display time to Indian time without disturbing my systems time...If so, pls help me by telling the procedure how to do it...
    Thanking You
    Abhishek

    Hi Abhishek:
    There are no
    Daylight saving time for  HongKong Time Zone and also for the Indian Time, so the checkbox will be greyed out.
    As
    Nezer mentioned above: “Adjusting the time zone in outlook also alters the system time, I think outlook is design to always mirror the time zone of you system clock.” We couldn’t change
    this within Outlook.
    Thanks for your understanding.

  • The system time is val seconds older than the queue space time

    We did a time change on our system to future time and getting the above error after we are trying to reboot the application with current time.
    Please help !

    The Tuxedo queueing subsystem access to an accurate system time in order to
    implement message expiration times and other time-related features. If the
    system time is reset to an earlier value, time related queueing features can
    work incorrectly. For this reason,
    Q_CAT:2238 is logged if such a situation is encountered. Timestamps can be
    stored within individual /Q messages as well as in the queuespace
    superblock.
    If the time change into the future was of short duration, the easiest way to
    resolve this problem is simply to wait until the real time reaches the
    previously set future time. Once this happens, the queuespace will once
    again be usable.
    If the queuespace is used on a test system and the data on it is not
    valuable, another option is to recreate the queue space from scratch.
    Another option is to reset the system time back to the previous future time
    in order to use the queuespace.
    If this is a production system and you are a BEA support customer, you can
    file a support case about this situation. It may be possible for support to
    write a utility program to modify the timestamps within the queue to earlier
    values or to give you a version of /Q compiled to accept an environment
    variable that can be used to modify /Q's idea of the system time.
    Ed
    <hunki> wrote in message news:[email protected]..
    We did a time change on our system to future time and getting the above
    error after we are trying to reboot the application with current time.
    Please help !

  • How to get the system time in a Swing application ?

    I know how to do it in JavaScript, but not java. Please help me, and also how to get the system time in an Applet. Thanks !!!

    Check this link, I hope it helps
    http://202.71.136.142:8080/globalleafs/Swing/View.jsp?slno=22&tbl=0

Maybe you are looking for

  • My time Machine is no longer backing up my HD.

    2 Days ago I installed a new wireless Canon MX 892 multifunction printer, with help from a Canon tech.  Wireless printing works fine, I have access to the internet, and emails are coming and going.  But my Time Capsule will not auto back up now, and

  • Iam trying to increase the size of the font on my homepage on fox

    My homepage on Firefox is mytelus.com. The print is too small and I want to increase the size of the print. How do I do that? I have been able to increase the size of the print on my homepage on Internet Explorer, but can't seem to find instructions

  • Re-Engineer Database

    I have to re-enginner a database.What should be the best way to do it and any suggestions on same.

  • Active tab appears inactive after switching to Safari

    Hi, I've had this problem since I updated to Leopard. When I switch to Safari, e.g. with command+tab or change space, the active tab of Safari seem inactive while the rest of the application seems active (the tab has a lighter gray). Here is a screen

  • Trying to install OEM 10g Grid Control agent on Windows Server 2008 x64

    Received the following when trying to install OEM 10.2.0.2 for Windows 32 bit. I believe Windows 64 bit version does not exist. I have installed this on 2003 x64 in the past. Error message: Checking operating system version: must be 4.0, 5.0, 5.1 or