Load JDBC resource - glassfish

I trying to configure Glassfish 5 with this datasource JNDI name: jdbc/DefaultD
Exception attempting to inject Res-Ref-Env-Property: jdbc/DefaultDB#javax.sql.DataSource# resolved as: jndi: java:comp/DefaultDataSource#res principal: null#mail: null No Runtime properties Database Vendor : null Create Tables at Deploy : false Delete Tables at Undeploy : false into class com.crm.web.authentication.LoginController: Lookup failed for 'java:comp/env/jdbc/DefaultDB' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
I created datasource pool and and JDBC resource but when I run the wen application I get above error. Is there any solution for this problem?

before creating data source JNDI you need to place the database related Jar file in the glass fish domain lib folder.
ex: if you are creating JNDI for MySQL database in default glass fish domain domain1, then you need to place the "mysql-connector-java-5.1.23-bin.jar" in lib folder. then restart the server then it will work

Related

Weblogic Deployment issue due to NameAlreadyBoundException - after upgraded weblogic from 10.3.6 to Weblogic 12cR2

My application currently working under weblogic 10.3 with Java 1.6.
Now we are trying to deploy same application to weblogic 12cR2 & java 1.8, below is the error we are facing.
Unable to bind Business Interface to the JNDI name: Gen4CServlet_warcontact_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactSession to RemoteContactession. Another EJB has already bound an interface to that name.; remaining name 'ejb/Contact#com/ce'. NestedException Message is :[EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactSession to RemoteContactSession. Another EJB has already bound an interface to that name."
weblogic.application.ModuleException: Unable to bind Business Interface to the JNDI name: iLinqGen4CGEServlet_warcontactge_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactGESession to RemoteContactGESession. Another EJB has already bound an interface to that name.; remaining name 'ejb/Contact#com/hh/cc/ce'. NestedException Message is :[EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactSession to RemoteContactSession. Another EJB has already bound an interface to that name.
at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:212)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:207)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
According to Oracle KM Unable To Bind Business Interface To The JNDI Name javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind (Doc ID 2254400.1), this can be due to Class-Path entry in MANIFESF.MF file. Try to remove the same redeploy the application.

MFP8 - WASND installation Issue

I am trying to install MFP Product version: 8.0.0.00-20170125-0919 in my QA environment on WASND 8.5.5. Server topology is, DMGR, DB, WAS are in a Private VLAN and WEB(IHS) server in public VLAN. Seems like I missed some JNDI property.
In MFP Console, I am getting the below error:
FWLSE3002E: The resource is not found.
FWLSE3030E: The runtime "mfp" does not exist in the MobileFirst administration database. The database may be corrupted.
In MFP Console - Administration DB, Live Update, and Push Service are showing inactive.
See the JNDI properties such as mfp.admin.proxy*. under "Table 4. JNDI properties for administration service: proxies" in this link : https://www.ibm.com/support/knowledgecenter/en/SSHS8R_8.0.0/com.ibm.worklight.installconfig.doc/install_config/r_wladmin_jndi_property_list.html#r_wladmin_jndi_property_list
Also verify that jmx JNDI properties are correctly set. You can find the JXM properties that needs to be set from the link : https://www.ibm.com/support/knowledgecenter/SSHS8R_8.0.0/com.ibm.worklight.installconfig.doc/install_config/c_wasnd_topol.html

How to deploy an atg project in weblogic?

