Deploying JSF Application with Virtual host in TomcatServer - jsf

I am using Mojarra 2.0.4 implementation of JSF with Tomcat server for one of my application, now i came to a problem during its deployment. I had added a virtual host to the Tomcat server.xml as follows,
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"/>
<Host name="www.edgeutil308.com" appBase="webapps/EdgeUtil"
unpackWARs="true" autoDeploy="true">
<Alias>edgeutil308.com</Alias>
<Context path="" docBase="."/>
</Host>
The problem which i am facing is that my mojarra implementation initializes twice as like below\
INFO: Initializing Mojarra 2.0.4 (FCS b06) for context ''
INFO: Initializing Mojarra 2.0.4 (FCS b06) for context '/EdgeUtil'
and also i couldnot get the application run without using the project name as its context path like this
www.edgeutil308.com/EdgeUtil
Please help me to solve this issue.

Looks like some mismatch with your appBase definitions. The appbase for the edgeutil308 host is inside the appbase for the localhost host.

Related

Error messages when deploying a web application in Weblogic 12.1.3

We are trying to deploy our application's .war file in Weblogic 12.1.3 but we get the following error messages:
Task 156 initiated: [Deployer:149026]deploy application sarp on sarp.
Task 156 failed: [Deployer:149026]deploy application sarp on sarp.
Target state: deploy failed on Server sarp
java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
at weblogic.application.utils.annotation.ClassInfoImpl.<init>(ClassInfoImpl.java:41)
at weblogic.application.utils.annotation.ClassfinderClassInfos.polulateOneClassInfo(ClassfinderClassInfos.java:240)
at weblogic.application.utils.annotation.ClassfinderClassInfos.populateClassInfos(ClassfinderClassInfos.java:193)
at weblogic.application.utils.annotation.ClassfinderClassInfos.<init>(ClassfinderClassInfos.java:44)
at weblogic.servlet.internal.War.initializeClassInfosIfNecessary(War.java:446)
at weblogic.servlet.internal.War.getAnnotatedClasses(War.java:376)
at weblogic.servlet.internal.WebBaseModuleExtensionContext.getAnnotatedClasses(WebBaseModuleExtensionContext.java:63)
at weblogic.j2ee.managedbean.ManagedBeanModuleExtensionFactory.create(ManagedBeanModuleExtensionFactory.java:65)
at weblogic.application.internal.ExtensibleModuleWrapper.createModuleExtensions(ExtensibleModuleWrapper.java:264)
at weblogic.application.internal.ExtensibleModuleWrapper.initDrivenObjectArray(ExtensibleModuleWrapper.java:232)
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:107)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:175)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:170)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:80)
at weblogic.work.ContextWrap.run(ContextWrap.java:40)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
Why are we getting this error? Any Suggestions?
Regards.
This error is because the version of JDK from your WLS is lower than bytecode is being deployed in your war file.
please check JDK of your WebLogic and your war file.
Weblogic 12.1.3 can use 7 or 8.
EDIT1: log4j2 is an example that has bundled bytecode of Java9 that, when is deployed in WebLogic 12.1.3 an exception is thrown (com.bea.objectweb.asm.ClassReader.<init>). The newest version (without modification) that can be deployed directly in WLS 12.1.3 is log4j 2.8.2.

Tomcat stops because of too many requests...Configuration seems not to be applied

when sending mass notification to my mobile app users my tomcat instance just freezes or stops! After looking into the logs I find some interesting information:
Exception in thread "http-nio-8080-ClientPoller" java.lang.OutOfMemoryError: unable to create new native thread
and
WARNUNG [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector}
Setting property 'maxConnection' to '20000' did not find a matching proper
My Tomcat Configuration (server.xml)
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
maxThreads="10000"
maxConnection="20000"
acceptCount="10000"
redirectPort="8443" />
It seems that my configuration was not applied...did I forget something?
My Server specifications:
- Virtual Linux server (Ubuntu 18)
- 60 GB RAM
- 1,500 GB SSD
- 16 vCores

Cannot deploy weblogic server application that contains log4j 2.9.x

