This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

peter tong

Ranch Hand
+ Follow
since Mar 15, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
53
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by peter tong

RAD7.5, ws server 7.0
if I modified file in my workspace and start the server, the following error is shown:


[12/5/16 16:41:01:381 CST] 00000017 wtp           W org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl cleanupAfterTempSave Rename failure during final save; transfer failure failure during final save;this may result in a failure to save updates to the archive, or in a corruption of the original archive.
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: IWAE0017E Unable to replace original archive: C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\AppSrv03\wstemp\wstemp\app_158ce240c1f\mrg\cwss_apps.war
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.cleanupAfterTempSave(ArchiveImpl.java:496)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.extractNoReopen(ArchiveImpl.java:1165)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl.extractNoReopen(ArchiveImpl.java:1024)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at com.ibm.ws.management.application.AppUpdate.createDirsInPath(AppUpdate.java:206)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at com.ibm.ws.management.application.AppUpdate.mergeFiles(AppUpdate.java:128)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at com.ibm.ws.management.application.task.FileMergeTask.updatePartialEar(FileMergeTask.java:376)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at com.ibm.ws.management.application.task.FileMergeTask.update(FileMergeTask.java:301)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at com.ibm.ws.management.application.task.FileMergeTask.performTask(FileMergeTask.java:148)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at com.ibm.ws.management.application.SchedulerImpl.run(SchedulerImpl.java:294)
[12/5/16 16:41:01:611 CST] 00000017 SystemErr     R at java.lang.Thread.run(Thread.java:767)



I already installed the latest fix patch:FP0000041
2 years ago
In my rad 7.5, WebSphere Application Server v7.0, when I start it, the console show:
[12/5/16 15:38:45:259 CST] 00000008 SystemOut     O startup HTTP server on http://10.171.34.21:9083/cwss/soap
[12/5/16 15:38:45:306 CST] 00000000 TCPChannel    I   TCPC0001I: TCP Channel TCP_2 is listening on host *  (IPv6) port 9081.
1) I don't know where the 9083 is defined in "startup HTTP server on http://10.171.34.21:9083/cwss/soap"?
2) also should the above two statement use the same port? now one is 9083, one is 9081.
3) if I have another application and want to call the function in this server, should I use 9081 or 9083?
attached images are the console output and the admin console port setting.


2 years ago
if each character takes up between 1 and 4 bytes in UTF-8, then if the field in database is defined as varchar2(100 bytes), then


x should be less than or equal to 25 characters? (25 * 4 bytes = 100 bytes)
2 years ago
my jvm flie.encoding system property is Cp1252
I see the following code (with some modification):


What is the above code

doing exactly?

is this the same if I change System property file.encoding=UTF-8 and then

2 years ago
for java split function with input string
boo:and:foo
and regex
o+

"boo:and:foo".split("o+", -1);

the result is three string
'b','':and:f'',''

why the empty string between 'oo' is not counted but the last '' is counted?
the last '' is come from the end of the whole string (:foo)?
what is the exact meaning of the '+'  in the regex 'o+'?
3 years ago
then I try


the "|" is never occur in the empty input string, but it also return length = 1, why again?


input string = ""
input.split("\|", 0).length = 1
str[0]=
end



sorry that I am not very clear about String.split() function.

>
4 years ago
Great, thaks for the help
4 years ago
I still find some problem about String.split function as following example



I expect it return 3 as str[0]='06265680,8800.00', str[1]='00496455,5076.72', str[2]='', but in fact it returns


input string = "06265680,8800.00|00496455,5076.72|"
input.split("|", -1).length = 36
str[0]=
str[1]=0
str[2]=6
str[3]=2
str[4]=6
str[5]=5
str[6]=6
str[7]=8
str[8]=0
str[9]=,
str[10]=8
str[11]=8
str[12]=0
str[13]=0
str[14]=.
str[15]=0
str[16]=0
str[17]=|
str[18]=0
str[19]=0
str[20]=4
str[21]=9
str[22]=6
str[23]=4
str[24]=5
str[25]=5
str[26]=,
str[27]=5
str[28]=0
str[29]=7
str[30]=6
str[31]=.
str[32]=7
str[33]=2
str[34]=|
str[35]=
end