I created a simple project using ATG 10.2 .I want to know how to deploy it in weblogic. Please provide detailed procedure with screenshots,if possible.
To provide a 'detailed' procedure is beyond the scope of what StackOverflow is trying to provide. That said, if you have an understanding of the Weblogic Management Console you should be able to follow these steps to setup your initial deployment:
Create a Server
1.1 Specify a server name (eg. commerce) and the port number this server will run on (eg. 8180). Select it as a 'Stand-alone server'.
1.2 Once created go to Configuration > Server Start for the newly created server and modify the 'Arguments' block and include the following setings (assuming you are running windows, for Unix update your own paths)
-Datg.dynamo.data-dir=c:\ATG-Data -Datg.dynamo.server.name=commerce -d64 -XX:ParallelGCThreads=8 -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Xms1152m -Xmx2048m -XX:NewSize=128m -XX:MaxNewSize=256m -XX:PermSize=128m -XX:MaxPermSize=256m
1.3 Save your Server
Create DataSources
2.1 In the Console click on 'Services > Data Sources'
2.2 Create 'New' datasources for each of your connections. As a minimum you will need connections for ATGSwitchingDS_A, ATGSwitchingDS_B (Assuming you are doing switching datasources) and ATGProductionDS. These names should match your JNDI names in your property files. Remember to specify the 'commerce' server as the target for each of the datasources.
Create Deployment
3.1 Assuming you've already built your EAR (eg. ATGProduction.ear) and it is available in c:\deployments you need to create a deployment in Weblogic. You need to create the deployment in the console and specify the target as 'commerce'. Once done you need to also 'start serving requests' on the deployment.
Start Server
You should now be able to see your server running on port 8180 with the log files being written to c:\ATG-Data\servers\commerce\logs.
If after this things aren't running, post specific questions about your issues and someone here might be able to help you.

Predeployment of PersistenceUnit [appcenterdb-oracle] failed

I installed the following on my RHEL 6
(1) MFP63
(2) MySQL56
(3) WAS 8.5.5.6
and trying to set up my first mobile first project but 'messages.log' has the following errors
I FFDC1015I: An FFDC Incident has been created: "javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [appcenterdb-oracle] failed.
Internal Exception: Exception [EclipseLink-7157] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Entity class [class com.ibm.puremeap.jpa.entity.PushBatchDeviceEntity] must use a #JoinColumn instead of #Column to map its relationship attribute [device]. com.ibm.ws.jpa.management.JPAPUnitInfo.createEMFactory 759" at ffdc_15.07.27_21.00.27.0.log
[7/27/15 21:00:27:238 IST] 00000068 com.ibm.ws.jpa.management.JPAPUnitInfo E CWWJP0015E: An error occurred in the org.eclipse.persistence.jpa.PersistenceProvider persistence provider when it attempted to create the container entity manager factory for the appcenterdb-oracle persistence unit. The following error occurred: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [appcenterdb-oracle] failed.
Internal Exception: Exception [EclipseLink-7157] (Eclipse Persistence Services - 2.6.0.WAS-v20150513-26196d2): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Entity class [class com.ibm.puremeap.jpa.entity.PushBatchDeviceEntity] must use a #JoinColumn instead of #Column to map its relationship attribute [device].
Message says 'Predeployment of PersistenceUnit [appcenterdb-oracle] failed' but I am using 'MySQL' instead of 'oracle' which is bit confusing to me
I am using Java 8 (with JDK6 and 7 I was facing other issues)
http://pastebin.com/WcWBUjVn (server.xml)
http://pastebin.com/QzByZ63T (messages.log)
Thanks
Sathish Kumar
There are three issues in total:
You are using Java 8 with a MobileFirst Foundation version that does not support it. The system requirements of MobileFirst Foundation 7.0 state that only Java 6 and Java 7 are supported. The symptom is seen in your first messages.log: It is the exception java.lang.IllegalStateException: Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher
Your server.xml contains two elements <application id="worklightconsole" name="worklightconsole" location="worklightconsole.war" type="war">. That is, you have two web applications with the same id, the same name, and the same context root. This can never work. The cause is apparently that you passed worklightconsole.war as argument to <configureApplicationServer>. Instead, as documented in Deploying the project WAR file, the WAR file that you specify should be a MobileFirst project WAR file, built through MobileFirst Studio or through the <war-builder> Ant task.
The second messages.log file contains the log messagesFWLSE2008I: MBean registration succeeded for: com.worklight.common.server.jmx.api:type=WorklightAdmin,qualifier=worklightadmin
FWLSE2008I: MBean registration succeeded for: com.worklight.common.server.jmx.api:type=ProjectManagement_simpleServer,qualifier=worklightconsole [project worklightconsole]
The first one shows an empty environment id, whereas the second one shows an environment id "simpleServer". This environment id is also visible in the server.xml file:<jndiEntry jndiName="worklightconsole/ibm.worklight.admin.environmentid" value='"simpleServer"'/>
But according to the documentation of <configureApplicationServer>, you should pass the same environment id value in both cases.
#Sathish, In the server.xml you have uploaded, I can see those features
<feature>javaee-7.0</feature>
<feature>servlet-3.1</feature>
<feature>jdbc-4.1</feature>
The last two features are not installed by MobileFirst Ant tasks or the Server Configuration Tool.
This let me think you changed them manually after the installation process because you are using an unsupported Liberty profile flavour like
WAS Liberty V8.5.5.6 with Java EE 7 Web Profile or WAS Liberty V8.5.5.6 with Java EE 7 Full Platform
which does not provide the expected features servlet-3.0 and jdbc-4.0 but instead servlet-3.1 and jdbc-4.1.
Actually, MFP 6.3 only supports MFP 6.3 only supports WebSphere Application Server Liberty Core
http://www-969.ibm.com/software/reports/compatibility/clarity-reports/report/html/prereqsForProduct?deliverableId=1404132386734#!
which contains
You may get it from the FixCentral website
http://www-933.ibm.com/support/fixcentral/
On Select product tab, choose
Product Group : WebSphere
Select from WebSphere : WebSphere Application Server
Installed Version : 8.5.5.6
Platform : All
Then select
Individual fix IDs : wlp-core-runtime-8.5.5.6
As 'slowhand' suggested the issue was with 'server.xml' because of multiple 'application id' with the same name
It appears 'ant' tasks does not generate all the tags correctly and I made little corrections to make it work
Thanks
Sathish Kumar

