sveneisenschmidt / opentrans

Allows to read, create and write OpenTRANS compatible documents from PHP
MIT License
15 stars 11 forks source link

Semantical Error #4

Open MaykilKucin opened 5 years ago

MaykilKucin commented 5 years ago

Hello Sven,

today i use your opentrans lib.... All things are working well, but when i want to serialize like in your example i get the following error:

Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@JMS\Serializer\Annotation\Expose" in property SE\Component\OpenTrans\Node\AbstractNode::$customEntries does not exist, or could not be auto-loaded. in C:\nginx-1.15.8\html\bmecat\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationException.php:54 Stack trace: #0 C:\nginx-1.15.8\html\bmecat\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\DocParser.php(734): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...') #1 C:\nginx-1.15.8\html\bmecat\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\DocParser.php(663): Doctrine\Common\Annotations\DocParser->Annotation() #2 C:\nginx-1.15.8\html\bmecat\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\DocParser.php(354): Doctrine\Common\Annotations\DocParser->Annotations() #3 C:\nginx-1.15.8\html\bmecat\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationReader.php(254): Doctrine in C:\nginx-1.15.8\html\bmecat\vendor\doctrine\annotations\lib\Doctrine\Common\Annotations\AnnotationException.php on line 54

Here is the code i use:

`<?php

use \SE\Component\OpenTrans;

//$serializer = \JMS\Serializer\SerializerBuilder::create()->build();

// Pick a factory to create your document (i.e. an Order)
$loader = new OpenTrans\NodeLoader();

$factory = new OpenTrans\DocumentFactory\OrderFactory($loader); $builder = new OpenTrans\DocumentBuilder($factory); $builder->build(); // bootstraps the default document structure

$document = $builder->getDocument(); // ... build your document

$document->getHeader()->getOrderInfo()->setOrderId('00000000001');

$orderLine1 = new OpenTrans\Node\Order\ItemNode(); $orderLine1->setLineId('P00000001');

$document->addItem($orderLine1); //var_dump($document);

$xml = $builder->serialize(); //-> here i get the error!!!! `

Thank you in advance for your support.

Yours sincereley

Mika

jkahnt commented 5 years ago

Hallo Mika,

which Composer Version do you use?

MaykilKucin commented 5 years ago

Hello jkahnt,

i use the Composer version 1.6.5 2018-05-04 11:44:59

Thank you!

Yours Sincerely Mika

Von: jkahnt notifications@github.com Gesendet: Donnerstag, 21. Februar 2019 06:19 An: sveneisenschmidt/opentrans opentrans@noreply.github.com Cc: Maykil Kucin | EDV-Service Schmidt GmbH Maykil.Kucin@ess-koeln.de; Author author@noreply.github.com Betreff: Re: [sveneisenschmidt/opentrans] Semantical Error (#4)

Hallo Mika,

which Composer Version do you use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/sveneisenschmidt/opentrans/issues/4#issuecomment-465865552, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZ9O048y-m2nWzr7DNWFym5LyonaWmySks5vPixQgaJpZM4bFXLB.

jkahnt commented 5 years ago

Hello Mika,

is it possible to upgrade your composer Version to the current build. I had the same problem and with an upgrade of composer I was able to fix it.

MaykilKucin commented 5 years ago

Dear jkahnt,

to update compose is not resolve the problem! I find a solution… , this helps:

https://stackoverflow.com/questions/25937261/autloading-not-working-correct-using-autoloader-php-in-vendor-directory

the use of this package is resolved all my problems:

https://github.com/indigophp/doctrine-annotation-autoload

THANK YOU!

Vielen Dank

Mit freundlichen Grüßen Maykil Kucin

[cid:ESS_logo_HELLBLAU_neu_70a42483-f7ab-4e79-902f-326b9fd90f3b.png]

EDV-Service Schmidt GmbH | Weißhausstraße 21a | 50939 Köln

Zentrale: +49 (221) 936 456 -0 | Fax: +49 (221) 936 456 -20 | www-ess-koeln.dehttp://www.ess-koeln.de/ Durchwahl: +49 (221) 936 456-37 | Mobil: +49 (1578) 3364565 | maykil.kucin@ess-koeln.de

Sitz der Gesellschaft ist Köln, HRB 35081 Geschäftsführung Dagmar Schmidt, Dipl.- Kfm. Stephan Schmidt

Diese Email enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese Email irrtümlich erhalten haben, informieren Sie uns bitte und vernichten Sie diese Email. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Email ist nicht gestattet. Diese Email wurde auf Viren überprüft. Dies garantiert aber keine Virenfreiheit. Wir übernehmen keine Haftung für eventuelle Schäden, die durch diese Email oder deren Anhänge entstehen können. Von: jkahnt notifications@github.com Gesendet: Freitag, 22. Februar 2019 14:11 An: sveneisenschmidt/opentrans opentrans@noreply.github.com Cc: Maykil Kucin | EDV-Service Schmidt GmbH Maykil.Kucin@ess-koeln.de; Author author@noreply.github.com Betreff: Re: [sveneisenschmidt/opentrans] Semantical Error (#4)

Hello Mika,

is it possible to upgrade your composer Version to the current build. I had the same problem and with an upgrade of composer I was able to fix it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/sveneisenschmidt/opentrans/issues/4#issuecomment-466391430, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZ9O05ZogixCPogM4eZySb9GzeFb5d61ks5vP-xqgaJpZM4bFXLB.