Pax- Exam #Configuration is deprecated in 4.6.0 - pax-exam

In the newer version of Pax-Exam #configuration is deprecated. How do we use configuration in newer versions?..Any sample code?

I assume you're talking about org.ops4j.pax.exam.junit.Configuration.
A look at the Javadoc or source code of that class reveals the replacement to use:
org.ops4j.pax.exam.Configuration.

Related

Replacement for deprecated Shopware EntityRepositoryInterface is also deprecated

According to Shopware 6.4.13.0 upgrade instructions, EntityRepositoryInterface has been deprecated and should be replaced by EntityRepository. But EntityRepository is also marked as deprecated in my IDE, using the recommended development setup all upgraded to the latest versions:
PhpStorm (2022.1.3 Build #PS-221.5921.28)
Symfony Support plugin 2022.1.230
Shopware plugin 4.4.3
Shopware development setup cloned from github.com/shopware/development
Shopware platform "6.4.9999999.9999999 Developer Version"
loaded and upgraded by psh according to composer.json in development setup:
"require": {
"shopware/platform": "6.4.x#dev || dev-trunk"
Deprecation note in my PhpStorm IDE:
Class 'EntityRepository' is deprecated
class EntityRepository implements EntityRepositoryInterface \Shopware\Core\Framework\DataAbstractionLayer\EntityRepository
Deprecated: 5.6.0
Namespace:
\Shopware\Core\Framework\DataAbstractionLayer\
Source:
development/vendor/shopware/platform/src/Core/Framework/DataAbstractionLayer/EntityRepository.php
How to handle the deprecation and what to use instead of EntityRepositoryInterface that will not be deprecated as well?
How to know if the IDE's deprecation notice can be safely ignored? I suppose that it can be ignored, as the mentioned version number "5.6.0" does not match any current or upcoming Shopware 6 release.
How to turn off misleading deprecation notices in my IDE?
Has been fixed with commit https://github.com/shopware/platform/commit/99cf9093464d679f6abcb91bb68cc4205bc6ccf0
it has now only #final https://github.com/shopware/platform/blob/trunk/src/Core/Framework/DataAbstractionLayer/EntityRepository.php#L29

Where to download HttpServlet.java v1.2?

We have a old system that use HttpServlet v1.2, where can I download source for debug in eclipse? I googled obky found v2.0 or v3.0...
The `(version 1.2 : 46.0, ...) indicates that this class file was compiled with java 1.2.
Java 1.2 was specified for both servlet-api 2.2 and 2.3.
As Tomcat has been the reference implementation of these specifications forever, it is possible to rummage through their archive and find (for example) Tomcat 3.3, which was the RI for the 2.2 specification.
A list of distributions can be found at http://archive.apache.org/dist/tomcat/tomcat-3/. If you dig through the binary distributions there you will find a servlet.jar which might match your needs.
If this turns out to be too old (indicated by missing methods in the Java classes it provides) then you will need to search forwards in the Tomcat archives to find the release that implements the Servlet 2.3 specification instead.
(It looks like http://archive.apache.org/dist/tomcat/tomcat-4/ and related contains the Servlet 2.3 spec jars)

Unable to use FirebaseRecyclerAdapter

I am getting cannot resolve FirebaseRecyclerAdapter when trying to use it even after adding firebase ui in gradle dependency.Thanks in advance
I was getting the same issue, it's resolved by adding the firebase-ui dependency in build.gradle (module:app)
compile 'com.firebaseui:firebase-ui-database:0.4.0'
Also add the import in .java file where you're trying to declare it.
import com.firebase.ui.database.FirebaseRecyclerAdapter;
Go to build.gradle file, add a dependency (get the latest one from here https://github.com/firebase/FirebaseUI-Android)
The latest one on 5 October 2019 is implementation 'com.firebaseui:firebase-ui-database:6.0.2'
If You are facing Problem in 2020 then use this dependency:
implementation 'com.firebaseui:firebase-ui-database:6.0.2'
above mentioned answers are not working in today's date i have tried all of them,remember import this package too:
import com.firebase.ui.database.FirebaseRecyclerAdapter;
Can you show your build.gradle file?
Also, have you tried putting this under your package name in your java class: import com.firebase.ui.database.FirebaseRecyclerAdapter;?
In your app level gradle:add the following firebase dependency
dependencies {
compile'com.firebaseui:firebase-ui-database:1.1.1'
The dependencies quoted above don't seem to work anymore. After about an hour of searching online, I found this; hopefully it helps someone. It certainly fixed my problem:
compile 'com.firebaseui:firebase-ui:0.4.3'
Use exactly the matched version of FireBaseRecyclerAdapter
to the Versions that you have included in gradle for the Firebase Database.
This link will surely help you
https://github.com/firebase/FirebaseUI-Android
In this link, you will find the matched Firebase dependency according to the version.
I tried to import the following three packages, and my problem is solved:
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'com.firebaseui:firebase-ui-database:8.0.1'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
You can use this gradle dependencies

UnityContainer() LoadConfiguration not found

I have this code:
1: IUnityContainer container = new UnityContainer();
2: container.LoadConfiguration();
Line 1 works, but line 2 not. LoadConfiguration is not found as a member.
I think, i have register all unity-dlls. Why is LoadConfiguration() not found?
LoadConfiguration() is not a member of IUnityContainer. You must be thinking of some other class or interface. Perhaps this one?
IUnityContainer is in the Microsoft.Practices.Unity namespace, but the LoadConfiguration() extension method lives in the Microsoft.Practices.Unity.Configuration namespace. Have you added that namespace to your code?
I believe in the latest version of Unity 5.9.3, Microsoft.Practices.Unity dlls are not part of the nuget. You'd have to install another package from nuget 'Unity.Configuration'. Its an open source package offered by Unity. As of today, Unity Configuration latest version is 5.9.0.
Not only
Unity.Configuration package should be installed
but also
using Microsoft.Practices.Unity.Configuration;
should be declared at top of the cs file.

Access to com.sun.crypto.provider in Equinox

I am trying to integrate some pre-existing code that relies on the
com.sun.crypto.provider.SunJCE class into our Equinox based
application (version 3.7.1). Now I know by default the com.sun
packages are not accessible to bundles, so I made a fragment with the
idea of extending the framework to export the package. Here is its
manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Extension
Bundle-SymbolicName: extension
Bundle-Version: 1.0.0.qualifier
Fragment-Host: system.bundle; extension:=framework
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: com.sun.crypto.provider
Clue 1: The PDE marks the Export-Package line and says that
com.sun.crypto.provider does not exist in this plugin.
I created a sample bundle that just instantiates the class in question
in the bundle activator. That bundle's manifest is:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cryptotest
Bundle-SymbolicName: cryptotest
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: cryptotest.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.sun.crypto.provider,
org.osgi.framework;version="1.3.0"
Clue 2: The PDE marks the instantiation with an access restriction.
Despite the two errors, the project does compile and I am able to
start debugging. When starting the sample bundle, I receive a class
not found exception. However, when I do a "packages 0" in the console, it appears
Equinox is claiming to export this package:
com.sun.crypto.provider;
version="0.0.0"<org.eclipse.osgi_3.7.1.R37x_v20110808-1106 [0]>
cryptotest_1.0.0.qualifier [2] imports
Now, I have found an ugly work around that appears to work in my minimal example. It is to basically wrap Java's jce provider jar in a separate plugin and include that with my application, but that just seems wrong.
Could somebody please provide some insight into what's going on? Is
there something obvious I am missing?
This looks like a package that is present in your JVM, but only when running on a Sun one. These are not exposed by the system bundle by default, because OSGi is not built solely for Sun VMs.
You can, however, instruct the framework to expose this package. To do so, you set the org.osgi.framework.system.packages.extra property to a list of packages, which includes your com.sun.crypto.provider package. There are several ways to do this, but you could, for instance start Equinox with a system property,
-Dorg.osgi.framework.system.packages.extra=com.sun.crypto.provider
By the way, this is not Equinox-specific, but a standard OSGi-construct.

Resources