Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

MagentoSessionStorage not found... #2

Closed
KristianHildebrandt opened this Issue September 23, 2011 · 19 comments

4 participants

KristianHildebrandt Fabian Vogler Lukas Kahwe Smith Sébastien Orban
KristianHildebrandt

Well, this is my first (small) Symfony2 app I am working on, so I am not quire sure, wether this is related to your extension or not:

Fatal error: Class 'Liip\MagentoBundle\SessionStorage\MagentoSessionStorage' not found in /.../app/cache/dev/appDevDebugProjectContainer.php on line 1471

I kept the configuration exactly as in your README, so I have no idea whats going wrong here..

Any help would be greatly appreciated :)

Lukas Kahwe Smith
Owner

did you add Liip to your autoloader?

KristianHildebrandt

Yes, as specified in your README...

Sébastien Orban

Try to clear the cache : php app/console cache:clear --env=prod --no-debug in your root symfony project

Lukas Kahwe Smith
Owner

@KristianHildebrandt there must be some issue with file loading as the class name itself is correct. appDevDebugProjectContainer.php is a generated file, but all it does in the end is trigger an autoload. Can you try to trace yourself what is going wrong there? But I am pretty sure that this is all working well.

One more thing: are you on Linux? We all work on OSX so there is the possibility that there could be a case sensitivity issue that we didn't realize.

Sébastien Orban

@lsmith77 : our test server is on a CentOS 5.6 and no problem like that with the deployment, if it helps.

KristianHildebrandt

Yes, I am on linux, Centos, to be exact. Maybe there is a problem related to fcgi?

I just installed a new Symfony app and added the MagentoBundle, but the same problem still persists.

Here is some of my Code:

app/config/config.yml


imports:
    - { resource: parameters.ini }
    - { resource: security.yml }

framework:
    #esi:             ~
    #translator:      { fallback: %locale% }
    secret:          %secret%
    charset:         UTF-8
    router:          { resource: "%kernel.root_dir%/config/routing.yml" }
    form:            true
    csrf_protection: true
    validation:      { enable_annotations: true }
    templating:      { engines: ['twig'] } #assets_version: SomeVersionScheme
    session:
        default_locale: %locale%
        auto_start:     true
        # use the Magento session handler
        storage_id: liip_magento.session.storage

# Twig Configuration
twig:
    debug:            %kernel.debug%
    strict_variables: %kernel.debug%

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        # closure:
        #     jar: %kernel.root_dir%/java/compiler.jar
        # yui_css:
        #     jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar

# Doctrine Configuration
doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8

    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
    transport: %mailer_transport%
    host:      %mailer_host%
    username:  %mailer_user%
    password:  %mailer_password%

jms_security_extra:
    secure_controllers:  true
    secure_all_services: false

liip_magento:
    # path to the Mage.php file
    mage_file:  %kernel.root_dir%/../../dev/app/Mage.php
    # not for all store resolvers, mapping to store code
    store_mappings:
        de: de

app/config/security.yml


security:
    factories:
        - "%kernel.root_dir%/../vendor/bundles/Liip/MagentoBundle/Resources/config/security_factories.xml"
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        in_memory:
            users:
                user:  { password: userpass, roles: [ 'ROLE_USER' ] }
                admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
        magento: ~
    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false

        login:
            pattern:  ^/demo/secured/login$
            security: false

        secured_area:
            pattern:    ^/secured/login_check
            magento:
                provider:   magento
                check_path: /secured/login_check
                login_path: /secured/login
            logout:
                path:   /preisapp/logout
                target: /
            #anonymous: ~
            #http_basic:
            #    realm: "Secured Demo Area"

    access_control:
        #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
        #- { path: ^/_internal, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }

app/autoload.php


registerNamespaces(array(
    'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
    'Sensio'           => __DIR__.'/../vendor/bundles',
    'JMS'              => __DIR__.'/../vendor/bundles',
    'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
    'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
    'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',
    'Monolog'          => __DIR__.'/../vendor/monolog/src',
    'Assetic'          => __DIR__.'/../vendor/assetic/src',
    'Metadata'         => __DIR__.'/../vendor/metadata/src',
    'Liip' => __DIR__.'/../vendor/bundles',
));
$loader->registerPrefixes(array(
    'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
    'Twig_'            => __DIR__.'/../vendor/twig/lib',
));

// intl
if (!function_exists('intl_get_error_code')) {
    require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';

    $loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
}

$loader->registerNamespaceFallbacks(array(
    __DIR__.'/../src',
));
$loader->register();

AnnotationRegistry::registerLoader(function($class) use ($loader) {
    $loader->loadClass($class);
    return class_exists($class, false);
});
AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');

// Swiftmailer needs a special autoloader to allow
// the lazy loading of the init file (which is expensive)
require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');

app/AppKernel.php


 $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
            new Liip\MagentoBundle\LiipMagentoBundle(),
        );
Sébastien Orban

As I've already said, it work fine on a centos install. I can log in, and get some stuff from magento.

In your app/config.yml you seem to have missed this :

# app/config/config.yml
framework:
    session:
        # use the Magento session handler
        storage_id: liip_magento.session.storage

Maybe it's the problem ?

KristianHildebrandt

This part is actually there...

Sébastien Orban

Sorry !
In my config.yml both
default_locale: %locale%
auto_start: true
Are commented out with a #
Still since your problem seem to come from the cache, I would suggest erasing it.

KristianHildebrandt

I commented them out, cleared the cache, still the same error...

Lukas Kahwe Smith
Owner

@KristianHildebrandt: its really hard to figure out whats going on. So please could you try to debug this yourself? As a pointer the problem seems to be caused by your autoloader which by default resides in app/autoloader.php.

Lukas Kahwe Smith
Owner

btw .. if you can come to #symfony-dev on freenode IRC we might be able to fix the issue more interactively.

Lukas Kahwe Smith
Owner

@fabian: is there a specific Magento version we would recommend for this? this might explain the strange behavior ..

Fabian Vogler

I'm not aware of any recent changes in Magento that could explain this behaviour.

Fabian Vogler

I installed it again with Magento CE 1.6.1.0 and discovered a error in the README (see 947eed3).

@KristianHildebrandt can you make sure the Magento Autoloader really gets patched with the magento-autoloader.patch? Which version of Symfony and Magento are you using?

Lukas Kahwe Smith
Owner

ping

KristianHildebrandt

I tried it with Magento CE 1.4.1.1. I did make sure that the autoloader got patched, but I was never able to get to work.

Deleted user
ghost commented March 22, 2012

The content you are editing has changed. Reload the page and try again.

I am new to symfony 2 and trying to install admin bundle in my project I had the usual error ""Bundle\Admin\Post Admin' not found in app\cache\dev\appDevDebugProjectContainer.php"" checking and rechecking this was due to a misinterpretation of my words PostAdmin.php file was written "PostAdimin.php" I hope this can help and sorry for the My English

Sending Request…

Attach images by dragging & dropping or selecting them. Octocat-spinner-32 Uploading your images… Unfortunately, we don't support that file type. Try again with a PNG, GIF, or JPG. Yowza, that's a big file. Try again with an image file smaller than 10MB. This browser doesn't support image attachments. We recommend updating to the latest Internet Explorer, Google Chrome, or Firefox. Something went really wrong, and we can't process that image. Try again.

Fabian Vogler
fabian commented June 13, 2012

We recommend at least Magento CE 1.6.

Fabian Vogler fabian closed this June 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.