why it breakdown each character??

If I want it to return str[0]='06265680,8800.00', str[1]='00496455,5076.72', str[2]='', how should I modify the program?>
4 years ago
Why the function returns empty string between two consecutive single 'b'?
4 years ago
I cannot understand

public String[] split(String regex, int limit)


function, like the following example,

why "bb" between 'a' and 'c' is seem count only once occurences but between 'c' and 'x' seem count to 3 occurenaces?



output is:


str1.split("b", -1).length = 7
str[0]=a
str[1]=
str[2]=c
str[3]=
str[4]=
str[5]=
str[6]=x
end

>
4 years ago


Setting the compliance level to 1.6 generates class files compatible with 1.6 but these are not compatible with 1.4 ! You need to set the compliance level to 1.4! This is not the end of the story since Eclipse will still allow you to use classes and methods that were not available in 1.4 so you might end up with class or method not found exceptions!



I mean at first, I try to use jre1.6 and not install bounce castle provider, so I right click the orion server in eclipse and set it to use jre6 and set its compliance to 1.6 also, but then the error


error: Invalid class file format in C:\Program Files\Java\jre6\lib\rt.jar(java/util/Date.class). The major.minor version '49.0' is too recent for this tool to understand.
/jsp/reportListResult.jsp.java:6: Class java.util.Date not found in import.
import java.util.Date;
^
error: Invalid class file format in C:\Program Files\Java\jre6\lib\rt.jar(java/lang/Object.class). The major.minor version '49.0' is too recent for this tool to understand.
error: Class java.lang.Object not found in class net.emice.common.detail.MemoryResultSet.
4 errors, 1 warning


is shown.

So i use jre1.4 for the orion server and install bounce castle provider.
5 years ago


I don't think you are! I suspect that you are using a 1.4 JRE but using the 1.6 rt.jar rather than the 1.4 rt.jar . I have never used 'orion' but are you sure it does not have it's own JDK 1.4 built in used to compile JSP files? The symptoms suggest this is a strong possibility.



orion 1.5.4 is very old and in fact I do not know much about it also. in eclipse, I highlight the orion server and set its compliance level to 1.6 and use jre 1.6, so I assume it uses 1.6, but then the strange error as shown before is shown.
5 years ago
use jre1.4 and using Bouncy Castle Provider can solve the problem, for the error

Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs



it was caused by downloaded the wrong version of unlimited policy files (I downloaded the version of 1.6 instead of 1.4)
5 years ago
I try to use jre6 for my j2ee server, orion 1.5.4
but the following error is shown now


error: Invalid class file format in C:\Program Files\Java\jre6\lib\rt.jar(java/util/Date.class). The major.minor version '49.0' is too recent for this tool to understand.
/jsp/reportListResult.jsp.java:6: Class java.util.Date not found in import.
import java.util.Date;
^
error: Invalid class file format in C:\Program Files\Java\jre6\lib\rt.jar(java/lang/Object.class). The major.minor version '49.0' is too recent for this tool to understand.
error: Class java.lang.Object not found in class net.emice.common.detail.MemoryResultSet.
4 errors, 1 warning



what is it? I already using jre1.6.

if use jre1.4 and using Bouncy Castle Provider, then the following error is shown:


Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
at javax.crypto.SunJCE_b.<clinit>(DashoA12275)
... 15 more
Caused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!
at javax.crypto.SunJCE_b.a(DashoA12275)
at javax.crypto.SunJCE_b.g(DashoA12275)
at javax.crypto.SunJCE_b.f(DashoA12275)
at javax.crypto.SunJCE_t.run(DashoA12275)
at java.security.AccessController.doPrivileged(Native Method)
... 16 more

5 years ago