Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8834179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:57:18+00:00 2026-06-14T08:57:18+00:00

I am facing a weird error within my codebase currently. You can see the

  • 0

I am facing a weird error within my codebase currently. You can see the full ZF2s project code on my github right here. <- there’s a link

I’m having a Module set up with two Entities (X and Y). Entity_X contains a reference to Entity_Y via (targetEntity=”Entity_Y”). The Error persist with the FQCN or just the CN itself.

Entity_X:
  id int PK,
  id_Y int FK,
  text varchar

Entity_Y:
  id int PK,
  text varchar

When loading Entity_Y first and then Entity_X everything is working fine. This remains true for both StandardAutoloader and ClassMapAutoloader. However: when loading Entity_X first with ClassMapAutoloader present, i will be seeing the following error:

Fatal error: Cannot redeclare class Kennzahlen\Entity\Referenzwert (Entity_Y)
in \module\Kennzahlen\src\Kennzahlen\Entity\Referenzwert.php 
on line 13

Loading Entity_X first with StandardAutoloader works without any problems, too.

Update

The Problem appears to be within ZF2s ClassMapAutoloader (or Autoloading-Mechanism in General). My Module used the ClassMapAutoloader and using this i’ve gotten the above mentioned error. When removing the ClassMapAutoloader and simply using the StandardAutoloader, the error vanished into thin air. Thanks to @ocramius and all others i’ve botheres with this 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:57:19+00:00Added an answer on June 14, 2026 at 8:57 am

    i have no knowledge of doctrine, but i browsed through source and i think i found issue:
    https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/ClassLoader.php#L224
    here, this code expects that autoloader will return value evaluated to true, but that is not requirement of spl autoload mechanism, therefore autoloader can return NULL,

    To check if i am correct, in in your project in doctrine replace line 224 in Doctrine/Common/ClassLoader.php

    } else if ($loader[0]->{$loader[1]}($className)) {
    

    with

    } else if ($loader[0]->{$loader[1]}($className) && class_exists($className, false)) {
    

    Ans see if issue is fixed, if i am correct – then report bug to doctrine project

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing a weird error.I have set up my code in IntelliJ Idea.
I am facing a weird problem. While browsing the C code of a project,
I'm currently facing a weird problem while executing a command from my bash script.
In my 2nd ASP.NET MVC project I'm facing a very weird problem: when I
this time, I'm facing a really weird problem. I've the following code: $xml =
I am facing a weird problem right now with JodaTime DateTimes and a Spring
Within last few days I'm facing really weird problem, I did my best to
I am facing a weird problem. My web application throws error Value to add
I am facing this weird problem. The WebApp I'm debugging right now, is invoking
jquery datepicker is a great fun but I am facing a weird error. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.