Joda dateTime Exception - java-8

We are getting this exception only with componentTests (service tests).
> com.thoughtworks.xstream.converters.ConversionException: Cannot create
> org.joda.time.chrono.ISOChronology$Stub by JDK serialization : null :
> Cannot create org.joda.time.chrono.ISOChronology$Stub by JDK
> serialization : null
> ---- Debugging information ---- message             : Cannot create org.joda.time.chrono.ISOChronology$Stub by JDK serialization : null
> cause-exception     :
> com.thoughtworks.xstream.converters.reflection.ObjectAccessException
> cause-message       : Cannot create
> org.joda.time.chrono.ISOChronology$Stub by JDK serialization : null
> class               :
> com.orbitz.tbs.model.txn.reservation.ReservationInfo
> required-type       : org.joda.time.chrono.ISOChronology$Stub
> path                :
> /com.orbitz.tbs.model.txn.reservation.ReservationInfo/reservationsByLocator/entry/com.orbitz.tbs.model.txn.BookReservation/reservationDate/iChronology
When we actually run the code, we don't get any errors. Can anyone tell me what library versions should we use?
We updated to JDK 8 from 6 and that is when we started getting this error.

Related

Local software updates using SWUpdate failed | Hash mismatch

I am using SWUpdate to install updates to my Avnger96 board using A+B(dual copy) scheme. I am integrating SWUpdate with Yocto. But while installing updates locally using command line parameters, installation fails with error:
Trying to update with CLI swupdate -H dh-stm32mp1-dhcor-avenger96:1.0 -e stable,copy2 -v -i /tmp/avenger96-swu-v1-dh-stm32mp1-dhcor-avenger96-20220222133501.swu -k /etc/swupdate/swupdate-public.pem
[INFO ] : SWUPDATE started : Software Update started !
[TRACE] : SWUPDATE running : [network_initializer] : Software update started
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : Found file
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : filename sw-description
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : size 1716
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : Found file
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : filename sw-description.sig
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : size 256
[TRACE] : SWUPDATE running : [swupdate_verify_file] : Verify signed image: Read 1716 bytes
[TRACE] : SWUPDATE running : [swupdate_verify_file] : Verified OK
[TRACE] : SWUPDATE running : [get_common_fields] : Version 0.1.0
[TRACE] : SWUPDATE running : [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[TRACE] : SWUPDATE running : [_parse_images] : Found compressed Image: core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz in device : /dev/mmcblk0p5 for handler raw
[TRACE] : SWUPDATE running : [_parse_bootloader] : Bootloader var: rootfspart = 5
[TRACE] : SWUPDATE running : [check_hw_compatibility] : Hardware dh-stm32mp1-dhcor-avenger96 Revision: 1.0
[TRACE] : SWUPDATE running : [check_hw_compatibility] : Hardware compatibility verified
[TRACE] : SWUPDATE running : [extract_files] : Found file
[TRACE] : SWUPDATE running : [extract_files] : filename core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz
[TRACE] : SWUPDATE running : [extract_files] : size 232476044 required
[ERROR] : SWUPDATE failed [0] ERROR : HASH mismatch : 24e9e0e03c5f6efbeb20c6b5da53841c04b9580e8409fa11d5f6307886127576 <--> 4ac608927345a1cdb725f018e20ce54c2840b1012917dffafdc85fe95dc26b14
[ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...
[TRACE] : SWUPDATE running : [network_initializer] : Main thread sleep again !
[INFO ] : No SWUPDATE running : Waiting for requests...
[INFO ] : SWUPDATE running : [endupdate] : Swupdate *failed* !
The sw-description is as follows:
software =
{
version = "0.1.0";
dh-stm32mp1-dhcor-avenger96 = {
hardware-compatibility: ["1.0"];
stable : {
copy1 : {
images: ({
filename = "core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
sha256 = "#core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
type = "raw";
compressed = "zlib";
device = "/dev/mmcblk0p4";
});
bootenv: (
{
name = "rootfspart";
value = "4";
},
);
};
copy2 : {
images: ({
filename = "core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
sha256 = "#core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
type = "raw";
compressed = "zlib";
device = "/dev/mmcblk0p5";
});
bootenv: (
{
name = "rootfspart";
value = "5";
},
);
};
};
}
}
I have set "Enable Verification of Signed Images" in menuconfig.
And also i have a question regarding installed rootfs on my device. Currently device is booted with /dev/mmcblk0p4, but I could see in linux user space rootfsB is also mounted(/dev/mmcblk0p5). I am using .wks file from Yocto to build dual partition scheme.
.
.
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root_A --part-name "rootfs_A" --align 4096 --use-uuid --active
part /rootfsB --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root_B --part-name "rootfs_B" --align 4096 --use-uuid
bootloader --ptable gpt
I am not sure why this is happening and is this expected behavior?
Can anyone please let me know what is the issue regarding SWUpdate and how to resolve it?
Your help will be much appreciated.
Thanks in advance.
P.S: Please let me know if any info is missing here.
I seems that the way your hashes are generated in the sw-description file differs from the way they are generated on your target device.
Could be: this bug, maybe you can update your swupdate version?
It seems like you are autogenerating the hashes using the meta-swupdate layer, have you tried generating them manually and tested if that works?

Windows MDM update management

I'm trying to figure out Windows update management via MDM (https://learn.microsoft.com/en-us/windows/client-management/mdm/device-update-management) and I would like to show installed and installable updates details for clients.
So following this guide, I'm getting installed/installable/... update GUIDs from the client using Update-CSP, then try to query GUID from sws.update.microsoft.com to get the metadata.
The problem is, the client is reporting update GUIDs that cannot be found in sws.update.microsoft.com. For example the device returns an update id: "1f36097b-e8c9-41a3-bcc3-baae597f692d" as an installed update.
When I query this Using GetUpdateData, it doesn't exists.
I queried installed updated on the client and found the detail:
PS C:\Windows\system32> $session.CreateUpdateSearcher().Search("UpdateID='1f36097b-e8c9-41a3-bcc3-baae597f692d'").Updates
Title : 2021-09 Cumulative Update for Windows 10 Version 20H2 for x64-based Systems (KB5005565)
AutoSelectOnWebSites : True
BundledUpdates : System.__ComObject
CanRequireSource : False
Categories : System.__ComObject
Deadline :
DeltaCompressedContentAvailable : True
DeltaCompressedContentPreferred : True
Description : Install this update to resolve issues in Windows. For a complete listing of the issues that are included in this update, see the associated Microsoft Knowledge Base article for more information. After you install this item, you may have to restart your computer.
EulaAccepted : True
EulaText :
HandlerID : http://schemas.microsoft.com/msus/2016/01/UpdateHandlers/OSInstaller
Identity : System.__ComObject
Image :
InstallationBehavior : System.__ComObject
IsBeta : False
IsDownloaded : True
IsHidden : False
IsInstalled : True
IsMandatory : False
IsUninstallable : False
Languages : System.__ComObject
LastDeploymentChangeTime : 9/14/2021 12:00:00 AM
MaxDownloadSize : 110963910278
MinDownloadSize : 0
MoreInfoUrls : System.__ComObject
MsrcSeverity :
RecommendedCpuSpeed : 0
RecommendedHardDiskSpace : 0
RecommendedMemory : 0
ReleaseNotes :
SecurityBulletinIDs : System.__ComObject
SupersededUpdateIDs : System.__ComObject
SupportUrl : https://support.microsoft.com/help/5005565
Type : 1
UninstallationNotes :
UninstallationBehavior :
UninstallationSteps : System.__ComObject
KBArticleIDs : System.__ComObject
DeploymentAction : 1
DownloadPriority : 2
DownloadContents : System.__ComObject
RebootRequired : False
IsPresent : True
CveIDs : System.__ComObject
BrowseOnly : False
PerUser : False
AutoSelection : 1
AutoDownload : 2
But when I look up this update by its name or KB article, I find the correct update id is: 9a11c8f1-525f-4088-8fb7-33d7b56dd6dc
catalog page
I'm not sure why client reports an incorrect (or deprecated?) update id.
Is there a way to make client to correct it?

Multiple #EnsuresNonNullIf should be ok; but the compiler complains

The manual of the Checker Framework claims "You can write multiple #EnsuresNonNullIf annotations on a single method", however I observe the following message if I try this:
#EnsuresNonNullIf(expression="getFieldNames()", result=true)
#EnsuresNonNullIf(expression="getFieldName(i)", result=true)
public boolean hasFieldNames() {
return fFieldNames != null;
}
The resulting error message by the Eclipse Java compiler:
Duplicate annotation of non-repeatable type #EnsuresNonNullIf. Only annotation types marked #Repeatable can be used multiple times at one target.
The resulting error message by the MVN javac compiler:
[ERROR] Blabla.java:[?,?] org.checkerframework.checker.nullness.qual.EnsuresNonNullIf is not a repeatable annotation type
I'm annotating 10-year-old code, so I'm hoping some configuration trick can safe the day :-) Without the multiple #EnsuresNonNullIf I'm up for quite a bit of manual code annotation to fix false positives that I'm not interested in...
PS: I tried using both checker-framework-2.8.1 and 2.9.0 with similar results, and always using <maven.compiler.source>1.8</maven.compiler.source>
I found this issue on the Checker Framework issue tracker: https://github.com/typetools/checker-framework/issues/1307
It explains an "enhancement" request for adding #Repeatable to the following CF annotations:
> #DefaultQualifier -- DONE
> #EnsuresKeyFor
> #EnsuresKeyForIf
> #EnsuresLockHeldIf
> #EnsuresLTLengthOf
> #EnsuresLTLengthOfIf
> #EnsuresMinLenIf
> #EnsuresNonNullIf
> #EnsuresQualifier -- DONE
> #EnsuresQualifierIf -- DONE
> #FieldInvariant
> #GuardSatisfied
> #HasSubsequence
> #MethodVal
> #MinLenFieldInvariant
> #RequiresQualifier -- DONE
> #SubstringIndexFor
And the discussion contains a workaround, since EnsuresQualifiersIf is already repeatable:
#EnsuresQualifiersIf({
#EnsuresQualifierIf(result=true, qualifier=NonNull.class, expression="getFoo()"),
#EnsuresQualifierIf(result=false, qualifier=NonNull.class, expression="getBar()")
})
boolean hasFoo();
And in my case that works out to:
#EnsuresQualifiersIf({
#EnsuresQualifierIf(result=true, qualifier=NonNull.class, expression="getFieldNames()"),
#EnsuresQualifierIf(result=true, qualifier=NonNull.class, expression="getFieldName(i)")
})
public boolean hasFieldNames() {
return fFieldNames != null;
}

