Sonata Seo Bundle in Symfony 4 - sonata

I've installed Sonata Seo Bundle in a Symfony 4 project and I have followed the steps from https://sonata-project.org/bundles/seo/2-x/doc/reference/usage.html. But when I launch the application I take this fatal error:
The "sonata.seo.page" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

I found just now a solution that work fine the Seo Bundle.
Just, in config/service.yaml file I add:
sonata.seo.page:
class: Sonata\SeoBundle\Seo\SeoPage
Previously I have this in the same file:
services:
_defaults:
autowire: true
autoconfigure: true
public: true

Related

AEM Package of type 'MIXED' is legacy

I work in a project (Upgrade from AdobeExperienceManager 6.1 to 6.3 to 6.5) where after the Jackrabbit filevault-package-maven-plugin upgrade to version 1.3.2 the following error occurs:
Package of type 'MIXED' is legacy. Use one of the other types instead! # META-INF/vault/properties.xml, validator: jackrabbit-packagetype
I searched the code, there is no single occurrence of the word "MIXED". The field properties.xml exists but does not contain any of the information mentioned in the error.
My search is stuck on this properties.xml. The information that it is legacy didn't help much since there is no documented migration path I could find on experienceleague or adobe help.
Any suggestions what to change or what exactly does this error means?
As of the [jackrabbit.apache.org][1] -documentation the error refers to the package type.
Mixed packages are a model of the past (AEM 6.3).
Means to fix it we have to separate Application /apps /libs means all the OSGi stuff and all the rest as Content.
project
- app
- src/main/content/jcr_root
- apps
- content
- etc
- libs
- META-INF
has to be split in Application-(code) my-project-package-bundle:
project
- app
- src/main/**java/com/project**/packageName
- src/main/**test/com/project**/packageName
and Content (config, templating, other data that is no java/kotlin) my-project-package-content:
project
- app
- src/main/**resources**/jcr_root
- content
- component-dialogs
- pages-config
- etc
- META-INF

AppBundle symfony 4

I have a problem with Symfony 4, I want generate entities from an existing database with the command :
php bin/console doctrine:mapping:import --force AppBundle xml
But an error appears :
Bundle "AppBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your App\Kernel.php file?
I try to import in the file kernel.php in registerBundles() :
new AppBundle/AppBundle();
but undefined class and when I create it in src/AppBundle/AppBundle.php :
<?php
namespace AppBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
}
nothing change and when I retry the command :
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "AppBundle" from namespace "App".
Did you forget a "use" statement for another namespace? in /var/www/html/symfony/Mission3/src/Kernel.php:30
I would like to know if it's possible to create a bundle like that or if it exists an other command to generate entities from an existing database.
in SF4, The main application component is named 'App' by default and is not a bundle.
You have to manually create a dummy bundle under src\ directory in order to use old doctrine:command related to bundle.
see how to manually create a bundle here
After that, you can import/generate mappings/entities using doctrine:commands and use them in the App main module space, or in those bundles.
The SF4 maker tool don't provide bundle creation yet ... But I suppose the SF4 developers consider it's not an urge must have requirement, because they want us to focus on putting most code in the bundle less App main module.
In symfony 4 'AppBundle' is doesn't exist anymore. Try use 'App' instead 'AppBundle'

InSpec: "Cannot load <profile> since it is not listed as a dependency" when dependency is defined

In InSpec 1.9.0 I defined the following profile with dependency, including all controls from the dependent profile.
However, when executing I get the error indicating the profile "is not listed as dependency"
What am I missing?
inspec.yml:
name: my-profile
version: 0.0.1
supports:
- os-family: unix
depends:
- name: ssh-baseline
url: https://github.com/dev-sec/ssh-baseline/archive/master.zip
controls/include_ssh_baseline.rb:
include_controls 'ssh-baseline'
Command:
inspec exec my-profile -t ssh://user#host.domain
The result of executing the profile:
Cannot load ssh-baseline since it is not listed as a dependency
of my-profile.
Dependencies available from this context are:
(two empty lines)
I don't see a syntax error. It's almost copy-paste example from InSpec Profiles page.
The following dependency definition (git instead of url) also caused the same error message as above:
depends:
- name: ssh-baseline
git: https://github.com/dev-sec/ssh-baseline.git
inspec.lock file is created on the first profile execution and contains a reference to the dependencies. If you build your profile incrementally you might end up with an inspec.yml file containing no dependencies (from the first run):
---
lockfile_version: 1
depends: []
You need to delete the file if you want changes to the inspec.yml to be reflected or run the following inside the profile directory:
inspec vendor --overwrite
See Vendoring dependencies (it doesn't mention --overwrite, but it immediately throws an error if it's not present):
When you execute a local profile, the inspec.yml file will be read in order to source any profile dependencies. It will then cache the dependencies locally and generate an inspec.lock file. If you add or update dependencies in inspec.yml, please refresh the lock file by either:
running inspec vendor inside the profile directory; or
deleting inspec.lock before running inspec exec
I just created it a profile based on your post and it works without any issues. I used inspec 1.9.0. Just to be sure, can you try inspec exec ./my-profile -t ssh://user#host.domain?

How to include predefined set of netbeans platform modules in maven project?

