Could not load extension class org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl - cxf

I'm running junit on a class that is configured for cxf. I get this error
Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not load extension class org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl.
when I ask Spring to retrieve the instance on he class. maven dependency includes cxf 2.7.4 (cxf-rt-ws-policy-2.7.4.jar) and I see neethi 3.0.2.jar is also included. Another post mentioned an issue if neethi 2.x was used with cxf 2.x. but this is not my case.

Use mvn dependency:tree to find out which dependency also has the org.apache.neethi:neethi:{version}. In my case it was the org.wso2.carbon.core.
To fix this I added the neethi dependency needed, first in my dependency pom tree.

Related

ABP Framework, ConfigureByConvention not defined

I'm following this tutorial https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=NG&DB=EF#map-the-book-entity-to-a-database-table
In that step it instructs me to add b.ConfigureByConvention to the configuration in DbContext but dotnet tells me it is not defined.
I have abp version 5.3.4 and checked that the tutorial is for the correct version.
I generated the project with the abp CLI so the packages should not be a problem.
Is there some step that I overlooked?
The complete error is:
'EntityTypeBuilder' does not contain a definition for
'ConfigureByConvention' and no accessible extension method
'ConfigureByConvention' accepting a first argument of type
'EntityTypeBuilder' could be found (are you missing a using
directive or an assembly reference?)
The ConfigureByConvention method is an extension method, so your IDE probably could not find the related namespace and not suggested to you.
If you add using Volo.Abp.EntityFrameworkCore.Modeling; as namespace then it should work as expected.

Testing after update: The plugin class `WyriHaximus\TwigView\Plugin` cannot be found

I started update CakePHP 3.5 to 3.6, but when I try check my code by tests, i got error:
InvalidArgumentException: The plugin class Migrations\Plugin cannot be found. Ensure your autoloader is correct.
After, I runed command php composer.phar require --dev phpunit/phpunit:"^5.7|^6.0"
Now a got next error:
InvalidArgumentException: The plugin class WyriHaximus\TwigView\Plugin cannot be found. Ensure your autoloader is correct.
And I don't used this plugin before.
Also I used this release files for update deprecated code
How I can fix it, and what could provoke this problem?
Full error:
3) App\Test\TestCase\Controller\CardsControllerTest::testEditPostError
InvalidArgumentException: The plugin class `WyriHaximus\TwigView\Plugin` cannot be found. Ensure your autoloader is correct.
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\BaseApplication.php:127
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\BaseApplication.php:95
C:\work\OSPanel\domains\project.loc\vendor\cakephp\bake\src\Plugin.php:50
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\BaseApplication.php:154
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\Server.php:124
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\Server.php:82
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\TestSuite\MiddlewareDispatcher.php:149
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\TestSuite\IntegrationTestCase.php:495
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\TestSuite\IntegrationTestCase.php:392
C:\work\OSPanel\domains\project.loc\tests\TestCase\Controller\CardsControllerTest.php:229
Thank you.
Make sure you have removed/commented Plugin::routes(); line from your config/routes.php file.

Vespa Tutorial – HTTP API use-case fails to activate with IllegalArgumentException

I'm currently following the Vespa tutorials, and ran into an issue with the HTTP API use-case. Everything works fine from the mvn install package to the vespa-deploy prepare target/application.zip.
The call to vespa-deploy activate returns normally, but the application then never gets available on localhost:8080. Looking at /opt/vespa/logs/vespa/vespa.log (in the VM) one finds the following stack trace:
Container.com.yahoo.jdisc.core.StandaloneMain error Unexpected:
exception=
java.lang.IllegalArgumentException: Could not create a component with id 'com.mydomain.demo.DemoComponent'.
Tried to load class directly, since no bundle was found for spec: sample-app-http-api-searcher.
If a bundle with the same name is installed, there is a either a version mismatch or the installed bundle's version contains a qualifier string.
at com.yahoo.osgi.OsgiImpl.resolveFromClassPath(OsgiImpl.java:48)
...
This occurred using a fresh Docker image with a clean clone of the sample-apps git repository. Preparing and activating the basic sample as well as the other http example did work seamlessly.
I checked the sources and the xml files for obvious problems but don't have any clue about what is failing and where.
target/application.zip contains
application/components/http-api-using-searcher-1.0.1-deploy.jar
application/hosts.xml
application/searchdefinitions/basic.sd
application/services.xml
And the jar itself does contain a com/mydomain/demo/DemoComponent.class file (among other things).
Potentially related issue on the github tracker: https://github.com/vespa-engine/vespa/issues/3479 I'll be posting a link to this question there as well, but I still think it's worth a SO question, at least to get some action behind the vespa tag :)
The bundle id in the application's services.xml file was wrong. Please pull the application from git and try again now. See also PR: https://github.com/vespa-engine/sample-apps/pull/18
Brief explanation: The bundle id given in the bundle="<id>" declaration in services.xml must match the 'Bundle-SymbolicName' in the bundle's manifest. When the bundle has been built with the Vespa bundle-plugin, the symbolic name is by default the same as the project's artifactId. Hence, in most cases you just have to verify that the bundle id matches the artifactId.

