ConnectorRuntimeException: Invalid resource - java

I am creating an enterprise java application using netbeans 8.0.1 java EE6 and glassfish server 4.1.1 attached with netbeans.
When I have created the db in mysql and connected successfully and created entity class from database and session bean for that entity class and I am going to deploy the application it gives this error:
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : java:module/custordermgt__pm
at org.glassfish.jdbcruntime.service.JdbcDataSource.validateResource(JdbcDataSource.java:81)
at org.glassfish.jdbcruntime.service.JdbcDataSource.setResourceInfo(JdbcDataSource.java:62)
at org.glassfish.jdbcruntime.JdbcRuntimeExtension.lookupDataSourceInDAS(JdbcRuntimeExtension.java:136)
at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:589)
What caused this exception?

This is probably due to a NetBeans bug. Take a look at the solution here: https://stackoverflow.com/a/56921913/1429984

Related

Restlet Version 2.2 java.lang.NoSuchMethodError: javax/xml/stream/XMLInputFactory.newFactory()

I am using the Restlet Version 2.2.0 with the IBM jdk 1.6.0_26 and I am trying to implement a REST Service. While executing my test project I am getting the following error:
Starting the internal [HTTP/1.1] server on port 8080
Server started ...
An exception occured writing the response entity
java.lang.NoSuchMethodError: javax/xml/stream/XMLInputFactory.newFactory()Ljavax/xml/stream/XMLInputFactory;
at org.restlet.ext.jackson.JacksonRepresentation.createObjectMapper(JacksonRepresentation.java:215)
at org.restlet.ext.jackson.JacksonRepresentation.getObjectMapper(JacksonRepresentation.java:333)
at org.restlet.ext.jackson.JacksonRepresentation.createObjectWriter(JacksonRepresentation.java:277)
at org.restlet.ext.jackson.JacksonRepresentation.getObjectWriter(JacksonRepresentation.java:361)
at org.restlet.ext.jackson.JacksonRepresentation.write(JacksonRepresentation.java:474)
at org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:519)
at org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:463)
at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:196)
at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:153)
at org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:73)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:77)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:567)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:539)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:737)
Unable to send error response
java.io.IOException: headers already sent
at sun.net.httpserver.ExchangeImpl.sendResponseHeaders(ExchangeImpl.java:180)
at sun.net.httpserver.HttpExchangeImpl.sendResponseHeaders(HttpExchangeImpl.java:80)
at org.restlet.engine.connector.HttpExchangeCall.writeResponseHead(HttpExchangeCall.java:157)
at org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:459)
at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:214)
at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:153)
at org.restlet.engine.connector.HttpServerHelper$1.handle(HttpServerHelper.java:73)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:77)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:567)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:539)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:737)
While using Sun/Oracle 1.6 JDK the problem doesn't exist, but I need to stay at
IBM jdk 1.6.0_26.
Any help would be appreciated.
Thanks,
EHa
It's likely a problem with the fallback JAXP selection between the two JDKs. Run java with -Djaxp.debug=1 and have a look at your logs. I'm currently encountering this same issue and my logs are showing
JAXP: find factoryId =javax.xml.parsers.SAXParserFactory
JAXP: loaded from fallback value: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
JAXP: created new instance of class com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader: null
I'm pretty certain that my issue is OSGi related. Here's the link to another question with what could be a similar outcome: Unable to find a factory for http://www.w3.org/2001/XMLSchema

Getting runtime error while trying to connect mysql from java

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from [Module "deployment.Sample.war:main" from Service Module Loader].
The above one is my error message.
I have included mysql-connector-java-5.1.35-bin.jar in my class path and it is shown in the libraries as well.
I am using JBoss AS 7.1.0.Final server to run it. How to resolve this error?

java.sql.SQLException: No suitable driver found jdbc:oracle:thin

