How to move Symfony Admin Generator files to a plugin? - plugins

I try to move my module which generated by the Admin Genrator to a plugin.
Error:
Fatal error: Class 'BaseFooGeneratorConfiguration' not found in ...
The action.class.php includes to files:
fooGeneratorConfiguration.class.php
fooGeneratorHelper.class.php
Both classes extends of an base class (BaseFooGeneratorConfiguration,BaseFooGeneratorHelper).
The problem is that those classes only exist in the cache.
Do i need to copy the class from cache into my plugin ?!

Have you tried clearing your cache after moving the module to your plugin?
./symfony cc

Related

Keycloak Userstorage SPI: Provider not found?

What are the requirments to make the Keycloak 17.0.0 find the provider?
[error]: Build step org.keycloak.quarkus.deployment.KeycloakProcessor#configureProviders threw an exception: java.util.ServiceConfigurationError: org.keycloak.storage.UserStorageProviderFactory: Provider my.own.package.UserStorageProviderFactoryImpl not found
If I clone the project from baeldung and I start the keycloak, it works. It finds the provider. (https://www.baeldung.com/java-keycloak-custom-user-providers)
As I see the followings have to happen to make it work:
have a class that implements the UserStorageProviderFactory interface:
public class UserStorageProviderFactoryImpl implements UserStorageProviderFactory<MyImplementation> {}
create the META-INF and services folders and create the org.keycloak.storage.UserStorageProviderFactory file that contains the path to given factory:
mvn clean package --> copy jar to Keycloak/providers and should work
What do I miss? What is extra in the baeldung project that make it work while my project is not found when I start the keycloak?
https://www.keycloak.org/docs/latest/server_development/index.html#_user-storage-spi
Your class should be name SomethingUserStorageProviderFactory without the word 'impl'. Your provider class should have the same pattern name, for example, SomethingUserStorageProvider.
Official documentation gives more interesting information’s (https://www.keycloak.org/docs/latest/server_development/#_providers) and if you take a look at baeldung's code, he due the same pattern name.

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'

ProGuard - unexpectedly contains class

While I'm trying to obfuscate simple DataLoader.class file in ProGuard I get this error:
Reading program directory [C:\Users\uzytkownik\Documents\NetBeansProjects\ProTest\build\classes\Files\DataLoader.class]
Warning: class [DataLoader.class] unexpectedly contains class [Files.DataLoader]
Warning: there were 1 classes in incorrectly named files.
You should make sure all file names correspond to their class names.
The directory hierarchies must correspond to the package hierarchies.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass)
If you don't mind the mentioned classes not being written out,
you could try your luck using the '-ignorewarnings' option.
Please correct the above warnings first.
Here is the project:
http://www49.zippyshare.com/v/14668241/file.html
I will be grateful for your help.
Warning: class [META-INF/versions/9/module-info.class] unexpectedly contains class [module-info]
This is the issue I had and I tried few options mentioned below:
-keep class module-info
-keepattributes Module*
-dontwarn module-info
The option worked for me is 3.
Not sure why but it solves my problem and I am able to make the jar.
This issue comes when you upgrade something like I upgrade the spring-boot version and the project starts failing.
Please check the maven dependencies as well.
With the options -injars and -libraryjars, you should specify the proper base directory (or jar) of your classes, just like a classpath. In this case: classes, not classes\Files\DataLoader.class.
See the ProGuard manual > Troubleshooting > Warning: class file ... unexpectedly contains class ...

Trouble with Importing Java Libraries into a project with NetBeans

I am having some issues with importing library which is needed to complete an assignment that I have been set.
I'm not sure if I have added the library to the project, but the classes from the library appear to be in the libraries section of the project.
http://imgur.com/Co6IOzq,qCJaXHh,ZJVUnbZ
I added the libraries by right clicking on project1 and going to properties:
http://imgur.com/Co6IOzq,qCJaXHh,ZJVUnbZ#1
However whenever I have "package project1" at the top of Project1.java I receive a message that MaInput - which is one of the classes in this library - is not recognised:
cannot find symbol:
symbol: class MaInput
Whenever I take away "package project1" when trying to compile it reads:
Error: Could not find or load main class project1.Project1
Java Result: 1.
The problem is that you are trying to access a class from default package from a named package and this is not allowed by the Java Specification.
So, in this case, create your assignment in the default package as well.

FuelPHP Upload Class not found

I am trying to upload an image using FuelPHP framework Upload class and I am getting the following error:
Fatal error: Class 'FuelPHP\Upload\Upload' not found in
/projects/clients/client0/web61/web/fuel/fuel/core/classes/upload.php
on line 90
This is the code I am using after the form is submitted:
Upload::process($config);
if (Upload::is_valid()) {
Upload::save();
}
Thanks!
It's a bug in FuelPHP_1.6.1.zip file. Update Fuel to 1.6/master or
Edit composer.json with:
"fuelphp/upload": "2.0"
to
"fuelphp/upload": "1.*"
and then,
$ composer update
From the looks of it, you don't have the FuelPHP/Upload package installed. Have you ran:
composer install
on your root folder?
The current Upload class just translates the old class interface to the new one, as Harro describes here.