You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to separate a AFP into separately files. I read line per line the AFP and directly write this line into a new file but always I am having this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/xmi/impl/EcoreResourceFactoryImpl at org.afplib.afplib.impl.AfplibPackageImpl.loadPackage(AfplibPackageImpl.java:18300) at org.afplib.base.impl.BasePackageImpl.init(BasePackageImpl.java:155) at org.afplib.base.BasePackage.<clinit>(BasePackage.java:57) at org.afplib.afplib.impl.AfplibPackageImpl.init(AfplibPackageImpl.java:3822) at org.afplib.afplib.AfplibPackage.<clinit>(AfplibPackage.java:59) at org.afplib.afplib.impl.BDTImpl.eStaticClass(BDTImpl.java:109) at org.eclipse.emf.ecore.impl.EObjectImpl.eClass(EObjectImpl.java:263) at org.afplib.io.StructuredFieldFactory.binary(StructuredFieldFactory.java:22401) at org.afplib.io.AfpOutputStream.writeStructuredField(AfpOutputStream.java:22) at com.organization.test.afpReader.ReadTest.main(ReadTest.java:39) Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 10 more
This is my current code:
`AfpInputStream ain = new AfpInputStream(new FileInputStream( fileIn ));
AfpOutputStream aon = new AfpOutputStream( new FileOutputStream( fileOut ) );
SF sf;
int i = 0;
while( (sf = ain.readStructuredField()) != null ){
System.out.println( sf );
if( sf instanceof EDTImpl )
{
aon.writeStructuredField( sf );
fileOut = new File("prueba" + ++i + ".out" );
aon = new AfpOutputStream( new FileOutputStream( fileOut ) );
}
else
{
aon.writeStructuredField( sf );
}`
The text was updated successfully, but these errors were encountered:
gio05
changed the title
Read and Write AFP
Read and Write AFP (Not sure if is an issue)
Apr 2, 2020
Hi @gio05,
the exception means that EMF is missing. The easiest way for you to start is build the HelloWorld project using maven. This makes sure all the dependencies are present. Could you try this?
I am trying to separate a AFP into separately files. I read line per line the AFP and directly write this line into a new file but always I am having this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/xmi/impl/EcoreResourceFactoryImpl at org.afplib.afplib.impl.AfplibPackageImpl.loadPackage(AfplibPackageImpl.java:18300) at org.afplib.base.impl.BasePackageImpl.init(BasePackageImpl.java:155) at org.afplib.base.BasePackage.<clinit>(BasePackage.java:57) at org.afplib.afplib.impl.AfplibPackageImpl.init(AfplibPackageImpl.java:3822) at org.afplib.afplib.AfplibPackage.<clinit>(AfplibPackage.java:59) at org.afplib.afplib.impl.BDTImpl.eStaticClass(BDTImpl.java:109) at org.eclipse.emf.ecore.impl.EObjectImpl.eClass(EObjectImpl.java:263) at org.afplib.io.StructuredFieldFactory.binary(StructuredFieldFactory.java:22401) at org.afplib.io.AfpOutputStream.writeStructuredField(AfpOutputStream.java:22) at com.organization.test.afpReader.ReadTest.main(ReadTest.java:39) Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 10 more
This is my current code:
`AfpInputStream ain = new AfpInputStream(new FileInputStream( fileIn ));
AfpOutputStream aon = new AfpOutputStream( new FileOutputStream( fileOut ) );
The text was updated successfully, but these errors were encountered: