1

I know there are a lot of threads to this topic, but after searching for ~10 hours without a solution I will ask in a new thread.
I got two projects not working (properly).
I use Windows 8.1 64 bit with a clean jre/jdk 8 and javaee7. I have a glassfish 4 server and netbeans 8.
When I say my server log is empty than I mean the server domain log file found in "%glassgish4%\glassfish\domains\domain1\log".
My projects are simple enterprise-applications with JavaBeans.
My first problem is a multiexception in a simple remote method invocation via session-beans. I created the enterprise-application-project and a normal client (java) project to hold the remote interface. The client calls a simple method to add two numbers.
The project-structure can be seen here:
Project-Structure

The interface in the client-application can bee seen here:
NeueSessionBeanRemote

The interface implementation in the enterprise-application is this one:
Interface-Implementation

And here is the main-method from client-application:
main-method

The netbeans error output is here:
netbeans errror output

The server log is empty (just a succes notification from deploying the enterprise application project).

Well this was the first problem. Now I will tell you about the second.
It is a project allowing to enter customer information in a jsp form and inserting them into a database (travel agency).

This is the structure:
second project structure

I copied the class "Kunde" to the client-application because the RemoteInterface did not know "Kunde".
Well this is my RemoteInterface "Reisebuero2Remote":
Reisebuero2Interface

I won't show the client main method, because it is empty ;)
The interface-implementation looks like this:
interface-implementation The "Kunde" looks like that:
Kunde

Because the web implementation is simple html I will only show you the jsp file:
jsp file

And here is my probelm I can't even build the enterprise-application:
error at building

My server log is empty again.
If you need further information I will try to provide them.
Thank you very much for your support.


Edit:
Content of pom.xml from folder: C:\Program Files\glassfish-4\glassfish\lib\install\applications__admingui\META-INF\maven\org.glassfish.main.admingui\war
//Removed
POM.XML

Search Result for pom.xml in Project-Folder:
Search-Result
Context-Menu on project in Netbeans:
Context

j0chn
  • 1,103
  • 1
  • 7
  • 13
  • Please add the `pom.xml` for server and client parts to the question. – unwichtich Jun 09 '14 at 11:30
  • pom.xml is added. But what do you mean with client parts? – j0chn Jun 09 '14 at 11:56
  • You added the `pom.xml` of the GlassFish Admin Console...I mean the `pom.xml` of your project (Right-click the project -> Open POM). The client part is the one with the `main` method. – unwichtich Jun 09 '14 at 12:11
  • Sorry I don't find it. It is a javaEE EnterpriseApplication. In Netbeans and in Windows Explorer I can't find any pom.xml. And my context-menu doesn't proivde any "open pom". I added two new screenshots. – j0chn Jun 09 '14 at 12:21
  • Ah, I see this aren't Maven projects. Which libraries are you packaging with your client app? – unwichtich Jun 09 '14 at 12:30
  • By default I use Java EE 6 and 7 API Library and JDK 1.8. On client-side (in project (adding numbers) I additioanly added gf-client.jar from glassfish and the folder "modules" from glassfish – j0chn Jun 09 '14 at 12:36
  • Hmm, I can't see any real problem with your setup. Maybe if you set the ant verbosity level to debug (Settings button in the ant output window) the debug log gives any hint. – unwichtich Jun 09 '14 at 14:15
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/55327/discussion-between-j0chn-and-unwichtich). – j0chn Jun 09 '14 at 14:30

1 Answers1

1

The main problem:

java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException

seems to be caused by the order in which the Java EE 6 API Library and the gf-client.jar are added to the classpath.

It seems to be important that the gf-client.jar is the first library in the classpath.

To fix the issue, change the order of the libraries by removing Java EE 6 API Library and adding it again, so that gf-client.jar is on the first position.

Make sure to Clean & Build your project before you run it again.

See also:

Community
  • 1
  • 1
unwichtich
  • 13,712
  • 4
  • 53
  • 66