Where to check weblogic server xmlbeans version that it loads and how to point to custom lib version? - oracle-adf

I am trying to upgrade my Oracle ADF application's apache poi from 3.17 to latest 5
Facing difficulties in xmlbeans version mismatch and class loader

Tell us your exact JDeveloper version, please!
This isn't an ADF or Jdeveloper problem but a server class loader problem.
It can be easily fixed by telling the server to prefer the libraries you install with your application. The class loader then uses your jar version before looking into already loaded ones.
See https://tompeez.wordpress.com/2015/06/06/pitfalls-when-using-newer-versioned-libraries-than-shipped-with-jdeveloper-or-weblogic-server/

Related

JAXB ClassNotFoundException com.sun.xml.bind.v2.ContextFactory when hot-deploying camel routes

Yes I know, there are numerous questions and answers since JAXB was removed from JDK 11. But this one is specific.
I've a Wildfly Server (tested with 18.0.1 and 16.0.0) running with the wildfly-camel subsystem 11.0.1 patch applied. The patch installs Camel 2.25.0
Deploying and Hot-Deploying (while the server is up) Camel routes works fine!
Until I deploy Liferay on the same server :-(
Then the Hot-Deploy of a camel route gives me the annoying
[java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory from [Module "org.apache.camel.spring" version 2.25.0...
exeption.
No matter if I run the server on JDK 11 or JDK 8! Liferay 7.3.2 claims to be runnable on both JDK versions so I guess it has something to with the way Liferay was build.
Reading this article
http://www.descher.at/descher-vu/2019/01/java-11-jaxb-and-osgi/
that the JAXB topic is very complex and far from being resolved.
Question:
How can a deployed application destroy otherwise working classpath resolutions?
And more important:
How to fix it?
I tried removing the 2 jars in question jaxb-api.jar and jaxb-impl.jar from Liferay. But that didn't help.
Turns out that the root cause of the error is a missing dependency to com.sun.xml.bind in the org.apache.camel.spring module of the wildfly-camel patch.
I filed the issue in detail.
Looks like Liferay has nothing to do with it. Because in theory jboss-modules should separate the deployments.

Using DBup with octopus deploy error, (System.Data.SqlClient is not supported on this platform.)

I'm using .net core 2.1 project with DBUP library, but when I try to run the DBUP inside octopus deploy the migration tool is returning an error System.Data.SqlClient is not supported on this platform.
I followed all these steps from an Octopus Documentations https://octopus.com/blog/dbup-database-deployments...
Already did this steps to fix the problem but without success:
net core SDK 2.1, 2.2 installations on the target server
Restart the server
New release with System.Data.SqlClient nuget package associated with the DBUP Project
Not sure what I can do more to fix this issue
Found the problem, DBUP project needs to be published isolated from other projects.
My bad was, trying to run/use dbupproject.dll file as a reference from other projects.

Can't install Microsoft.Toolkit.Uwp NuGet package in WPF app

I'm losing my mind here trying to install the Microsoft.Toolkit.Uwp NuGet package into a WPF app (need the toast notifications and possibly some more stuff from UWP), but I always get the following error, no matter which version of the toolkit I'm trying to install and no matter which .NET version I target:
Could not install package 'Microsoft.Toolkit.Uwp XXX'. You are trying to install this package into a project that targets '.NETFramework,Version=ZZZ', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
The weird thing is that Microsoft actually sends you to the Toolkit to do the exact thing I'm trying: get toast notifications from a WPF app, as can be seen here:
https://learn.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/send-local-toast-desktop
Excerpt from Microsoft's website
Tried downloading the NuGet package and install it from the local source, tried downloading the whole GitHub project, but to no avail. What am I doing wrong here, guys? I can't seem to figure it out.
P.S: I can't use UWP directly, because this will be an internal company app which needs to do lots of stuff not supported by UWP.
The documentation tells you to download the Notifications library. The Microsoft.Toolkit.Uwp package is not compatible with WPF but the Microsoft.Toolkit.Uwp.Notifications package is.

NoClassDefFoundError: Could not initialize OauthRawGcsServiceFactory on production environment

I'm using appengine-sdk 1.9.3.
In devserver, works in Eclipse and Ant normally.
When I deploy (update) to appengine (production environment), I get this error:
event.getResults(): [<pre>Error for /p7/formPanelServlet
java.lang.NoClassDefFoundError: Could not initialize class
com.google.appengine.tools.cloudstorage.oauth.OauthRawGcsServiceFactory
at com.google.appengine.tools.cloudstorage.GcsServiceFactory.createRawGcsService(GcsServiceFactory.java:42)
at com.google.appengine.tools.cloudstorage.GcsServiceFactory.createGcsService(GcsServiceFactory.java:34)
at com.bitvisio.p7.server.FormPanelServlet.<init>(FormPanelServlet.java:27)
At FormPanelServlet.java:27, the code is:
private final GcsService gcsService = GcsServiceFactory
.createGcsService(new RetryParams.Builder()
.initialRetryDelayMillis(10)
.retryMaxAttempts(10)
.totalRetryPeriodMillis(15000)
.build());
I put the lib appengine-gcs-client-0.3.9.jar in war/WEB-INF/lib. I think there is a problem with this lib.
Thanks for help.
Always use tools like Maven or Ivy to resolve dependencies for you. Copying JARs to war/WEB-INF/lib/ directory and editing .classpath file manually will be painful and may not help you always. If you use Eclipse & Google App Engine plugin, use Add Google APIs... as mentioned here - Google Plugin for Eclipse. In my case, adding Cloud Storage API via Google Plugin for Eclipse helped resolve this NoClassDefFoundError.
I had the same problem. I use Ivy to resolve dependencies and always get the latest.integration (with Maven use RELEASE) for revisions.
However I usually ignore transitive libraries. It looks like Google is expanding the API family - at least splitting out discrete functionality.
There are now quite a few transitive dependencies and it seems they released a new version of the GCS client around the same time as 1.9.3.
Getting all dependencies and packaging them in my deployment fixed my issue. I did not have the issue in development which made it more confusing.
You are facing this issue because you are not adding the some of the jar like
google-api-services-storage-v1-rev78-1.22.0.jar download link
joda-time-2.94.jar download link
guava-19.0.jar link to download
you can use the different version of jar according to your appengine-gcs-client jar file.
Note : Add all these jar and build path with the project and problem will get solve.

How to import java.nio.file package

Im trying to listen to a directory for changes, then discovered java.nio.* was developed to handle efficiently such tasks and more. Then downloaded jdk1.7.0_02 from oracle and started eclipse with it. Then created new java project, tryed to implement some class from java.nio.file and Oh my eyes! "The import java.nio.file cannot be resolved".
Do i have to find some .jar in the whole jdk1.7.0_02 directory that contains such package? or is something wrong with my classpath?
Thank you in advance!!
You've different version of JDKs. You just need to set JDK7/JRE7 version eclipse project. You may also select the Execution environment JRE to JavaSE 7 while creating a new project.
The JDK your projects use to compile, the version of the resulting class files, the JRE they used to execute and the JDK eclipse runs with are widely independent settings.
The New I/0 is named as the NIO in javaSE 7.0 ("Dolphin").
The below link described as in details.
wiki - NIO

Resources