CXF build error - build

I'm trying to build CXF and i'm getting the error:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Thrown by JAXB: cvc-complex-type.3.2.2: Attribute 'xjc:recursive' is not allowed to appear in element 'class'. at line 44 column 28 of schema jar:file:/home/XXX/Downloads/apache-cxf-2.2.10-src/tools/wsdlto/databinding/jaxb/target/cxf-tools-wsdlto-databinding-jaxb-2.2.10.jar!/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxbBinding_jaxb22.xml
I searched for the problem and some said that it was an issue with older versions of JAXB and it was resolved in version 2.2.
I have xjc 2.2.4-2 which is ok.
Any help is appreciated.

I moved from JDK 1.7 to 1.8 and started getting this error. It is because of below versions of jaxb which needs to be 2.2.x
com.sun.xml.bind:jaxb-xjc:2.1.13
com.sun.xml.bind:jaxb-impl:2.1.13
If we are using old version of org.apache.cxf (in my case 2.5.4), then even if we explicitly move above dependencies to new versions in pom file still 2.1.13 versions are used because these are referred from org\apache\cxf\cxf-parent\2.5.4\cxf-parent-2.5.4.pom
Solution is to move to new org.apache.cxf version which is compatible to JDK 1.8

Here is an hint in the CXF mailing list.
But that's not the issue I am facing, as I have nothing in my endorsed directory. But I made the switch from Oracle JDK 7 to OpenJDK 8. Have you done something similar?

Related

ExtensionsMetadataGenerator error when upgrading Azure Functions SDK

I upgraded my azure function sdk from 1.0.14 to 1.0.28 and I get this build error:
The ExtensionsMetadataGenerator package was not imported correctly.
I can't find any documentation or ways to resolve it.
According to the 1.0.28 function sdk released several day ago, it may have some bugs in it.
Workaround:
Manually adding the
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator nuget package to your project and it will work well.
I got this error when starting with the Visual Studio Function App template which uses Microsoft.NET.Sdk.Functions 1.0.31 and is a .NET Core 2.0 App.
Nuget Package Manager wants to update the Microsoft.NET.Sdk.Functions package to version 3.0.2 which it tries to do but the app is still .NET Core 2 and you get the error:
The ExtensionsMetadataGenerator package was not imported correctly.
To resolve this update the application to .NET Core 3:
Make sure you update your Microsoft.NET.Sdk.Functions NuGet package to the newest version that supports your app's version of .NET.
For example, I have a web app running .NET 2.1, I had to rollback the NuGet version to 1.0.36, and the next version (3.0) only worked on .NET 3 and up. After doing this, Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator NuGet was not needed at all and all my errors were gone.
I am working with microsoft.net.sdk.functions 1.0.38 and see the same message but in my case it is a build warning and not an error.
I installed the suggested NuGet package with the version required. However, I then received 3 warnings:
The ExtensionsMetadataGenerator package was not imported correctly. Are you missing 'C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets' or 'C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props'? "C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.props" cannot be imported again. It was already imported at "C:\Users\me\.nuget\packages\microsoft.net.sdk.functions\1.0.38\build\Microsoft.NET.Sdk.Functions.props (56,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\myproject.Web\myproject.Web.AzureFunctions\myproject.Web.AzureFunctions.csproj] "C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets" cannot be imported again. It was already imported at "C:\Users\me\.nuget\packages\microsoft.net.sdk.functions\1.0.38\build\Microsoft.NET.Sdk.Functions.targets (64,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\myproject.Web\myproject.Web.AzureFunctions\myproject.Web.AzureFunctions.csproj]
Worse still my project would not build - it freezes on build with no way to cancel. The only way to cancel was to do, elevated PowerShell:
stop-process -name "dotnet"
To fix this I tried uninstalling the NuGet package but this is not enough as it still seems to be used if it is on the system (even though the project does not reference it?!?).
It is necessary to actually delete the package from package store, i.e. at.
C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator
Or an alternative is to comment out the lines:
<GenerateFunctionsExtensionsMetadata SourcePath="$(_FunctionsExtensionsDir)" OutputPath="$(_FunctionsExtensionsDir)"/>
From:
C:\Users\me\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets
I have no idea if this is safe to do so but it gets rid of the warning message. I instead opted to just delete the NuGet package and live with the original warning.
Looks like a real mess with microsoft.net.sdk.functions package.

Nuget paths are different after csproj upgraded