I am trying to deploy a spring based web application in my local tomcat server. Below are my application details:
Spring based web application (war)
Tomcat 6 server
Java 1.6
Oracle DB
Below are by jdbc configuration:
Configuration for tomcat settings only.
javax.persistence.jdbc.drive=oracle.jdbc.OracleDriver javax.persistence.jdbc.url=jdbc:oracle:thin:#coursesdev.cvbaybp20ew7.eu-west-1.rds.amazonaws.com:1521:DEVCRS
javax.persistence.jdbc.user=test
javax.persistence.jdbc.password=test
I have also added ojdbc6.jar,ojdbc14.jar in my /lib folder
I deployed my war file without any issues. But when my application tries to connect to db it throws the error:"java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:#coursesdev.cvbaybp20ew7.eu-west"
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:#coursesdev.cvbaybp20ew7.eu-west-1.rds.amazonaws.com:1521:DEVCRS
Error Code: 0
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:517)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:445)
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:366)
... 81 more
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:#coursesdev.cvbaybp20ew7.eu-west-1.rds.amazonaws.com:1521:DEVCRS
Error Code: 0
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:319)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:109)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:330)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:293)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:418)
at org.eclipse.persistence.sessions.server.ConnectionPool.buildConnection(ConnectionPool.java:216)
at org.eclipse.persistence.sessions.server.ConnectionPool.startUp(ConnectionPool.java:504)
at org.eclipse.persistence.sessions.server.ServerSession.connect(ServerSession.java:484)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:633)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:208)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
... 87 more
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:#coursesdev.cvbaybp20ew7.eu-west-1.rds.amazonaws.com:1521:DEVCRS
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
... 97 more
I have seen a lot of post with the similar issue but am not sure what i am missing though.
This error is depends on your building structure. Adding jar file to your lib folder is not gonna do anything.
You should add the jar file to your classpath.
If you are building your project by IDE, lets say eclipse, you should add it to .classpath file. If you are using Idea you should add it to your .iml file and etc.
If you are building your project by ant you should add jar address to your build.xml file.
I suppose you are not using maven.

Issue in creating an instance of JAX-WS client to access the service

Iam new to Webservices.
Iam trying to create a JAX- WS client from a WSDL file . Using RAD 8.0 , I generated the classes including the proxy ,SEI and the Webservice client .Now iam trying to hit the exposed webservice methods as a standalone application .
I have added jaxws-rt-2.1.4.jar to the classpath also .
From the main class ,if i try to create an instance of the client to access the service iam getting the following error .
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:227)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1345)
at java.util.ServiceLoader$ServiceIterator.next(ServiceLoader.java:195)
at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
at javax.xml.ws.spi.Provider.provider(Provider.java:106)
at javax.xml.ws.Service.<init>(Service.java:57)
at com.royalbank.wcm_ap.ws_client.rbcauth.v1.AnPAuth.<init>(AnPAuth.java:35)
at com.royalbank.wcm_ap.ws_client.rbcauth.v1.TestClass.main(TestClass.java:53)
Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:222)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
at java.security.AccessController.doPrivileged(AccessController.java:203)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:88)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:205)
... 8 more
Caused by: javax.xml.bind.JAXBException
- with linked exception:
[java.lang.ClassNotFoundException: com.ibm.xml.xlxp2.jaxb.JAXBContextFactory]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:207)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:401)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:565)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)
Am i missing something here with regard to the configurations ? thanks in advance :)
The Missing class "com.ibm.xml.xlxp2.jaxb.JAXBContextFactory" is available in the jar "com.ibm.jaxws.thinclient_8.5.0.jar" which will be available in the server runtime directory for Websphere App server : C:\Program Files\IBM\WebSphere\AppServer\runtimes.
Please include this jar for compile purpose only and donot include this in your WAR or EAR as it will conflict with your server runtime library jar.
For server WAS 8.0 the path jar would be "com.ibm.jaxws.thinclient_8.0.0.jar".

JNDI lookup fails in Glassfish

I am working on a web project using maven.When I run the server on net-beans 6.8,the build is succes,but when deploying to server I am getting lookup failed exception.Please find the server log in the following url http://pastie.org/1997218. Let me know What I have missed here. The stack trace for the error is
SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/deliver' in SerialContext [Root exception is javax.naming.NameNotFoundException: deliver not found]
at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init> (PersistenceUnitInfoImpl.java:111)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:130)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:96)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
...
As it seems your production server is missing the database resource jdbc/deliver your application needs. You have configured it properly for your test instance in NetBeans. Have a look at the Services tab in NetBeans and make sure you have a similar database set up on your server.

Categories