Not updated module version in Magnolia - magnolia

What could be a reason for not updated module version in Magnolia 5.7
In Magnolia java project I have submodule with XML descriptor in META-INF/magnolia/mymodule.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "module.dtd" >
<module>
<name>mymodule</name>
<displayName>mymodule</displayName>
<description>my module</description>
<version>${project.version}</version>
<!-- <version>1.3</version> -->
<dependencies>
<dependency>
<name>core</name>
<version>5.7.4/*</version>
</dependency>
</dependencies>
</module>
When I rebuild the whole project with version changed in project maven pom.xml and deploy on a server I don't see an updated version in Magnolia's Author configuration console. I have to manually remove the old version node in the configuration console (remove JCR node) and then restart the server. After these steps, I can confirm the new version in the configuration console. Which is a pain if you have to deploy to several dev/stage/prod environments needless to say that I have no access to a public instance in a production environment.
The problem with not updated version sounds like not important, but I'm also not seeing new or renamed pages associated with this module. They appear only if I force to reload module by removing version.
One additional detail which may help identify the problem: I can delete version node in JCR, but can NOT delete the whole module node. I receive an error message "Level 1 and 2 nodes in config workspace cannot be unpublished".

What version do you see in the config:/modules/your_module/version before you delete it? Is it lower than version number of version you are trying to install? I would suspect that it's same or higher. Ie you are trying to reinstall same version or downgrade the version. Neither of those is supported hence it doesn't trigger the installation process. Or perhaps you are trying to move up from SNAPSHOT to full version for which there's no install delta either.
As for the warning you get when trying to delete those nodes, it is on purpose. You are not supposed to be deleting those nodes as a normal user since you could cause breakage of dependent (public) instances. Only as admin (via JCR Browser) you are allowed to delete, assuming you know what and why you are doing.

Related

Reset profile version on uninstall add-on

I have a default profile containing some upgrade steps (1.0.0 -> 1.0.3).
This is its metadata.xml:
<?xml version="1.0"?>
<metadata>
<version>1.0.3</version>
<dependencies>
<dependency>profile-plone.app.dexterity:default</dependency>
</dependencies>
</metadata>
I added an uninstall profile that removes the custom catalog added by default profile and so on.
So, I can Deactivate my add-on, Activate it and run again the Upgrades and all the configuration is fresh again.
How can I on uninstall to unset the profile version to something like 0.0.1 in order to get rid of manually running the upgrade steps again on reactivating the add-on? What I need is: with Deactivate + Activate the add-on to have all the configuration done, without going to portal_setup Upgrades, show old rerun...
Solved adding post_handler on register profile (also simplified the upgrades steps - all in on now, metadata version: 1.1):
<genericsetup:registerProfile
name="default"
title="my.addon"
directory="profiles/default"
description="Installs the package."
provides="Products.GenericSetup.interfaces.EXTENSION"
post_handler=".upgrades.evolve11.run"
/>
In upgrades.evolve11.run I have the code for configuring the catalog. So, reinstalling the add-on all needed operations are done.

Tomcat 8 is not scanning apache tiles TLD file inside the jar

I'm setting up the spring webmvc project using spring boot 2.0.0 version. If i run the application inside the embedded tomcat, it runs fine. I tried deploying it in external standalone tomcat-8 server, it is working fine over there too. But i if package the war and deploy it in the tomcat-8 server configured within eclipse, then it throws below exception.
The absolute uri: http://tiles.apache.org/tags-tiles cannot be
resolved in either web.xml
I included the dependency in the pom file as below.
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>3.0.4</version>
</dependency>
I ensured that the tiles-jsp jar is present inside the WEB-INF/lib folder. But still its failing as it is not able to scan the jar for TLD. I tried changing the catalina.properties to include tiles-jsp*.jar. But it is still failing.
Please help me to fix this error.
Does your IDE automatically import dependencies?
Try cleaning your maven dependencies.
Maven clean.
Or try the more brutal command dependency:purge-local-repository.
By the way notice that there's a newer version of your dependency 3.0.8 of 2017. The one that you are trying to use, the 3.0.4, is of 2014.
For me, war file when deployed works perfect. Had an issue where, when I run it under tomcat from inside IDE(Eclipse/STS), it threw error. Maven clean really helped, no other change needed. MAven clean-->build--> restart eclipse/sts tomcat. it works like a charm. Answer by desoss prompted me to perform maven clean. Thanks #desoss.

Updating VS Extension from 2015 to 2017 (VSIX v3) makes the package invalid

I have an older extension that i would like to get to work in VS 2017. To be able to do this i understand that i will have to use the new VSIX Manifest v3. The extension works fine in 2015 Update 3. To update it I've done the following:
Open the extension source in VS2017. I'm prompted to do a one-time upgrade, which is completed successfully
Use NuGet to update the Microsot VSSDK BuildTools from 14.x to 15.x
Add the Prerequisite block to the source.extension.vsixmanifest file containing Microsoft.VisualStudio.Component.CoreEditor
Update the Installation target to also support the new Visual studio like so
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
Builds successfully, but once i open the vsix file in my debug folder, get a message telling me
The file is not a valid VSIX package
If i open up the file using WinRAR i can see that the two mandatory files catalog.json and manifest.json is not in there as they are supposed to in the new v3 format.
What am i missing here ?
It turned out that my problem was, that inside the vbproj file (or csproj for most others) there was an import at the top like so:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" />
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props')" />
....
As you can see this project file has imports for both the new version and the old one of the BuildTools. I'm not sure why this happens, as all i did was update the VSSDK BuildTools via NuGet. I also tried to completely uninstall the BuildTools ticking Force uninstall but it seems to have remained through everything I tried.
So if you experience similar problems, look at your vbproj/csproj file if it has imports for older versions of the Microsoft.VSSDK.BuildTools
You must also upgrade the BuildTools package, the error you get indicate that this did not happen: https://learn.microsoft.com/en-us/visualstudio/extensibility/how-to-migrate-extensibility-projects-to-visual-studio-2017

Eclipse Luna maven-jar-plugin execution not covered by lifecycle

I have a maven java project (deploying to jboss, if that matters) that uses the maven-jar-plugin. This works fine using Eclipse Kepler. I'm now trying Luna (EE edition), and I'm now getting this error
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-jar-plugin:2.5:jar (execution: make-a-jar, phase: compile)
in all my child .pom files (the maven-jar-plugin is specified in the parent .pom file, but the error points to the block in the child .poms).
In the .pom viewer, if I click on the error message in the Overview tab, it gives me the option to "Discover new m2e connectors". Clicking on this brings up the "m2e Marketplace" dialog and appears to do a bunch of work, but then just shows me an empty list. If I click "Finish", it tries to calculate dependencies, and then gives me this error:
Operation details
Cannot complete the request. See the error log for details.
"m2e connector for mavenarchiver pom properties" will be ignored because a newer version is already installed.
So it appears to be that maybe the maven-jar-plugin depends on a particular version of mavenarchiver, but Eclipse Luna EE comes with a newer version. Is there a way to fix this problem, or do I just have to wait for a newer version of maven-jar-plugin to be released? (I'm currently using version 2.5 of maven-jar-plugin, which is the latest that I'm aware of.)
I had a similar problem when trying to import Hadoop project in Eclipse. The solution above works... but I got "tired" of changing some of the pom files, and thought that the change would bite me later. So, another solution is:
To avoid the messages in Eclipse regarding execution not covered by lifecycle, go to Windows -> Preferences -> Maven -> Errors/Warning and select Ignore for "Plugin execution not covered for Lifecycle.."
You can solve the problem when you change the phase of execution from compile to package (which is default lifecycle phase for jar goal).
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin}</version>
<executions>
<execution>
<phase>package</phase> <!-- changed from compile to package -->
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

What Drools JARS are needed in a servet's WEB-INF\lib for jBPM?

I have ported a Tomcat servlet to run with JBoss 7.1 and am now trying to add jBPM support to it. I have run the jbpm-5.4.0.Final-installer-full.zip to get JBoss/jBPM installed with Kepler (I had to patch the installer to install Kepler). I then copied a line of code from the installer's "evaluation" sample and placed it in my servlet. That line of code is:
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
After adding the necessary imports I got a clean build. I thought that I could then take the Drools run time files I found in the installer's .\runtime\lib and place them in my servlet's .\WEB-INF\lib. However, doing this caused me to get a "Class not found" exception when I tried to execute the KnowledgeBuilder line of code. It turns out that if I replace the JARs from the installer's .\runtime\lib with the JARS in drools-distribution-5.5.0.Final.zip (from http://www.jboss.org/drools/downloads) in my .\WEB-INF\lib I am able to execute KnowledgeBuilder line of code.
My questions are:
1) Why don't the JARs from the installer's .\runtime\lib work in the above?
2) Where can I find documentation on what all of these Drools JARs do and which ones are needed?
Thank you.
Al
If I were to list specific Jars here, the answer would only apply to a specific version of Drools. The best way to get the correct JARs is to use Maven to build your project. That will automatically import all of the JARs that are needed.
You will usually need dependencies for drools-core and drools-compiler. Those have their own transitive dependencies.
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${drools.version}</version>
</dependency>
If you use Eclipse, then you can just create a pom.xml with those dependencies in it. Open it in the Maven pom editor and the "Effective POM" tab will show you all of the required dependencies.

Resources