What are the __pm and __nontx suffixes? - java

My java EE application is giving following error when i try to run the application on glassfish server. It says "Invalid resource : jdbc/busservice__nontx". Where should i look to fix this error? Previously it was giving error with "jdbc/busservice__pm". Once I created JDBC resource and connected with connection pool, error disappeared. However i'm still getting error with "jdbc/busservice__nontx"
Info: PER02100: Could not load Toplink Essentials. Assuming this is an upgrade from V2. Switching Persistence Unit [BusReservationPU] to use [org.eclipse.persistence.jpa.PersistenceProvider] as JPA provider. If you intend to use Toplink Essentials, please ensure that it is visible to your application."
Severe: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
Severe: java.lang.RuntimeException: Invalid resource : jdbc/busservice__nontx
at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:593)
at com.sun.enterprise.connectors.ConnectorRuntime.lookupNonTxResource(ConnectorRuntime.java:559)
at org.glassfish.persistence.common.PersistenceHelper.lookupNonTxResource(PersistenceHelper.java:59)
at org.glassfish.persistence.jpa.ProviderContainerContractInfoBase.lookupNonTxDataSource(ProviderContainerContractInfoBase.java:76)
at org.glassfish.persistence.jpa.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:109)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:142)

Do not add "jdbc/busservice__pm" to your Glassfish JDBC Resources, just add it as "jdbc/busservice". It looks like the __pm and __nontx are some internal names that it adds to the end of your jdbc name internally, and when you specifically add it will mess it up and throw that error.

Related

How do I install PostgreSQL on a Payara Docker container?

I'm trying to install create a container that runs a Payaraserver with my JAX-RS application. Getting the server running wasn't too hard, I simply used the official image. However, when I create the Connection Pool I was not able to ping, and I got this error message:
Ping Connection Pool failed for PostgreSQLPool.
Class name is wrong or classpath is not set for :
org.postgresql.ds.PGConnectionPoolDataSource Please check the server.log for more details.
Also, when i tried to upload the .war file (after I had created the DataSource) I got this error message:
Error occurred during deployment: Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.7.7.payara-p3): org.eclipse.persistence.exceptions.DatabaseException Internal Exception:
java.sql.SQLException: Error in allocating a connection. Cause:
org.postgresql.ds.PGConnectionPoolDataSource cannot be cast to javax.sql.DataSource Error Code:
0. Please see server.log for more details.
After a bit of digging I thought that the problem was that I did not have the postgre jdbc driver in the container. I created this Dockerfile:
FROM payara/server-full
COPY postgresql-42.2.18.jar /opt/payara41/glassfish/domains/domain1/lib
, which I thought would add the .jar file to the container. Unfortunately, no change was made. I have the exact same configurations on a local installation of Payara and everything works just fine there.
Is there something that I'm missing? I'm quite new to dockers, so if someone would be able to pint me in the right direction, I would really appreciate it.

JBAS011843: Failed instantiate InitialContextFactory com.ibm.websphere.naming.WsnInitialContextFactory

I'm migrating one application from Websphere to jboss EAP 6.0. I've made the Datasources on Jboss console. But in my code I've referring this way:
but while hitting the application from Jboss, it's giving the below error:
FATAL http-/135.155.175.224:8080-1 dbconn.DBAccess - getDatasource():
CRITICAL ERROR: JDBC Naming service exception: JBAS011843: Failed
instantiate InitialContextFactory
com.ibm.websphere.naming.WsnInitialContextFactory from classloader
ModuleClassLoader for Module "deployment.UPMSSSO.ear.UPMSSSO.war:main"
from Service Module Loader
Could anyone please hint the error. Is there any other in for JBoss?
Since you are migrating to Jboss from WebSphere and you are using "com.ibm.websphere.naming.WasInitialContextFactory" class, which is WAS specific class, that's why you are getting this error.
Change that to "org.jboss.naming.remote.client.InitialContextFactory" and then try again. That should resolve your issue.
UPDATE
All you should have to do is new InitialContext(), without any argument. JNDI is pre-configured with the appropriate properties for you by the app server unless you are looking for remote objects on any other server.

NoClassDefFoundError for com.ibm.wsspi.uow.UOWManager

I have a Websphere server deployed on my machine and I'm getting back:
java.lang.NoClassDefFoundError: com.ibm.wsspi.uow.UOWManager
This happens whenever I view any page on the application I have running on Websphere. There were no issues compiling with maven, only on run-time do I have this problem. I did some research and found this particular exception points to a problem with the class path. Shouldn't this class come with Websphere? Do I just need to point the class path to it?
Top two lines of the stack trace:
[9/8/14 16:36:46:278 GMT] 0000007c SpringServlet I Creating new child context from /WEB-INF/spring/appServlet/servlet-context.xml
[9/8/14 16:36:46:287 GMT] 0000007c ServletWrappe E SRVE0100E: Did not realize init() exception thrown by servlet service: java.lang.NoClassDefFoundError: com.ibm.wsspi.uow.UOWManager
Check this page Using Spring and Hibernate with WebSphere Application Server
Try to use the following entry as transaction manager instead of UOWManager.
Solved it...Websphere did not fully update due to a permission issue on the folder, but claimed it was updated. I reinstalled it to a different folder and ran the updates successfully.

Unable in running Project from Tomcat to Glassfish server in Netbeans

I made a Java web project using Tomcat server.Now I am opening the same project in another PC where only Glassfish is installed(Due to some reasons I don't wanna run the project using Tomcat anymore).But it gives this exception now.
Exception during lifecycle processing
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Unable to add listener of type: com.chat.listeners.ChatAppListener, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces
Is there any warning when you opening the project in netbeans.Right click on the project , select resolve server missing problem.Choose Glassfish server.Run once again.
You have apache specific relations in your web.xml file (like file handler servlets).
That is why glassfish can't start your application.

Deploying webservice using virtualbox sdk 4.0 in glassfish3.1

After plenty of attempts and research I can't figure out where this exception comes from:
SEVERE: Exception in thread "Thread-31"
SEVERE: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [vboxwebService_4_0.wsdl], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2074)
at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1034)
at org.glassfish.web.loader.WebappClassLoader.getResource(WebappClassLoader.java:1169)
at org.glassfish.web.loader.WebappClassLoader.getResource(WebappClassLoader.java:1135)
at org.virtualbox_4_0.PortPool.getPort(VirtualBoxManager.java:105)
at org.virtualbox_4_0.PortPool.preinit(VirtualBoxManager.java:82)
at org.virtualbox_4_0.PortPool.access$200(VirtualBoxManager.java:36)
at org.virtualbox_4_0.PortPool$1.run(VirtualBoxManager.java:62)
at java.lang.Thread.run(Thread.java:662)
The idea was to create a webservice that uses the virtualbox 4.0 sdk.
I tried this within:
- eclipse helios service pack2
- glassfish 3.1
The service contains the vboxjws.jar in WEB-INF/lib now whenever I try to start it upon the server I get the exception from above.
Am I missing something essential that could solve this issue?
Thanks in advance,
Giriel

Categories