I am not able to start application it gives below exception :
Java.lang.IllegalArgumentException
At com.bea.objectweb.asm.ClassReader.(Unknownsource)com.bea.objectweb.asm.ClassReader.(Unknown source)
Application got started after replacing below jars
Log4j-1.2-api-2.9.1.jar
Log4j-api-2.9.1.jar
Log4j-core-2.9.1.jar
Log4j-slf4j-impl-2.10.0.jar
With
Log4j-1.2-api-2.8.2.jar
Log4j-api-2.8.2jar
Log4j-core-2.8.2.jar
Log4j-slf4j-impl-2.8.2.jar
Since version 2.9.0 there are classes compiled in java 9.
One workaround is to remove them from log4j-api-2.x.y.jar

Tomcat server is not starting

I am using jdbc in form based authentication but when i add realm tag with connection properties in server.xml file, tomcat is not starting:
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:#localhost:1521:XE"
connectionName="system"
connectionPassword="system"
userTable="users" userNameCol="username" userCredCol="password"
userRoleTable="user_roles" roleNameCol="rolename"/>

Could not find backup for factory javax.faces.context.FacesContextFactory Weblogic

I'm using JSF2.1 Mojarra on Weblogic 12c with Servlet 3.0. jsf-api and jsf-impl are NOT in /WEB-INF/lib after build/deploy. I've tried checking for classpath pollution, but don't see anything. This is the error:
java.lang.IllegalStateException: Could not find backup for factory
javax.faces.context.FacesContextFactory.
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction
.run(StubSecurityHelper.java:337)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction
.run(StubSecurityHelper.java:288)
Truncated. see log file for complete stacktrace
Here's what I found in my classpath that relates to JSF:
com.oracle.adf.library:JSF:pom:12.1.2-0-0
com.sun.faces:jsf-api:jar:2.1.7-01
com.sun.faces:jsf-impl:jar:2.1.7-01
Here's everything in my classpath:
com.bea.core.antlr:runtime:jar:1.0.0.0_3-2
com.oracle.adf.library:Contexts-and-Dependency-Injection:pom:12.1.2-0-0
com.oracle.adf.library:Java-EE:pom:12.1.2-0-0
com.oracle.adf.library:JSF:pom:12.1.2-0-0
com.oracle.adf.library:JSP-Runtime:pom:12.1.2-0-0
com.oracle.adf.library:JSTL:pom:12.1.2-0-0
com.oracle.adf.library:TopLink:pom:12.1.2-0-0
com.oracle.adf:eclipselink:jar:12.1.2-0-0
com.sun.faces:jsf-api:jar:2.1.7-01
com.sun.faces:jsf-impl:jar:2.1.7-01
com.sun.mail:javax.mail:jar:1.4.4
glassfish:el:jar:1.1.0.0_2-2
glassfish:jstl:jar:1.2.2.0
javax.enterprise:deploy:jar:1.3
javax.enterprise:inject:jar:1.1
javax.management:j2ee:jar:1.1.0.0
javax.security:jacc:jar:1.1.0.0_1-1
javax.servlet:jstl:jar:1.2
javax.servlet:servlet-api:jar:2.5
javax.xml:registry:jar:1.1.0.0_1-0-4
javax.xml:rpc:jar:1.2.3
javax.xml:stream:jar:1.1.1.0
javax.xml:ws:jar:2.3.0
javax:ejb:jar:3.2.0
javax:inject:jar:1.1
javax:interceptor:jar:1.2
javax:jms:jar:1.1.3
javax:jsp:jar:3.0.0.0_2-2
javax:resource:jar:1.6.1
javax:servlet:jar:2.1.0.0_3-0
javax:transaction:jar:2.1.0.0_1-1
javax:validation:jar:1.1.0
junit:junit:jar:4.4:test
log4j:log4j:jar:1.2.16
org.eclipse.persistence:javax.persistence:jar:2.0.5-SNAPSHOT
org.eclipse.persistence:nosql:jar:2.4.2.v20130514-5956486
org.eclipse.persistence:org.eclipse.persistence.oracle.nosql:jar:2.4.2-SNAPSHOT
org.glassfish:javax.annotation:jar:3.0.1
I found the issue. In WEB-INF/faces-config.xml, I had a navigation-handler that was pointing to a class that didn't exist. Correcting this resolved the issue.

Resources