aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes j2EE v6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "j2EE v6" Watch "j2EE v6" New topic
Author

j2EE v6

omile bartholomew
Greenhorn

Joined: Jan 23, 2013
Posts: 5
please i need help in developing standalone application using EJB.
first i thank all who have been contributing in java.i am new to EJB.
my problem is :i tried to build remote application using Ejb ,
1. i build entity bean from datebase
2. i tried to build session bean from entity class for remote AP.
then error="EJB Remote Interface depends on JPA AEntity classes. JPA Entities are inaccessible if they are located in mode." i used netbean 7.2.1.

as i was making a research over a week ,i stormble over this solution
1 .that i should build class library
2. create entity bean in the class library
3.add the class library to the already created ejeModule
4.create persistence Unit
5.create session bean for entity class in ejbModule .
Great i used that to create my Remote application .

BUT:when i tried to build my ejeModule i keep on seen this malignant error

="An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/persistence/PersistenceException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getField(PrivilegedAccessHelper.java:216)
at org.eclipse.persistence.internal.helper.Helper.getField(Helper.java:934)
at org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor.initializeAttributes(InstanceVariableAttributeAccessor.java:100)its(PersistenceUnitReader.java:168)
at org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1106)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
at com.sun.tools.javac.main.Main.compile(Main.java:417)
at com.sun.tools.javac.main.Main.compile(Main.java:331)
at com.sun.tools.javac.main.Main.compile(Main.java:322)
at com.sun.tools.javac.Main.compile(Main.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

C:\Users\Administrator\Documents\NetBeansProjects\serva\nbproject\build-impl.xml:849: The following error occurred while executing this line:
C:\Users\Administrator\Documents\NetBeansProjects\serva\nbproject\build-impl.xml:258: Compile failed; see the compiler error output for details.


please i need help.i have spend over a week and some days trying to get rid of this ,please my Java gurus give me a step by step solution in this ,i am new to EJE .
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

It looks like you are trying to run the application using the javaee-api JAR file, which is just a bunch of stubs for the classes/methods so that you can compile your code. To run the application you will need an implementation of JavaEE, such as GlassFish or the like.


Steve
omile bartholomew
Greenhorn

Joined: Jan 23, 2013
Posts: 5
i run it in netbean IDE 7.2.1, which has glassfish 3.2.1 running
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

But do you run it from in the J2EE environment or do you run it as a Java Application (from the main() method)?
omile bartholomew
Greenhorn

Joined: Jan 23, 2013
Posts: 5
i created a class library,
created entity bean from database in my class library ,then add eclipselink (2.0) to my class library.
i created EJBModule, add my already created class library to it.
create a persistence unit then create session bean for entity class for my Remote Application.
if i try to clean and build it , it will throw the error i stated above,if i try also to deploy it to my glassfish 3.2.1 ,it will throw another error saying "the module has not been deployed".

And there is no way i can run my Remote Application b'cos the dependent EJB has not been deployed.i can not insert to the database neither can i query .please i appreciate your help .throw more light please
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: j2EE v6