MessageFormat with arguments not working in jdk 6
I cant get the date to be formatted when using Jdk 6. Has something changed? Or am i using it in a non-standard way that gives this error.
I have run this test in Jdk 1.5.0_10 and 1.6.0_02.
And it fails in the 1.6.0_02.
This is a JUnit 4 testcase.
import java.text.MessageFormat;
import java.util.Date;
import java.util.Locale;
import org.junit.Test;
* This test the MessageFormat for usage.
* A bug in jdk 1.6.0 seams to be the problem.
* @author robert.alexandersson
public class LanguageJDKVerificationTest {
private static long time = 1000555500115L;
@Test
public void formatDate(){
String formatString = "Date {0}";
Date date = new Date();
date.setTime(time);
Object[] args = new Object[]{date};
Locale locale = new Locale("sv_se");
MessageFormat format = new MessageFormat(formatString, locale);
String formatted = format.format(args);
assertEquals(formatted, "Date 2001-09-15 14:05");
}
Hi there and thanx for answering.
I researched a little more.
The problem seams to be that the JDK 6 does not support sv_se as an input for langauge.
BUT, the older JDK:s (1.4 or 5) did this.
I would consider this as a backwards compatablility bug. They(SUN API:s) never said it would work with sv_se but it did anyway.
It does however not seem to be the Locale that handles this different so its propably the DateFormat that is somehow different in its implementation.
The sv_se is the "programmatic" version of the Locale, and this might be why it worked earlier on.
Similar Messages
-
Axis bank net secure with webpin not working on ipad2
Hi,
Axis bank net secure with webpin not working on ipad2
Lt me know how to proceedTry using their App:
https://itunes.apple.com/in/app/axis-bank-mobile-application/id517266358?mt=8 -
Since installing Yosemite, Airplay with Freebox not working
Since installing Yosemite, Airplay with Freebox not working
With Maverick Airplay working wellIf you haven't done so already, try resetting the printing system.
OS X Mavericks: Reset the printing system also Yosemite
Try deleting the printer and scanner and add them back.
Also try Applications/Image Capture to see if it can find the printer and scanner. -
Wifi connection with 4s not working after installing new software ios6
wifi connection with 4s not working after installing ios 6.
Go to Settings > WiFi > Select your network and hit the right arrow to "Forget Network"
Then go to Settings > General > Reset Network Settings and try connecting again when the phone restarts. -
For the last few weeks I have had constant problems with pages not working. I.E.: I cannot fill in writeable fields, click on buttons... or anything... nothing on the page works. And, this is not exclusive to a particular site. It does seem to be a browser issue, because I can work well in Explorer.
Both the Yahoo! Toolbar extension and the Babylon extension have been reported to cause an issue like that. Disable or uninstall those add-ons.
* https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes -
Applications associated with workstations not working
Hello,
I have onld zen 7.x, on netware.
Applications associated with workstations not working or appearing in one container. Not sure if it every worked. Apps work fine with users.
I am in a bind, since I need to get the app out in the workstation space.
It maybe rights or simple install error with the ZEN from the begining.
thanks for any help or ideas.. Yes I know I need to get to Zen 11.
PhilPhilJannusch,
> Applications associated with workstations not working or appearing in
> one container. Not sure if it every worked. Apps work fine with users.
>
> I am in a bind, since I need to get the app out in the workstation
> space.
Please tell us more as "not working" can mean a lot of things. So:
Are they user or workstation associated?
Are those for whick they do not work (users or workstations) all in the
same container?
In what way do they not work?
Any errors?
Anders Gustafsson (NKP)
The Aaland Islands (N60 E20)
Have an idea for a product enhancement? Please visit:
http://www.novell.com/rms -
I am getting frustrated with Apple not working with Flash Player on some of my favorite web sites! Is there another alternative to watching these site options on my I-pad?
Flash is not, and probably never will be, supported on the iPad : http://www.apple.com/hotnews/thoughts-on-flash/ . Plus it would be up to Adobe to make a version of their flash player that works on iOS devices - something which they have never managed to do and which they have now given up on trying to do.
Browser apps such as Skyfire, iSwifter and Puffin 'work' on some sites, but judging by their reviews not all sites. Also some websites, especially news sites, have their own apps in the App Store, so your could try checking there for your sites (and there is the built-in YouTube app). -
My original computer that I set up my iPhone 4 with
Does not work.....can I use a new computer to sync
The phone....how do I do this and is there a risk of
Of losing any apps, music etcTry this:
Syncing to a "New" Computer or replacing a "crashed" Hard Drive -
Tomcat 4.1.x not working under JDK 1.2.2
We are trying to test our web application on all versions of JDK starting from 1.2.2. We use Tomcat as the servlet engine and after upgrading from Tomcat 3.2.x to 4.1.24 (we've tried 4.1.18 as well) we have noticed that the new Tomcat does not start under JDK 1.2.2, see command line output below. We've tried on several machines and it fails with the same Exception. Has anyone tried running Tomcat 4.x on JDK 1.2.x? We find it hard to believe that a product like Tomcat would fail to support JDK 1.2, so any information would be appreciated.
C:\Java\jakarta-tomcat-4.1.24\bin>catalina.bat run
Using CATALINA_BASE: ..
Using CATALINA_HOME: ..
Using CATALINA_TMPDIR: ..\temp
Using JAVA_HOME: c:\java\jdk1.2
Bootstrap: Class loader creation threw exception
java.lang.IllegalMonitorStateException: current thread not owner
at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java, Compiled Code)
at org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.java, Compiled Code)
at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java, Compiled Code)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java, Compiled Code)I had the same problem.
No Tomcat 4.1.x is not working under JDK1.2.2.
It has something to do with a difference in byte code of the classes between jdk1.2.2 and jdk 1.4.
I am running now on J2SDK1.4.1_03 and have no problems any more -
Set Mnemonic with numpad not working?
Hello,
I think I must be I must be being thick.
I have a JTabbedPane and I'm want to use shortcut keys to access each pane.
I am Setting the Mnemonic for each pane with
mainTabbedPane = new JTabbedPane();
mainTabbedPane.setMnemonicAt(0, KeyEvent.VK_NUMPAD0);
mainTabbedPane.setMnemonicAt(1, KeyEvent.VK_NUMPAD1);
mainTabbedPane.setMnemonicAt(2, KeyEvent.VK_NUMPAD2);
mainTabbedPane.setMnemonicAt(3, KeyEvent.VK_NUMPAD3);
But it's not working. Alt and any other key seems to be working fine.
Is there an issue with the Number pad and set Mnemonic?
I am using JDK 1.5
Cheers
MarkHi. I have just the same problem. Any solution ?
-
Outer join (with (+)) does not work
I started with a working SQL statement:
SELECT DISTINCT username, r.granted_role
FROM dba_users u, dba_sys_privs s, dba_tab_privs t, dba_role_privs r
WHERE u.username = s.grantee
AND u.username = t.grantee
AND u.username = r.grantee
ORDER BY username, r.granted_role;
Fine, now I want to add two columns which indicate which of the users have SYSDBA and SYSOPER privileges.
As in another post told this can be achieved by:
SELECT * FROM V$PWFILE_USERS;
When I want to merge these two SQL statements I need an outer join but the following does not work:
SELECT DISTINCT u.username, r.granted_role, v.SYSDB, v.SYSOP
FROM dba_users u, dba_sys_privs s, dba_tab_privs t, dba_role_privs r, V$PWFILE_USERS v
WHERE u.username = s.grantee
AND u.username = t.grantee
AND u.username = r.grantee
AND u.username = v.username(+)
ORDER BY u.username, r.granted_role;
I got an error message:
SELECT DISTINCT u.username, r.granted_role, v.SYSDB, v.SYSOP
ERROR at line 1:
ORA-06553: PLS-306: wrong number or types of arguments in call to 'V'
Why?Run this
SELECT DISTINCT u.username, r.granted_role, v.SYSDBA, v.SYSOPER
FROM dba_users u,
dba_sys_privs s,
dba_tab_privs t,
dba_role_privs r,
v$pwfile_users v
WHERE u.username = s.grantee
AND u.username = t.grantee
AND u.username = r.grantee
AND u.username = v.username(+)
ORDER BY u.username, r.granted_role;- - - - - - - - - - - - - - - - - - - - -
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com -
Read Only Display of Radio group and Text area with counter not working
Hello,
I am using Apex 3.2, with 10g for the database
I have this form, with fields that will set to read only when status = 'closed'
All of the fields display as read only except for 2. I cannot figure out why this is not working correctly.
1st field is Issues that is a text area with character counter, with a sql query behind it, that is set to null unless the query is pulling in the data.
2nd field is Status which is a radio group that will not display as read only when status = 'closed'
I have other fields on the form with the same format and they change to read only when the status = 'closed', I have even copied the pl/sql expression from one field to these fields and it still doesn't work correctly. I have also tried javascript for an on load event, which works, but once I click on the save button, it disables all of the page items, which works correctly, but I purposely forget to enter information, to make sure the validations are firing correctly, which it does, but the script disables everything, not allowing me to correct the errors. The javascript is firing on the on page load event.
Any help on this is greatly appreciated.
MaryDung,
That API seems to have a bug, it returns true/false/null, so you could use 'return not nvl(htmldb_util.current_user_in_group(p_group_name => 'APP Admin'),false)' to get a false value.
Unfortunately there's another problem: using the read-only attributes for checkbox or radiogroup item makes them hidden. My suggestion would be to create another item that has disabled="disabled" in the HTML Form Element attribute in the item definition and display that item or the non-disabled item alternately, using conditions based on the current_user_in_group logic.
Scott -
MacBook Pro to TV with RCA - Not working
Hi guys, I'm trying to connect my Macbook pro 08 to my new Samsung HD TV. I'm using a DVI-D to HDMI for the video which works great, but I'm using RCA to the headphone jack for Audio and it's not working. I've tried playing with the settings in my TV but cannot change the Audio input to analog. I'm guessing my TV thinks it's getting the audio from the HDMI, but the DVI-D does not carry audio.
Does anyone know how to get the audio to work with RCA cables? Or is there an adapter that can combine my audio into the HDMI input?
Any help would be appreciated.
(My TV has 2 HDMI ports, component, and RCA ports as well as a USB)Yes, it is the ones on the left, but you're not going to hear any audio because your input selection must be on Component on the TV in order to get the audio out of that input. HDMI and Component are two different inputs on your Input menu selection. Do this, play some audio on your Mac and then flip to Component on the TV with your stuff hooked up. I bet you hear the sounds, but no video and when you're on HDMI, you see the video but no sounds. That's because it's two different inputs.
Also, your 2008 MBP doesn't support Audio passthrough the MiniDisplayPort, so you're kind hosed unless you do external speakers like Grant suggested. -
Crystal Report formula with datediff not working as expected
We need a Crystal Report formula to display the number of seconds the oldest arriving call has been waiting. Across multiple resources that can each have an "oldest call". The database stores a datetime value for the time the oldest call arrived. If there are no waiting calls, then this field is NULL. (MSSQL database). It seemed reasonable to implement this in a formula that 1) discovers the minimum of "oldest call" timestamps in the selected records, and 2) to use "datediff" to produce the difference (in seconds) between the "oldest call" timestamp and current time.
The first attempt at this relied on "implied" iteration that could be done within a formula. Something like:
data: OLDESTARRIVALTIME
null
'2014-06-14 08:08:08.000'
null
'2014-06-14 08:07:55.000'
null
whilereadingrecords;
datetimevar minArrival;
if isNull({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME}) = False
and minArrival < {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME} then
minArrival := {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME};
DateDiff("s", minArrival, {SVCCLASSMEASURES_VW.UTCDATE})
We tried storing the values of OLDESTARRIVALTIME in an array. We could see it iterating, but the values in the array only contained
the column value from the first record.
This was to solve the problem of screening null values and producing the minimum of the set.
Since that didn't work (and the web articles seemed to imply this would iterate over all the records, we tried another approach. This
time we set NULL timestamps in the table to a timestamp far in the future, so that we could directly apply "minimum" to produce
the correct "begin" for datediff.
data: OLDESTARRIVALTIME
'2030-01-01 00:00:00.000'
'2014-06-14 08:08:08.000'
'2030-01-01 00:00:00.000'
'2014-06-14 08:07:55.000'
'2030-01-01 00:00:00.000'
datetimevar minArrival = minimum({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME});
datetimevar minUTC = minimum({SVCCLASSMEASURES_VW.UTCDATE});
if minArrival < minUTC then
DateDiff("s", minArrival, minUTC)
else
0
(minUTC would be current time in UTC)
So, to start things off, the last formula produces negative numbers! They hover in negative seconds within a negative minute (-33, -45, etc.).
That's inconceivable, considering the test for minArrival < minUTC. Both of the fields are "datetime".
As it turns out, in the near term, it's most important to get the second formula working. And, of course, insights into getting the first
formula to work are welcome as well!
Have we run into some weird behavior of the "DateDiff" function?
Thanks!If DateDiff is always returning a negative number you could try swapping the dates around in the call to DateDiff - it should look like this:
DateDiff("s", minUTC, minArrival)
Or you could use the Absolute Value of the calculation:
Abs(DateDiff("s", minUTC, minArrival) )
As for your first formula, you need to initialize the variable to a value prior to using it in the comparison. If you don't, its value is null and comparing it against a value won't work. (See What is Null and Why is it Important for Crystal Reports | SAP BI BLOG for a blog that I wrote about working with nulls in Crystal.)
You should change your existing formula to something like this:
whilereadingrecords;
datetimevar minArrival;
if OnFirstRecord then minArrival := DateTime(2013, 1, 1, 0, 0, 0);
if not isNull({SVCCLASSMEASURES_VW.OLDESTARRIVALTIME})
and minArrival > {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME} then
minArrival := {SVCCLASSMEASURES_VW.OLDESTARRIVALTIME};
Note how I changed the If statement. Also, you want to replace minArrival with the field value if the field is less than the current value of minArrival - so you need to use ">" instead of "<" in the comparison. Place this formula in the details section. It will now show anything because of the semi-colon on the end. This will ensure that it gets evaluated for every record.
Now, create a second formula that looks like this:
whileReadingRecords;
datetimevar minArrival;
DateDiff("s", minArrival, {SVCCLASSMEASURES_VW.UTCDATE})
Place this formula in a footer section - it will not work in a header section. If you need it in a header section you might be able to take the "whilereadingrecords" off of both formulas and use the "Maximum()" summary function to get the correct value.
-Dell -
Binding gateway service with List not working properly with expand
Hi all,
We have an orderlist with details, we use the splitapp for it, it's working nicely with a gatewayservice. We have now added with expand 2 orderpartners. I see the 2 partners, only is it completly the same data. I checked the oData structure and I see indeed that the 2 partners are the same. This is weird, because when I execute the service, via my browser, I see 2 different partners.
If I execute the service directly via the read function, I see in the oData that I also have 2 different partners. So my conclusion is that the direct read of the service is working and executing the service via the sap.m.List is not working with the expand.
Now my question is, does somebody know what's going wrong here, or is it a bug in the sap.m.List? Below you find code snippets how I call the service.
This call is working:
oModel.read("/OrderListSet", null, ["$orderby=BegTstmp asc&$filter=Userid eq 'user' and DateFrom eq datetime'2014-04-20T00:00:00' and DateTo eq datetime'2014-04-27T00:00:00'&$expand=OrderPartners"], null, function(oData, oResponse){
}, null );
The binding via the sap.m.list is:
var oList = new sap.m.List("orderList", {
mode: "{device>/listMode}",
items: {
path: "/OrderListSet",
parameters: {expand: "OrderPartners"},
template : new sap.m.StandardListItem({
title: {
parts: [
{path: "BegTstmp", type: new sap.ui.model.type.DateTime({pattern: "H:mm"})},
{path: "DataCol2"}
formatter : function(strDate, strDescription) { return strDate + " - " + strDescription; }
description: {
parts: [
"DataCol3",
"DataCol4",
"DataCol5",
"DataCol6"
type: sap.m.ListType.Navigation,
icon: "{icon}",
customData: [
new sap.ui.core.CustomData({
key: "orderId",
value: "{Orderid}"
new sap.ui.core.CustomData({
key: "type",
value: "{Type}"
// Sort the list on date and group the list on day
sorter: new sap.ui.model.Sorter("BegTstmp", false, oGrouper),
// Filter the list, this directly refrenced to the gatewayservice
filters: [
util.Filter.getUserId(),
util.Filter.getCurrentWeekFromFilter(),
util.Filter.getCurrentWeekToFilter(),Fine. If you're trying to bind any attributes of OrderPartners, bind it as OrderPartners/attribute-name. Say if "BegTstmp" an attribute of OrderPartners bind it as OrderPartners/BegTstmp.
Regards
Sakthivel
Maybe you are looking for
-
Before you ask, yes I have seen sexual content. But I've never downloaded anything, and I haven't jail broken my iPhone. They appear only on the website: "Encyclopedia Dramatica". They usually appear where regular ads appear, I opened my laptop to ma
-
Ive gone thru the forums and it seems that embedding a flash swf movie into a container is not possible, or is it? i guess the only alternative i have it to detect whether or not the client has a browser and launch it is this the best way? id prefer
-
Java Card program execution on Eclipse
Hi Dears, I am new to Java Card. I did setup to run Java Card programs on eclipse using http://eclipse-jcde.sourceforge.net/. This is my simple program below import javacard.security.RandomData; public class Main { public void main() {
-
Hello, I have create a role with create, modify and eliminate queries permission. But when I create the query and try to save it, the role with the folder doesnt appear in the role area. I only can save my query in my favourites. Anybody knows what
-
Error on updating to iOS 5.
iPhone 3GS owner updating to iOS5 from iOS 4.1. When i tried to update my phone earlier today it told me i had to restore first, which i was expecting, when it had finished its little progress bar, it said "iPhone could not be restored, error code (-