We have a project made in netbeans 7.3 and are about to deploying this to a remote glassfish server, everything is configured and set up properly and the connection pools for our project are also generated in glassfish.
Currently we are getting this error when deploying to the remote server:
deploy?DEFAULT=D:\SVN\PTS62\Applicaties\Rekeningrijderwebsite\RekeningRijder\dist\RekeningRijder.war&name=RekeningRijder&contextroot=/RekeningRijder&force=true
failed on GlassFish Server 3+
Error occurred during deployment: Exception while preparing the app :
Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a
connection. Cause: Class name is wrong or classpath is not set for :
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Error Code: 0. Please see server.log for more details.
And the message the server generates:
Caused by: javax.resource.ResourceException: Class name is wrong or
classpath is not set for :
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:292)
at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:114)
at com.sun.gjc.spi.ManagedConnectionFactory.getDataSource(ManagedConnectionFactory.java:1307)
at com.sun.gjc.spi.DSManagedConnectionFactory.getDataSource(DSManagedConnectionFactory.java:163)
at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:102)
at com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87)
... 62 more
Google wasn't very helpfull before, so hopefully you guys/girls can help me
Thanks in advance!
You may need a mysql / java connector.
You can find it there. Extract the mysql-connector-java .jar from the archive. Then place it into the glassfish external lib directory {INSTALL DIR}/glassfish/domains/domain1/lib/ext.
Restart your glassfish server.
There are more details on this answer. If that's not what you are looking for, or if it doesn't work, tell us. #+
Right, you just lack mysql lib, just find and download mysql-connector-java-5.x.x-bin.jar copy to E:\Projects\glassfish3.1.1\glassfish\lib then restart server and enjoy !!!
Related
I'm running into the following error when trying to deploy to Glassfish from IntellIJ IDEA, but I can't work out where to look first to find the issue.
Error running 'Glassfish Dev'
Error Connecting to Glassfish Server.
Exception occurred : java.lang.NullPointerException
Exception message : null
This is Glassfish 3.1, the configuration used to work but has recently stopped, I can't work out if the issue should be investigated within the Glassfish server or the local project + config.
I am using Postman alongside a JAR file that runs a REST service that holds some contacts. However when I try to run the JAR file by using: java -jar ContactListRESTService.jar in Powershell, I am seeing a bunch of errors that Apache Tomcat could not run. Postman also doesn't recognize the localhost.
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:159)
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletCntainer.java:159) ~[spring-boot 1.3.7.RELEASE.jar!/:1.3.7.RELEASE]
I have tried uninstalling and reinstalling JAVA SE per some guidance from a mentor with no results.
If anyone can point me in the right direction please.
I am using Websphere V8.5 in RAD. While trying to create queue connection Getting the following error. If i am testing the same code in standard java application getting the connection object. But in webapplication it is not working.
Here is my code
MQQueueconnectionFactory factory=new MQQueueconnectionFactory();
factory.setHostName(HostName);
factory.setTransportType(1);
factory.setPort(1414);
factory.setChannel(ChannelName);
factory.setQueueManager(Queuemanagername);
connection=factory.createQueueConnection();
connection.start();
Error
"Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2495;AMQ8568: The native JNI library 'mqjbnd' was not found. [3=mqjbnd]
Caused by: java.lang.UnsatisfiedLinkError: no mqjbnd in java.library.path
Error Log
Thanks in advance.
Set 'client mode' if you write client, more
factory.setIntProperty(CommonConstants.WMQ_CONNECTION_MODE, CommonConstants.WMQ_CM_CLIENT);
Configure libraries if you start in default XMSC_WMQ_CM_BINDINGS mode.
I'm sorry so when I deploy the project in the local galssfish of netbeans ( start glassfish from netbeans I got the result that i want , the web service can got the data from mysql ( here is the url : http://localhost:8085/ServerSide/webresources/credit) but when I start glassfish from the comand line and deploy the .war of the project to see if the project can work in another local , with the same link (8085/ServerSide/webresources/credit) i got this error
root cause
javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
root cause
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: No database selected
Error Code: 1046
Call: SELECT id_Credit, AGENCE FROM credit
Query: ReadAllQuery(referenceClass=Credit sql="SELECT id_Credit, AGENCE FROM credit")
root cause
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: No database selected
Error Code: 1046
Call: SELECT id_Credit, AGENCE FROM credit
Query: ReadAllQuery(referenceClass=Credit sql="SELECT id_Credit, AGENCE FROM credit")
root cause
java.sql.SQLException: No database selected
At first time when when i want to deploy the .war in glassfish i have this error
Error occurred during deployment: Exception while preparing the app : Invalid resource : bd__pm. Please see server.log for more details
but I resolve this when I create a new jdbc connection pool and a jdbc ressource with the same name in my glassfish-resources.xml
I have resolved it this problem, here is the method :
first delete the jdbc resources and jdbc connection pool that i have create manually and i deploy the project.war with the comman line and add the glassfish-resources.xml like this:
cd C:\Program Files\glassfish\glassfish\bin
asadmin> start-domain
asadmin> deploy ...\project.war
asadmin> add-resources ...\glassfish-resources.xml
asadmin> restart-domain
I have a stateless EJB (3.0) running on weblogic 10.3 (Java 6).
I am able to call the EJB using a standalone client without any problems (using the weblogic jars). I am using the correct jndi name.
When I try to call the EJB from an application running on weblogic 10.0 (Java 5). I get the following root exception:
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is:
java.lang.ClassNotFoundException: weblogic.ejb.spi.BusinessObject: This error could indicate that a component was deployed on a cluster member but not other members of that cluster. Make sure that any component deployed on a server that is part of a cluster is also deployed on all other members of that cluster]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)
at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:426)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:382)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:367)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.lookup(AbstractRemoteSlsbInvokerInterceptor.java:98)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.getHome(AbstractSlsbInvokerInterceptor.java:159)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.create(AbstractSlsbInvokerInterceptor.java:214)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.newSessionBeanInstance(AbstractRemoteSlsbInvokerInterceptor.java:221)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.getSessionBeanInstance(SimpleRemoteSlsbInvokerInterceptor.java:141)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:97)
... 75 more
Caused by: java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is:
java.lang.ClassNotFoundException: weblogic.ejb.spi.BusinessObject: This error could indicate that a component was deployed on a cluster member but not other members of that cluster. Make sure that any component deployed on a server that is part of a cluster is also deployed on all other members of that cluster
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:231)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at weblogic.jndi.internal.ServerNamingNode_1001_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:379)
... 89 more
Caused by: java.lang.ClassNotFoundException: weblogic.ejb.spi.BusinessObject: This error could indicate that a component was deployed on a cluster member but not other members of that cluster. Make sure that any component deployed on a server that is part of a cluster is also deployed on all other members of that cluster
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:218)
at weblogic.common.internal.ProxyClassResolver.resolveProxyClass(ProxyClassResolver.java:71)
at weblogic.common.internal.ProxyClassResolver.resolveProxyClass(ProxyClassResolver.java:40)
at weblogic.rjvm.MsgAbbrevInputStream.resolveProxyClass(MsgAbbrevInputStream.java:427)
at weblogic.rjvm.MsgAbbrevInputStream$NestedObjectInputStream.resolveProxyClass(MsgAbbrevInputStream.java:668)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
This error could indicate that a component was deployed on a cluster member but not other members of that cluster. Make sure that any component deployed on a server that is part of a cluster is also deployed on all other members of that cluster
This does not make sense there aren't any clusters involved (two separate weblogic instances running on my local machine).
Any idea what the cause of the exception might be?
UPDATE: If I copy wlclient.jar from weblogic 10.3 to the lib of the domain running on weblogic 10.0 the call works but that isn't a good solution and I don't understand why it has an dependency on weblogic classes.
Clearly this is a jar issue. Please verify all the location the classpath is referencing and make sure none of the jar files is present twice and also make sure that the jar file containing the weblogic.ejb.spi.BusinessObjec is present on the classpath.
Hope this helps .