java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel() - jpa

How to fix this error using OpenXava 4.6 with Glassfish 2.2:
javax.servlet.ServletException: java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel
I got this error when trying to access my test module from the browser.
http://localhost:8080/testmod/xava/module.jsp?application=testmod&module=test

In my case, using openxava 4.6 with glassfishESBv22 gave me the error java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel... so when i changed the server to default tomcat bundle with OX4.6, it worked fine. that means it was the glassfish server problem...finally i used the latest glassfish server v3.1.2 and it also worked fine. so problem solved...only changing the server to the latest one was the solution.

OpenXava 4.6 uses JPA2, while the application server you're using uses JPA1. If you need to work with an old application server you can configure the classloaders in order that use JPA engine included your OpenXava application.

Related

Maven quarkus project doesn't start anymore after upgrade to 2.7.3 or 2.7.4

After upgrade from 2.7.2 to 2.7.3 or 2.7.4 my quarkus project doesn't start anymore. I get following Exception:
Caused by: java.lang.NoSuchFieldError: ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK
at io.vertx.core.http.HttpHeaders.<clinit>(HttpHeaders.java:106)
at io.vertx.core.http.impl.headers.HeadersMultiMap.<clinit>(HeadersMultiMap.java:63)
at io.quarkus.smallrye.openapi.runtime.OpenApiHandler.<clinit>(OpenApiHandler.java:24)
at io.quarkus.smallrye.openapi.runtime.OpenApiRecorder.handler(OpenApiRecorder.java:35)
Maybe it is releated to the upgrade of open api https://github.com/quarkusio/quarkus/pull/23886
When I disable open api it starts
quarkus.smallrye-openapi.enable=false
Your problem seems to be related to this one, So i believe we have 2 workarounds:
First try using different browser than chrome (if you don't, go directly to second step)
Then, try enabling CORS in your application.properties like following :
quarkus.http.cors=true
My problem was caused by a dependency with an older version of netty.
Updating netty fixed the problem.
https://stackoverflow.com/a/71423882/9651670
Thanks, this answer helped me a lot. I had to force a specific netty version on a previous update for azure/microsoft libs to work. Now they work with default managed version from quarkus and i removed netty-bom from dependencymanagement instead of updating it.

Whille deploying RESTful webservice, Shows error JdbcDataSource. not found

I have been trying to create my first RESTful execrcise using. But I am unable to deploy module due to error "com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : jdbc/playerDB__pm"
I checked and I have JNDI, daata source created.
Unlike specified in link. I am using:
-Netbeans 8.0.3, Java EE 7, GlassFish Server 4.
Also I have checked GlassFish is running fine.
Edit 1:
I have re-checked my 'Services' tab, and I could not find jdbc/__playedDB ,even though I have created it.
Its a bug, the JDBC resource file is not being created (atleast with versions I am using: GlassFish 4.1, Netbeans 8.0.2). Using GlassFish manually create.
There could still be different error untill you set following connectins:
database(data source) <- connection pool <- JNDI.

Ant build in Eclipse with Weblogic 9.2 - deployment exception - Unable to connect to 't3://localhost:7001': invalid type code: 31

It gives me the following exception message as I am trying to deploy an application.
BUILD FAILED
C:\eclipse\workspace\SLGIADMIN\build.xml:14: The following error occurred while executing this line:
C:\eclipse\buildcommon.xml:243: weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://localhost:7001': invalid type code: 31. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server.
I am using ant build in Eclipse and deploying to Weblogic 9.2.
I have been trying to find solution online. I have tried enable the tunneling in the Weblogic console. Doesn't work.
I have seen people mention we can use JDK 1.5 which will turn on tunneling on deploying. I have verified mine version is 1.5 too. I have ensured that too but did not fix the issue.
Invalid type code 31 is always because you're connecting with a different version of Java than what the server is running. Weblogic 9.2 only supports Java 1.5. Make sure that's what your ant task is using. You can also connect with later versions of Java if you set the following property in your client:
-Dsun.lang.ClassLoader.allowArraySyntax=true

Jboss AS 7 and class loading

I am using JBOSS AS 7.0.2 Final, and was trying to upgrade the version of RESTEASY that comes with 7.0.2 RESTEASY 2.2.1.GA to a newer version such as 2.3.4.Final. I followed the directions as indicated in patching provided by JBOSS, and when I did that, at application server startup it throws the error of being unable to parse the module.xml file.
I attempted the same procedure on 7.1.1 Final and it works fine.
First Question is, anyone know how to update RESTEASY in 7.0.2 (My other servers are all using this so I really like not to have to reset my other servers and replace with newer version of JBOSS)
I was hoping to upgrade RESTEASY, with hopes that this error may have been resolved in newer version
I have also tried by adjusting my POM to use version 2.3.4.Final and tried every scope, but it always would fail to use the newer jars and stick with JBOSS supplied jar.
15:14:09,947 SEVERE [org.jboss.resteasy.core.SynchronousDispatcher] (http--127.0.0.1-8443-6) Failed executing POST /countermeasure/customQueryLite: org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: java.util.ArrayList of media type
: application/xml
at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:216) [resteasy-jaxrs-2.2.1.GA.jar:]
It works fine for json, and text, and singular xml objects, but not list objects for xml.
Any answers in regards to these issues with resteasy and jboss would be helpful.

Oracle 10g - JAXB unmarshalling is not working as expected

We're using Oracle 10g application server and deployed the Web service and trying to deploy the web service client. Server is working fine i.e.; marshalling is working fine. We're getting the output from the service properly but the search client is not unmarshalling (parsing) the response received. We're using all the tags under same name space so there is no name space problem. Different collections would exists in the XSD. Has anyone faced similar kind of issue? Is there any solution for this?
Thanks
Santhosh
Well... the issue was due to the library which was not running as expected in Java 1.5. We've developed the web service client with JAX-WS 2.2 which was running properly when running with Netbeans IDE 6.8 but not on the standalone server. We've downgraded the Netbeans and modified the libraries to JAX-WS 2.1. It worked...
Good to know. JAX-WS 2.2 is not compatible with Java 1.5