How to address JNDI configuration when using mvn scala:console

I'm troubleshooting a Mapper problem and I'm running into an issue trying to use a Mapper class inside of the Scala/Lift console. Our MetaMappers have their datasource configured through a ConnectionIdentifier that points to a JDBC datasource configured in JNDI. This works great when bootstrapping through Jetty.
When loading the console and running (new bootstrap.liftweb.Boot).boot to initialize, Schemifier.schemify fails JNDI configuration is not available.
scala> (new bootstrap.liftweb.Boot).boot
java.lang.NullPointerException: Looking for Connection Identifier ConnectionIdentifier(jdbc/svcHub) but failed to find either a JNDI data source with the name jdbc/svcHub or a lift connection manager with the correct name
at net.liftweb.mapper.DB$$anonfun$7$$anonfun$apply$12.apply(DB.scala:141)
at net.liftweb.mapper.DB$$anonfun$7$$anonfun$apply$12.apply(DB.scala:141)
at net.liftweb.common.EmptyBox.openOr(Box.scala:465)
at net.liftweb.mapper.DB$$anonfun$7.apply(DB.scala:140)
at net.liftweb.mapper.DB$$anonfun$7.apply(DB.scala:140)
at net.liftweb.common.EmptyBox.openOr(Box.scala:465)
at net.liftweb.mapper.DB$.newConnection(DB.scala:134)
at net.liftweb.mapper.DB$.getConnection(DB.scala:230)
at net.liftweb.mapper.DB$.use(DB.scala:581)
at net.liftweb.mapper.Schemifier$.schemify(Sche...
Essentially, I'd like to have full MetaMapper functionality from within the console. My question is: What's the best way to bootstrap a Lift app from the console such that the JNDI-based dependencies can also be fulfilled outside of a JNDI-capable web container?
Under a application server it's likely that the server will provide a JNDI context for you. In a standalone application you must provide a JNDI Context your self. For that you can use a javax.naming.InitialContext.
There is a nice example using Apache's DBCP here: http://commons.apache.org/dbcp/guide/jndi-howto.html. Of course, will you have to fix the Datasource objects to the implementation you are using.
This will be enough (not very elegant, though) for simple JNDI usage.