Jersey linking support with Google App Engine issue

I didn't manage to use the Jersey linking support with Google App Engine, I'm getting these exceptions when trying to access the application :
Caused by: javax.el.ELException: Could not find expression factory class
...
Caused by: java.lang.ClassNotFoundException: de.odysseus.el.ExpressionFactoryImpl
As specified in the documentation, I put this in the Jersey servlet section of the web.xml :
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.sun.jersey.server.linking.LinkFilter</param-value>
</init-param>
I also add the jersey-server-linking-1.13.jar to the WEB-INF/lib directory of my project.
I tried to add el-api.jar first, then juel-2.1.0.jar to the WEB-INF/lib directory but I'm still getting these errors.
I'd like to know if someone could give me some hints about the way to deal with this. When I don't use the Jersey linking jar, everything is working as expected.
I had a similar problem with my GAE app. It was working fine with el-api and el-impl but started asking for de.odysseus.el.ExpressionFactoryImpl as development progressed. I made the switch but when I added JUEL to my pom.xml, I got the same error as John Prince (java.security.AccessControlException).
The solution for GAE users is to use JUEL 2.2.7.
At the time of this writing, 2.2.7 is not available in maven central. However, you can find it on
<repository>
<id>repo-id</id>
<name>repo-name</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
and link with whatever you need from
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-api</artifactId>
<version>2.2.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-impl</artifactId>
<version>2.2.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-spi</artifactId>
<version>2.2.7-SNAPSHOT</version>
</dependen
Source: https://github.com/beckchr/juel/issues/73
The issue is due to de.odysseus.el.ExpressionFactoryImpl class not being found. I will assume that you have added the jars as you have mentioned to the WEB-INF\lib folder.
I would suggest that you view the JAR files via theProject Explorer , simple expand them in Eclipse and see if you can find the de.odysseus.el.ExpressionFactoryImpl class in ny of the JAR files that you have added.
I "solved" the problem by adding "juel" and "juel-impl" as dependencies of my project (we're using Maven; if you're doing it manually, you might have to figure out exactly what those projects contain).
However, as soon as I did that, I started getting a different exception:
java.security.AccessControlException: access denied (java.io.FilePermission C:\Program Files (x86)\Java\jdk1.6.0_33\jre\lib\el.properties read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:289)
...
I'm pretty sure that's because it's running afoul of GAE restrictions.
I noticed in the original ClassNotFound exception it was trying to use the URLClassLoader; I'm also wondering if that problem was ultimately a GAE issue as well.
At this point, it seems like Jersey linking support isn't compatible with GAE.
This issue is (or rather was) due to a missing implementation of the Unified Expression Language. The EL API defines a static method that looks up an implementation of the ExpressionFactory class. There are various ways to define which implementation is to be used:
Use the Services API (as detailed in the JAR specification). If a resource with the name of META-INF/services/javax.el.ExpressionFactory exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class.
Use the properties file "lib/el.properties" in the JRE directory. If this file exists and it is readable by the java.util.Properties.load(InputStream) method, and it contains an entry whose key is "javax.el.ExpressionFactory", then the value of that entry is used as the name of the implementation class.
Use the javax.el.ExpressionFactory system property. If a system property with this name is defined, then its value is used as the name of the implementation class.
Use a platform default implementation.
(Source: http://docs.oracle.com/javaee/7/api/javax/el/ExpressionFactory.html#newInstance())
App Engine appears to have defined JUEL as default implementation but does not provide the respective packages.
In order to solve this, you need to (1) provide EL API and implementation packages and (2) use one of the above ways to link it. See https://stackoverflow.com/a/19814199/2099217 for details.

Building Maven Plugin - API to resolve maven properties

I am creating a plugin that reads information from the pom and I'm encountering some properties such as ${basedir} etc when it comes to the elements that specifies directories. I was wondering if Maven have a API that I can use where I can just pass on that properties and they can resolve it for me.
preferably not having to run another plugin first. Its possible to do the crude way but was just wondering if there's anything "fancier" that i could use.
thanks!
Declare a property which maven will inject the MavenProject model into:
/** #parameter default-value="${project}" */
private org.apache.maven.project.MavenProject mavenProject;
Then you can access properties via getProperties() as described here:
http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook#MojoDeveloperCookbook-StoringProperties
You'll also need to declare a dependency on org.apache.maven:maven-project:${version of maven} in your mojo's POM.
I hope that was what you were asking about...
-tim

Resources