why composer fail during running the server? - symfony

The autoloader expected class "AppBundle\Resources\config\routing" to be de
fined in file "C:\xampp\htdocs\fp\vendor\composer/../../src/AppBundle\Resou
rces\config\routing.php". The file was found but the class was not in it, t
he class name or namespace probably has a typo in C:\xampp\htdocs\fp\app/co
nfig\services.yml (which is being imported from "C:\xampp\htdocs\fp\app/con
fig\config.yml").

Related

Wrap resources inside custom class and invoke class?

I am using Puppet 3.0. I tried to use the existing NGINX module but encountered one issue which no answer seems to exist. I have moved to implementing NGINX module myself which handles my exact requirements.
Each package/service/file resource works as expected and now I am moving the code out of init.pp into a /manifest/nginx.pp fileas a class:
class company_nginx {
... Various resources
}
Now I am trying to include this class inside the init.pp
include company_nginx
An it returns an error:
Error: Could not find class nginx for localhost on node localhost
What step or concept am I missing? How do I invoke this "class" in the init.pp file to get the resources invoked and configuring a system???
Manifest file names and the classes defined within them must exactly match. If you want to have a class names company_nginx then it must be in a file names company_nginx.pp.
This required comes from the puppet autoloader.
Your class names must be qualified for Puppet to be able to pick them up.
class nginx::company_nginx { ... }
This class will be loaded from module nginx file manifests/company_nginx.pp.
Doing include company_nginx will make Puppet assume that there is an actual module names company_nginx with the class defined in init.pp.

`FeatureContext` context class not found and can not be used.

I'm new with symfony2 and i wnat to test my app using behat but when I followed the official install in this link http://docs.behat.org/en/latest/cookbooks/1.symfony2_integration.html#installing-and-enabling-symfony2-extension
i got this error :
[Behat\Behat\Context\Exception\ContextNotFoundException]
FeatureContext context class not found and can not be used.
it was just after the first line and when i ran the bin/behat command.
When using the Symfony2Extension, you are responsible for handling the autoloading. Make sure the FeatureContext class can be autoloaded by changing your composer.json autoload configuration and running composer dump-autoload.

Phpunit tests caching

I am writing phpunit test in phpstorm, symfony2.
When the name of the test file is HomeSliderTest.php I am getting following error:
Fatal error: Class 'Acme\HardcoreBundle\Test\AcmeWebTestCase' not found in Acme/HardcoreBundle/Tests/Functional/HomeSliderTest.php on line 13
But when I change the name of the file in something else than everything is working correctly.
Does anyone have an idea what can be a problem?
namespace Acme\HardcoreBundle\Tests\Functional;
use Acme\HardcoreBundle\Test\AcmeWebTestCase;
class HomeSliderTest extends AcmeWebTestCase {...
I don't think that the problem is with code, because it is working when the name of the file is different, also the test is working on other machines.

executing jar file

I'm trying to get my class "lzw.java" deployed as a jar file ,
I made a manifest.txt , compiled and got all .class files ,put the manifest file along with the created .class files , and entered the command
jar -cvmf manifest.txt lzw.jar *.class
a .jar was created , when I double click it , it gives me "Java Exception error has occured",
having tried to execute it through cmd it gave me " java.lang.NoClassDefFoundError
note : the manifest file contains just a "Main-Class: LZW" followed by new line character
Since you use lzw.java, class and LZW interchanging, I suspect it might be a spelling problem.
lzw.java is the source file, not a class. The class should have the name lzw in this case.
The class file should be lzw.class - if it is not, the name of your class will be like the file-name without dot-class. Of course you choose the right class name in the manifest file.
Post the whole errormessage, not just parts, if this isn't the source of your problem.
Btw.: I suspect you didn't use a package name for your class? And do you know the convention, to user Uperrcase for class names, which would be Lzw in your case - maybe LZW if it is a well established acronym.
This exception means that the JRE is unable to locate the main Java class you are trying to reach. Make sure you are providing the correct class path when running the command.

NoClassDefFoundError: org/jbox2d/collision/shapes/Shape in netbeans

I am trying to add jbox2d as a dependency to my project in netbeans (playn-jbox2d-1.1-SNAPSHOT.jar), but at run time, I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jbox2d/collision/shapes/Shape
All other classes can be accessed fine, just not Shape.
I simply right clicked dependencies in my core directory and did add dependency and searched for jbox2d.
Anyone know what could be wrong?
What version of jbox2d do you have, as a dependency? You can crosscheck in the dependency jar file, if that class (Shape.class) exists or not?
EDIT: Most of the times, 'NoClassDefFoundError' happens due to incorrect classpath settings or when there's more than one class (or jar file) in the classpath, with the same namespace.

Resources