I am working on maven netbeans platform project consisting of several modules. I need to depend on some modules (say java.source module), but when I try to run the application, it reports, that required modules are not installed. And event despite I have dependency on java.source declared in my pom.xml
I think, that I have to tell maven somehow, to install (and turn on) these modules in the final assembled application before my module is loaded.
How could I do something like this?
UPDATE:
When I try to create complete netbeans application project from maven artifact and add Java Source API as a dependency into pom.xml... when I run the application, window with following message appears:
Warning - could not install some modules: Editor Library 2 - None of the modules providing the capability org.netbeans.modules.editor.actions could be installed. Editor Indentation for Projects - The module named org.netbeans.modules.editor.settings.storage/1 was needed and not found. Editor Indentation for Projects - The module named org.netbeans.modules.options.editor/1 was needed and not found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ActionsFactory could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.OpenProjectsTrampoline could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ProjectChooserFactory could be found. Editor Error Stripe Impl - The module named org.netbeans.modules.editor.errorstripe.api/1 was needed and not found. Java Source - The module named org.netbeans.libs.javacimpl/1 was needed and not found. Java Source - The module named org.netbeans.modules.editor.indent.project/0-1 was needed and not found. Java Source - The module named org.netbeans.modules.java.preprocessorbridge was needed and not found. Java Source - The module named org.netbeans.modules.options.editor/1 was needed and not found. Java Source - The module named org.netbeans.modules.parsing.api/1 was needed and not found. Editor Settings - No module providing the capability org.netbeans.api.editor.settings.implementation could be found. Diff - The module named org.netbeans.modules.options.editor/1 was needed and not found. 11 further modules could not be installed due to the above problems.
The error-message "Module dependency has friend dependency [...] but is not listed as friend" means that you need to specify an implementation version of org.netbeans.modules.options.editor.
You can achieve this by editing src/main/nbm/module.xml to contain the following entry (I didn't use the actually needed values here. Make sure to find out which values to enter for id and explicitValue to satisfy the dependencies (You can find explanations / instructions in the article linked below):
<dependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-modules-editor</id>
<type>impl</type>
<explicitValue>org.netbeans.modules.editor/1 = 201107282000</explicitValue>
</dependency>
</dependencies>
I'm pretty sure that the following article will explain some issues and help you find out the needed values for id and explicitValue (language is english, author is me):
http://blog.macrominds.de/2011/08/open-favorites-per-default-in-netbeans-rich-client-platform-maven-standalone-application/
I'm currently having related problems with my application, so I might come back with a more concrete solution in a while.
the easiest way is to grab a class that its complaining about, say "org.netbeans.modules.editor.actions" and go to the Add Dependencies and plug it into the Query field.
From there you should be able to tell which module you will need to include

ATG taglibs on OSGI problems

We're currently creating an app that needs ATG taglibs on SLING/OSGI, we have created a bundle with these taglibs and uploaded it, of course these taglibs call ATG classes, so we are including them in the bootdelegation, using sling.properties file.
sling.bootdelegation.simple=atg.nucleus
sling.bootdelegation.class.atg.nucleus.Nucleus=atg.appassembly, \
atg.appassembly.ant, \
atg.appassembly.progress, \
atg.appassembly.util, \
...ETC...
First we got this error:
org.apache.sling.api.scripting.ScriptEvaluationException: atg/taglib/dspjsp/ImportBeanTag
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:163)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:107)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:226)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:465)
....
....
Caused by: java.lang.NoClassDefFoundError: atg/taglib/dspjsp/ImportBeanTag
at org.apache.jsp.apps.mygeometrixx.components.contenpage.center_jsp._jspx_meth_dsp_005fimportbean_005f0(center_jsp.java:177)
at org.apache.jsp.apps.mygeometrixx.components.contenpage.center_jsp._jspService(center_jsp.java:154)
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
So we added atg.taglib.dspjsp to the packages to be added in bootdelegation sling.properties file.
Then we got this error:
org.apache.sling.api.scripting.ScriptEvaluationException: atg.taglib.dspjsp.ImportBeanTag
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:163)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:107)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:226)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:465)
...
Caused by: java.lang.ClassCastException: atg.taglib.dspjsp.ImportBeanTag
at org.apache.sling.scripting.jsp.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:125)
at org.apache.jsp.apps.mygeometrixx.components.contenpage.center_jsp._jspx_meth_dsp_005fimportbean_005f0(center_jsp.java:177)
at org.apache.jsp.apps.mygeometrixx.components.contenpage.center_jsp._jspService(center_jsp.java:154)
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
All this is running on JBOSS.
Is there a way to avoid this class conflict that is causing the cast exception?
The class cast exception is usually a sign that that class is being made available in two different places (in your case probably via bootdelegation and maybe via a bundle that exports this class). That's what I would investigate first.
Also, to make things more explicit, I would in general advise you to not use boot delegation but instead export these packages explicitly through the system bundle. That way at least you can better debug where classes come from and how things are "wired" by the OSGi resolver.
When loading the ATG tag libraries from outside of the OSGi framework you also have to make sure to provide the JSP API from outside of the framework. By default Sling embeds the JSP API (in the JSP Scripting Bundle).
There are various ways to expose the JSP API into the framework. One is to add them to the system packages in the sling.properties file:
sling.system.packages.atg_jsp = javax.servlet.jsp;javax.servlet.jsp.el; \
javax.servlet.jsp.resources;javax.servlet.jsp.tagext;version=2.1.0