Doctrine 2.9.x-dev - symfony

Did somebody tried Doctrine 2.9.x-dev? I am using with symfony 5.2.6. I know it is a dev version but when run any command I get an error for example:
[critical] Error thrown while running command "'doctrine:schema:create'". Message: "An option named "em" already exists."
and when I run only bin/console i get error
[critical] An error occurred while using the console. Message: "An option named "em" already exists."
An option named "em" already exists.
It is because this is dev version (2.8.4 is working) or am I missing something?

The error comes from doctrine/doctrine-bundle - it seems like it is not compatible with doctrine/orm 2.9.x-dev yet.
The problem is already being worked on, but the PR has not been merged yet, see: https://github.com/doctrine/DoctrineBundle/pull/1327
If you really need the dev version to work with Symfony right now, you will need to apply the changes manually, but I would recommend waiting for a stable release.

Related

Karaf: Missing Constraint in bundle

I am trying to wrap dnsjava as a bundle in Karaf. When I try to start the bundle I get a "Missing Constraint" error. I looked in the dnsjava code and found that the only place android is referenced is in a Class.forName. So I am wondering what causes this problem and how can I get around it. I am pretty certain that the class is not referenced in the code anywhere.
Here is the exception:
opendaylight-user#root>bundle:start 288
Error executing command: Error executing command on bundles:
Unable to execute command on bundle 288: The bundle "dnsjava_2.1.8 [288]" could not be resolved. Reason: Missing Constraint: Import-Package: android.os; version="0.0.0"
I believe I found the answer. There is an Import in the MANIFEST.MF that requires android.os.

Sylius - empty string insted of ShippingMethod in shipping action

In http://localhost:8000/checkout/shipping I got an error
CRITICAL - Uncaught PHP Exception
Symfony\Component\Form\Exception\UnexpectedTypeException: "Expected
argument of type "Sylius\Component\Core\Model\ShippingMethod",
"string" given" at
/home/krzysztof/Dokumenty/praca/smartbyte/sylius/src/Sylius/Bundle/ResourceBundle/Form/DataTransformer/ObjectToIdentifierTransformer.php
line 58
and the $value of transform method is an empty string.
It's strange because I got this error only on my project version, and on contribute version everything is ok, despite the version of sylius is in both the same (latest commit). Moreover I don't overwrite ShippingMethod so I don't now why this strange behaviour happens.
Today, I found the same error.
But just days ago everything worked. I often update the project from the git (master branch) and by composer. Therefore I started to look for errors in the last commit. After half a day with the debugger I found no critical changes in the last Sylius commits.
I drew attention to the version of Symfony. It's: 2.8.3. I rolled up to 2.8.0 and the problem has been resolved. I did not understand what was the cause of the error. But the fact remains - selection the delivery method form of Sylius with Symfony v2.8.3 is not working.
I hope this helps.

symfony 2.8 debug fatal error double message

Environment: Symfony 2.8.1 with XAMPP Version 5.5.24 on Windows 7.
If I trigger a fatal error in a controller, anything as simple as $array = ; in production environment, I'm getting a default php error:
Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\tgsupport-test\src\AppBundle\Controller\DefaultController.php on line 16
followed by symfony custom error page message. Obviously I'd want to avoid to show eorr info in production.
Moreover in prod.log I see a double critical error: under php.CRITICAL and request.CRITICAL. Is really useful to show the same error twice?
I'm using default configuration, indeed I just installed default framework without any custom setting and I triggered my error in AppBundle/DefaultController, so I was wondering if I'm missing anything.
I missed a php.ini configuration to avoid to display error messages in page.

Symfony project Installation

I am trying to install Symfony inside my project folder by using this command: composer create-project symfony/framework-standard-edition path/ "2.5.*".
During the set up I get prompted with a question if I want to install Aceme demo bundle which I reply to with yes, the installation continues but I get prompted again with these questions "look at the image":
As you can see I filled in all the details but this throws set of errors:
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: date_default_timezone_get(): It is not safe to rely on the system's
timezone settings. You are *required* to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those methods
and you are still getting this warning, you most likely misspelled the timezone
identifier. We selected the timezone 'UTC' for now, but please set date.timezone
to select your timezone. in
/Applications/MAMP/htdocs/Symfony/Project1/vendor/monolog/monolog/src/Monolog/Logger.php line 233
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command. `
What am I doing wrong here?
Perhaps a downside of using composer to create the project, you don't have a chance to go through the "Checking your System Configuration" section of the installation and fix errors before proceeding.
https://github.com/symfony/symfony-standard/tree/2.5#2-checking-your-system-configuration
If you run php app/check.php you'll see that you haven't met one of the mandatory requirements, which is to explicitly setting the date.timezone value in your system's php.ini
I found the problem why the error was thrown xD
It was due to my php version I had installed on my mac (5.3)
Symfony requiers 5.5
Since I updated my version I dont see this error any more.
Thanks for yours help guys :)

Apache Karaf 2.2.3, featuresBoot issue

Karaf 2.2.3 recently released and finally has a pre-bundled spring-jms feature. In order to make life easy I added it to the featuresBoot config property with the other defaults:
featuresBoot=config,ssh,management,spring-jms
However, when I start Karaf it behaves uncontrollably. Sometimes it will install on boot and other times it doesn't. When it doesn't auto-install I attempt to add it via the command line:
features:install spring-jms
And even that behaves wildly. See below:
karaf#root> features:install spring-jms
Error executing command: java.lang.IllegalArgumentException
karaf#root> features:install spring-jms
Error executing command: invalid entry size (expected 3293 but got 16823 bytes)
karaf#root> features:install spring-jms
Error executing command: Manifest not present in the first entry of the zip mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aopalliance/1.0_5
karaf#root> features:install spring-jms
Refreshing bundles org.springframework.context.support (50)
Error executing command: Could not start bundle mvn:org.eclipse.jetty/jetty-client/7.4.5.v20110725 in feature(s) jetty-7.4.5.v20110725: Unresolved constraint in bundle org.eclipse.jetty.client [83]: Unable to resolve 83.0: missing requirement [83.0] package; (&(package=org.eclipse.jetty.http)(version>=7.4.0)(!(version>=8.0.0)))
karaf#root> features:install spring-jms
Refreshing bundles org.springframework.context.support (50)
Those are back-to-back executions of the install command. The last execution works.
Anyone else see this behavior? Or know how to correct it?
Tony,
First, make sure that you are using the correct version Java, I use jdk 1.6_24. When using this, with no other bundles installed (a fresh installation), it installs properly. If I were you I would:
1) try installing a fresh instance of Karaf,
2) copy your maven repository to a new location, and
3) run Karaf in a fresh installation,
4) install spring-jms again.
If that doesn't work, reply to this and let me know your environment, along with all of the exceptions generated in your karaf log file.
By any chance are you using a customized org.ops4j.pax.url.mvn.cfg? I am, and it has caused a huge boot-time race condition problem that led to features sporadically failing to load.
Take a look at https://issues.apache.org/jira/browse/KARAF-910 "Race between FeatureService and ConfigAdmin for resolving mvn: URLs?"

Resources