I am trying to upgrade my WFP project from the VS 2015 format to the new VS 17 format. There is a lot of trial and error involved but I have come across an issue which I can find no solution for online:
Some of my code is looking for a file in a certain location:
name C:\git\myproj\packages\A.B.C.Installer.4.1.7\setup\dbpkg\MyProj.dbpkg is invalid.'
Unfortunately the new nuget places the same file in:
C:\git\myproj\packages\a.b.c.installer\4.1.7\setup\dbpkg\MyProj.dbpkg
It does two things different:
everything is lowercase
instead of appending the version, it create a new directory
How can I configure the nuget client to behave like it did before? I am unable to change my code to match.
How can I configure the nuget client to behave like it did before? I am unable to change my code to match.
I am afraid you have to update your code. That because this is the expected behavior now for the new NuGet.
Package ids and versions are case insensitive in NuGet and are now
written out lowercase to the global packages folder to avoid conflicts
on case sensitive file systems.
You can check some more details info from following thread:
NuGet PM 3.5.0 incorrectly using lowercase path in *.nuget.targets
So, if you update your project to the new VS 17 format, you have to update you code to resolve this issue. I saw you saying that you are unable to change my code to match, but this change was designed to make nuget work better, there is no ticket for us to return to the past at this moment.
Hope this helps.

Getting error after upgrade sitecore 7.5 to 8.0 Method not found: 'Sitecore.Analytics.Tracking.CurrentInteraction"

I upgraded my Sitecore from 7.5 to 8.0 and when I tried to access my website; I got the following error:
Method not found: 'Sitecore.Analytics.Tracking.CurrentInteraction Sitecore.Analytics.Tracking.Session.CreateInteraction(System.Web.HttpContext)'.
Make sure that the assembly Sitecore.Analytics.dll has been copied to the bin folder in Website folder.
Those issues tend to arise when performing upgrade. Point to note here is to check the other Sitecore dlls with a vanilla Sitecore to make sure everything is up-to-date.
Compare to 7.5 many methods got deprecated in 8.0 sitecore.Analytics.dll and added couple of other dll wrt to analytics. If you have used those deprecated methods then you need to change in the code.

Jenkins build randomly fails with a StackOverflowError during AspectJ weaving

Our Jenkins (maven) build randomly fails with the following error stack:
-- (StackOverflowError) null
null
java.lang.StackOverflowError
at org.aspectj.weaver.World.resolve(World.java:273)
at org.aspectj.weaver.World.resolve(World.java:209)
at org.aspectj.weaver.UnresolvedType.resolve(UnresolvedType.java:645)
at org.aspectj.weaver.ResolvedType.getRawType(ResolvedType.java:2331)
at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:427)
at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:393)
at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:427)
at org.aspectj.weaver.ReferenceType.isAssignableFrom(ReferenceType.java:393)
this failure is definitely not caused by actual code change as usually after such a failure, the subsequent build, manually triggered (i.e. not code committed), succeeds.
Versions are as follows :
Jenkins: 1.501
maven: 2.2.2
aspectjrt: 1.6.10
Anyone has an idea how to address this?
Just guessing, but a similar error occurred due to a bug which was fixed in 1.6.8. What blocks you from upgrading to the current AspectJ release? Yours is really old.
I believe the reason upgrading to the latest version of aspectj didn't fix the issue was because aspectj maven plugin version 1.3 was defined in the pom. This version of the plugin has a dependency on aspectj version 1.6.7 (version prior to 1.6.8 where fix was introduced). Upgrading the plugin to version 1.4 (which depends on aspectj version 1.6.11) seems to have fixed the problem as we didn't get the StackOverflowError exception since then.
In general terms, dependency tree (including plugins) should be checked in case there is an obsolete hidden dependency.
The commands to find out the dependency tree (including plugins) are :
mvn dependency:tree
and
mvn dependency:resolve-plugins

java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException while deploying on jboss

I have a weird problem that will make me crazy since 3 days.
I'm generating a client stub(xmlbeans) using axis from a wsdl file then using it to call Ms CRM web service.
My webservice call is working fine in eclipse (having added generated xml resources to classpath) and when i export everything to my jboss server I'm getting this error:
the cause is 'java.lang.reflect.InvocationTargetException'
java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
XMLStreamException is within the xmlbeans-2.3.jar file which is included within the dependencies in the server side so I can't understand why it stops working when deployed to jboss.
JDKs version are exactly the same as well as lib jars.
Any ideas please.
Thankss
Applies to versions <= 3.17 (Java 6):
This error indicates that the class XMLEventFactory does not provide functionality which POI is depending upon. There can be a number of different reasons for this:
Outdated xml-apis.jar, stax-apis.jar or xercesImpl.jar:
These libraries were required with Java 5 and lower, but are not actually required with spec-compliant Java 6 implementations, so try removing those libraries from your classpath. If this is not possible, try upgrading to a newer version of those jar files.
Running IBM Java 6 (potentially as part of WebSphere Application Server):
IBM Java 6 does not provide all the interfaces required by the XML standards, only IBM Java 7 seems to provide the correct interfaces, so try upgrading your JDK.