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

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.

Related

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

Difference JNDI configuration between Glassfish and TomEE?

We want to migrate an old application from Glassfish to TomEE. We encounter a problem about JNDI.
When I run the cmd for Glassfish server asadmin list-jndi-entries I get some JNDI entries:
java:global: com.sun.enterprise.naming.impl.TransientContext
UserTransaction: com.sun.enterprise.transaction.TransactionNamingProxy$UserTransactionProxy
com: com.sun.enterprise.naming.impl.TransientContext
OURAPPSERVER-Q2: com.ourcompany.product.OurAppServer
com.sun.enterprise.container.common.spi.util.InjectionManager: com.sun.enterprise.container.common.impl.util.InjectionManagerImpl
ejb: com.sun.enterprise.naming.impl.TransientContext
jdbc: com.sun.enterprise.naming.impl.TransientContext
AppServer: com.sun.enterprise.naming.impl.TransientContext
As you can see, there is AppServer JNDI entry. This entry is bind from our code manually.
try {
InitialContext context = new InitialContext();
context.rebind("AppServer/facede", this);
} catch (NamingException e) {
e.printStackTrace();
logger.severe("Unable to register the service facade bean, "
+ "JPOS will not be able to access services");
}
This code is not working in TomEE. I get some error like:
javax.naming.NameNotFoundException: Name [AppServer/facede] is not bound in this Context. Unable to find [AppServer].
at org.apache.naming.NamingContext.bind(NamingContext.java:899)
at org.apache.naming.NamingContext.rebind(NamingContext.java:225)
It seems like the container can't found context base on AppServer.
I am not a master of JNDI. Then I have checked some documents. The java:comp/env/ is the basic namespace. And "jdbc" for DBCTM DataSource references, "jms" for JMS connection factories, "mail" for JavaMail connection factories, "url" for URL connection factories.
We don't want to change too much on our old application code. It's not use any special features of Glassfish. I want to know how to define a JNDI in a correct way.
Is there anyone could tell me why Glassfish can use AppServer as namespace, but TomEE can't.
Tomcat (then TomEE) is not designed to change JNDI at runtime like it. Saying it simply the best is to not use this pattern but a contextual resource. Inject the resource you desire and that's this resource you change instead of JNDI (which is quite more impacting that it seems)

Hornetq with apache naming JNDI

I tried to put Apache JNDI for Hornetq according to these blog : http://wash-inside-out.blogspot.com/2010/08/hornetq-jms-integration-with-tomcat.html. but I'm getting this error now :
Deployment "Naming" is in error due to: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.naming.java.javaURLContextFactory ]
How to find out which jar file has that class?
According to this search result in FindJar, naming-factory-5.5.23.jar is the one that contains that class. Beware that the dependency scope is test in the example you provided. Are you doing the lookup in non test code?

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.

OSB WLS Initialisation issue

facing some strange behavior in OSB, i have configured WLS with MQ in client mode, i am doing some minor test to check the connection, i have created a proxy service to read the message from Q1 and a Business Service(BS) to route it to Q2. The issue is the proxy is able to read the message but the BS is throwing this:
JMSPool BEA-169807 There was an error while making the initial connection to the JMS resource named ALSB_JMS_SessionPool_491704821 from within an EJB or a servlet. The server will attempt the connection again later. The error was javax.jms.JMSException: [JMSPool:169803]JNDI lookup of the JMS connection factory AKBConnFact failed: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory
Note: The classpath or the domain/lib folder contains the RefFSContextFactory class
Any ideas gang..? TIA
The answer is this is a bug in OSB which needs to be reported.
As a workaround you need to individually set the jars in the weblogic classpath in your domain/server/bin folder. just go through the link below for more details:
http://forums.oracle.com/forums/thread.jspa?threadID=2135523&start=0&tstart=0