Frank Jacobsen

Ranch Hand
+ Follow
since May 17, 2002
Merit badge: grant badges
For More
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
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Frank Jacobsen

After upgrade to spring boot 3, its recommended to use JAKARTA instead of javax

I must find a new way to generate java objects from XSD’ es

I have been recommended this plugin: 'org.unbroken-dome.xjc'

Gradle:



I have created a binding file like this:

Binding.xml:


To setup the typesafeEnumMaxMembers, emums, there is enums that has more values then 256.


I’m getting this error when executing my gradle file:
not mapped to Enum due to EnumMemberSizeCap limit. Facets count: 325, current limit: 256. You can use customization attribute "typesafeEnumMaxMembers" to extend the limit.

I've tried different things, but how do I get gradle to use this binding file?

1 year ago
Maybe there is a faster way, but thought it would take much longer. So I'm going with this solution.

Tested it 100000 times in a loop with this string:

String testString = "Frank is# a star *";

42 milliseconds.



Thanks for all your input out there.

Kind regards
Frank  
1 year ago
I use a string buffer, because it is faster to append than to create a new string each time.

Faster = The fastes way this can be done.

Now comparing >= 0, and removed all the spaces in allowedstring.

Its all single charaters.

Stay tuned on this channel, i will try to make some test ,  on this code postet , if this works, and some performence test , with 100000, strings.



And thanks out there  
1 year ago
Its java strings, and the there is 8 strings length from 40 to 140 character , with name and address.

And yes its correct its data transform with rules.

I just tried with these few lines, it will probably solve it, but think there is a better and faster method ?

Better = nicer code

Fast   = I have to call this methoed 200.000 times every day, will this perform less then 100 Milliseconds ,I can do the performance measurement myself, but maybe there are some out there who know regex or other ways to do this more optimally.





1 year ago
I have this character set ,  of Latin and Scandinavian characters:





If have some strings, that I have to validate, if they have characters that DO NOT  match, and if they DO NOT  match,  i must replace the character with a space.
Is this possible via regex, or is there a better way, here I think about speed , and nice  readable code ?

Kind reagrds
Frank
1 year ago
I gave up on xpath, I solved my problem by not using xpath, i solved my problem with this code:



Kind regards
Frank
Yeh i can that the Envelope was there.

Im trying with this code now:



Maybe my xpath should have some namespace ? , still null

Kind regards Frank


Okay I tryed it,  this way

Element root = doc.getDocumentElement();
NodeList test = root.getElementsByTagNameNS("http://www.w3.org/2000/09/xmldsig#", "Signature");

Now with one header called "Frank"



But still he nodelist is empty ?
If have this  as org.w3c.dom object:



Im trying to get the "Sinature" in  a Element, using Xpath.

I cant figure out, why this is not working.



The nodelist have no tiems ?



1 year ago
Yes the problem was that the String strPk was not correct, I will replace it with a PEM file when I get it delivered and use bounty castle, or possibly use https://santuario.apache.org/ if there is something that can do this for me in this package. Thanks for the input, it helped me a lot :-)

1 year ago
I'm trying to make a small test to generate a private key, to make a digital signature. But it already fails on this line " PrivateKey privateKey = kf.generatePrivate(spec);"
Exception is:

java.security.InvalidKeyException: IOException : null
java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException : null
at java.base/sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(RSAKeyFactory.java:253)
at java.base/java.security.KeyFactory.generatePrivate(KeyFactory.java:389)

Been trying to find a solution for the last several hours with my friend Google, but can't figure out why this is going wrong.

1 year ago
I have a test of resilience4j.circuitbreaker.CircuitBreaker
Runs fine but the state done changed from closed after 10 times, its run 15 times and allways closed.
Can anyone see what its wrong, I think its something about the supplier.



Kind regards
Frank
2 years ago

Ron McLeod wrote:Even though you see Exporting all customer to SOLR berefore return response ... in the log, it doesn't mean that the client was still connected when that occurred.

How long does it take to execute exportAllDeleteData() and exportAddAllData()?  Could it be that the client side is only willing to wait up to 30 seconds for a response and bailed before your processing has had a chance to complete?



The program runs for 45 seconds,  you are absolutely right, that was the problem, I owe you a beer, thank you very much for giving yourself time to answer, you are my hero :-)
2 years ago

Himai Minh wrote:Hi, Frank,
one thing you can try is to put this property in your application.properties under the resources folder of your project:

Then,you can see what information is printed out on the console when you run the code.
It is better to see if there is any exception thrown from the output console.



I allready have log info on the test server. :-)
2 years ago

Ron McLeod wrote:Even though you see Exporting all customer to SOLR berefore return response ... in the log, it doesn't mean that the client was still connected when that occurred.

How long does it take to execute exportAllDeleteData() and exportAddAllData()?  Could it be that the client side is only willing to wait up to 30 seconds for a response and bailed before your processing has had a chance to complete?



Yehh maybe is returning HTML , becouse the client timeouts, while the server still is running the code, i will create some loginfo in the morning, to see if it takes over 30 seconds.
2 years ago