This repository has been archived by the owner. It is now read-only.

MagentoSessionStorage not found... #2

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

Comments

Projects
None yet
4 participants
@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 :)

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Sep 23, 2011

Member

did you add Liip to your autoloader?

Member

lsmith77 commented Sep 23, 2011

did you add Liip to your autoloader?

@KristianHildebrandt

This comment has been minimized.

Show comment
Hide comment
@KristianHildebrandt

KristianHildebrandt Sep 23, 2011

Yes, as specified in your README...

Yes, as specified in your README...

@Arcanum-XIII

This comment has been minimized.

Show comment
Hide comment
@Arcanum-XIII

Arcanum-XIII Sep 24, 2011

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

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

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Sep 24, 2011

Member

@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.

Member

lsmith77 commented Sep 24, 2011

@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.

@Arcanum-XIII

This comment has been minimized.

Show comment
Hide comment
@Arcanum-XIII

Arcanum-XIII Sep 24, 2011

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

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

@KristianHildebrandt

This comment has been minimized.

Show comment
Hide comment
@KristianHildebrandt

KristianHildebrandt Sep 24, 2011

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(),
        );

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(),
        );
@Arcanum-XIII

This comment has been minimized.

Show comment
Hide comment
@Arcanum-XIII

Arcanum-XIII Sep 24, 2011

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 ?

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 comment has been minimized.

Show comment
Hide comment
@KristianHildebrandt

KristianHildebrandt Sep 24, 2011

This part is actually there...

This part is actually there...

@Arcanum-XIII

This comment has been minimized.

Show comment
Hide comment
@Arcanum-XIII

Arcanum-XIII Sep 24, 2011

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.

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

This comment has been minimized.

Show comment
Hide comment
@KristianHildebrandt

KristianHildebrandt Sep 24, 2011

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

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

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Sep 24, 2011

Member

@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.

Member

lsmith77 commented Sep 24, 2011

@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.

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Sep 26, 2011

Member

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

Member

lsmith77 commented Sep 26, 2011

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

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Sep 26, 2011

Member

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

Member

lsmith77 commented Sep 26, 2011

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

@fabian

This comment has been minimized.

Show comment
Hide comment
@fabian

fabian Sep 26, 2011

Contributor

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

Contributor

fabian commented Sep 26, 2011

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

@fabian

This comment has been minimized.

Show comment
Hide comment
@fabian

fabian Oct 23, 2011

Contributor

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?

Contributor

fabian commented Oct 23, 2011

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?

@lsmith77

This comment has been minimized.

Show comment
Hide comment
@lsmith77

lsmith77 Jan 15, 2012

Member

ping

Member

lsmith77 commented Jan 15, 2012

ping

@KristianHildebrandt

This comment has been minimized.

Show comment
Hide comment
@KristianHildebrandt

KristianHildebrandt Mar 12, 2012

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.

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.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Mar 22, 2012

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

ghost commented Mar 22, 2012

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

@fabian

This comment has been minimized.

Show comment
Hide comment
@fabian

fabian Jun 13, 2012

Contributor

We recommend at least Magento CE 1.6.

Contributor

fabian commented Jun 13, 2012

We recommend at least Magento CE 1.6.

@fabian fabian closed this Jun 13, 2012

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.