Maven ComparableVersion contains a bug of "Load of known null value"

https://github.com/apache/maven/blob/master/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
The SpotBugs found this Load of known null value:
Load of known null value in package.ComparableVersion$ListItem.compareTo(ComparableVersion$Item) [package.ComparableVersion$ListItem] At ComparableVersion.java:[line 513] NP_LOAD_OF_KNOWN_NULL_VALUE
in the line of
int result = l == null ? (r == null ? 0 : -1 * r.compareTo(l))
: l.compareTo(r);
Environment:
Tryied both Windows command line and Eclipse
spotbugs-maven-plugin version: tried both 3.1.6 and 3.1.12
Maven version: 3.5.3
Java version: 1.8.0_171
May I ask how to fix it? Thank you so much!

Not able to create task from xl-deploy cli

I want to trying to deploy the dar file using cli. I had set up the cli on one of our build machine.
I have gone through the document as well(https://docs.xebialabs.com/xl-deploy/4.5.x/climanual.html). But when I am running the below code. I am getting an error on the step where task is getting created.
# Import package
deployit> package = deployit.importPackage('demo-application/1.0')
# Load environment
deployit> environment = repository.read('Environments/DiscoveredEnv')
# Start deployment
deployit> deploymentRef = deployment.prepareInitial(package.id, environment.id)
deployit> deploymentRef = deployment.generateAllDeployeds(deploymentRef)
deployit> taskID = deployment.deploy(deploymentRef).id
deployit> deployit.startTaskAndWait(taskID)
Error:
javax.ws.rs.ProcessingException: com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception : java.lang.NullPointerException
cause-message : Name is null
class : com.xebialabs.deployit.engine.api.execution.SerializableTask
required-type : com.xebialabs.deployit.engine.api.execution.SerializableTask
converter-type : com.xebialabs.deployit.booter.remote.xml.TaskConverterSelector
path : /task
line number : 1
version : not available
-------------------------------
How can I fix this issue?
Here is an Example in which you can start deployment task, check each step status and print logs for Failed ones,
# Load package
package = repository.read('Applications/TestApps/1.0')
# Load environment
environment = repository.read('Environments/TestingEnv')
# Start deployment
deploymentRef = deployment.prepareInitial(package.id, environment.id)
depl = deployment.prepareAutoDeployeds(deploymentRef)
task = deployment.createDeployTask(depl)
deployit.startTaskAndWait(task.id)
# Check on deployment errors
steplist = tasks.steps(task.id)
for s in steplist.steps:
print(' Step: ' + s.description)
print(' Status: ' + str(s.state))
if str(s.state) == 'FAILED':
print('ERROR ' + s.log)
Also you can have a look on XLDeploy log file located at XLDeploy server under "XLD_INSTALL_HOME/log/deployit.log" to get more details in case of errors.

Resources