JBoss & warbler: no such file to load - jboss

guys.
I'm using Rails 3.2.13, jruby-1.7.12, JBoss EAP 6.2 and warbler 1.4.3.dev(have tried 1.4.1 and 1.4.2 - it doesn't matter). And I got such error while entering first page of my application:
19:32:18,822 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/]] (ServerService Thread Pool -- 68) ERROR: initialization failed: org.jruby.rack.RackInitializationException: no such file to load -- /home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-69d213af89011d97/home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-95fa3e2c22b1402c/config/environment.rb
I got this error only when there are two different deployments in my JBoss:
Where ap_ROOT.war is my rails application and rp_app.war is my java application. In case when there is only rails application there are no errors.
As I found
/home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-69d213af89011d97
is the path to the rp_app.war(java application) deployment folder and
/home/alex/Projects/install_test/eap-6.2/jboss-eap-6.2/standalone/tmp/vfs/temp/temp37c8c04246e7d946/content-95fa3e2c22b1402c
is the path to the app_ROOT.war(rails application) deployment folder.
Someway it get messed up and JBoss can't find 'config/environment.rb'.
Thanks,
Alex.

Related

How to find missing classes in a webapp running in JBoss EAP 7.4?

My webapp running on JBoss EAP 7.4 is having problems locating certain classes. When I run, I see the following in the log:
2022-08-02 14:30:52,387 WARN [org.jboss.modules.define] (default
task-2) Failed to define class
org.apache.phoenix.schema.MetaDataSplitPolicy in Module
"deployment.dbp.rest-1.1.0-SNAPSHOT.war" from Service Module Loader:
java.lang.NoClassDefFoundError: Failed to link
org/apache/phoenix/schema/MetaDataSplitPolicy (Module
"deployment.dbp.rest-1.1.0-SNAPSHOT.war" from Service Module Loader):
Failed to link
org/apache/phoenix/schema/SplitOnLeadingVarCharColumnsPolicy (Module
"deployment.dbp.rest-1.1.0-SNAPSHOT.war" from Service Module Loader):
org/apache/phoenix/compat/hbase/CompatSteppingSplitPolicy
MetaDataSplitPolicy and SplitOnLeadingVarCharColumnsPolicy are present in our war file, but CompatSteppingSplitPolicy is not. The /usr/lib/phoenix/phoenix-hbase-compat-2.4.1-5.1.2.jar file contains CompatSteppingSplitPolicy. Adding external modules directories in JBoss EAP 6/7 tells how the classpath be extended to deployed content reference directories and files external to the installation. I modified my .bashrc accordingly, and the log file now includes:
module.path = /opt/jboss-eap-7.4/modules:/usr/lib/phoenix/phoenix-hbase-compat-2.4.1-5.1.2.jar:/usr/lib/phoenix/*
Unfortunately, I still get the same error. What can I do to fix it?
why not adding the jar in your war ? otherwise you need to add a dependency on that module in your war

Deploying sbt project in tomcat

I am facing an issue while deploying an sbt project which is build using maven in tomcat.
While starting the tomcat server I am getting HTTP 500 error
While checking the logs it says
IllegalArgument Exception: No actor system defined
Any help would be appreciated.

Liferay + jboss

I am trying start jboss and I have an error. I use jboss 7.1.1 and Liferay. What is wrong?
12:25:26,707 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBA
S015877: Stopped deployment ROOT.war in 235420ms
12:25:35,754 ERROR [stderr] (com.liferay.portal.kernel.deploy.auto.AutoDeploySca
nner) Exception in thread "com.liferay.portal.kernel.deploy.auto.AutoDeployScann
er" java.lang.NoClassDefFoundError: org/apache/tools/ant/types/resources/FailFas
t
12:25:35,785 ERROR [stderr] (com.liferay.portal.kernel.deploy.auto.AutoDeploySca
nner) at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.
iterator(BaseResourceCollectionContainer.java:142)
12:25:35,801 ERROR [stderr] (com.liferay.portal.kernel.deploy.auto.AutoDeploySca
nner) at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:135)
12:25:35,801 ERROR [stderr] (com.liferay.portal.kernel.deploy.auto.AutoDeploySca
nner) at com.liferay.util.ant.ExpandTask.expand(ExpandTask.java:33)
12:25:35,801 ERROR [stderr] (com.liferay.portal.kernel.deploy.auto.AutoDeploySca
nner) at com.liferay.portal.tools.deploy.BaseDeployer.deployFile(BaseDeployer.
java:955)
12:25:35,801 ERROR [stderr] (com.liferay.portal.kernel.deploy.auto.AutoDeploySca
nner) at com.liferay.portal.tools.deploy.BaseDeployer.deployFile(BaseDeployer.
java:889)
12:25:35,801 ERROR [stderr] (com.liferay.portal.kernel.deploy.auto.AutoDeploySca
nner) at com.liferay.portal.tools.deploy.BaseDeployer.autoDeploy(BaseDeployer.
java:198)
Step 1: To setup machine for Liferay development first of all you will need to download and install all required software as described below.
JAVA (JDK & JRE)
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Eclipse IDE
http://www.eclipse.org/downloads/
Liferay JBOSS bundle (Community Edition or Enterprise Edition as per your requirements and preferences), Liferay Tomcat bundle (For server run time selection), Liferay Plugin SDK (For Development of plugins like hooks, portlets, themes etc.
http://www.liferay.com/downloads/liferay-portal/available-releases
Apache Ant (For build and deployment of projects).
Step 2: Now set environment variables in your machine.
Set JAVA_HOME
Set JBOSS_HOME
Set LIFERAY_HOME
Set ANT_HOME
Step 3: Open Eclipse and install Liferay IDE.
Go to Help -> Eclipse Marketplace
Search for "Liferay".
Install Liferay IDE and restart eclipse.
Step 4: To configure Liferay Plugin-SDK
Go to Window -> Preferences -> Liferay
Add Liferay Plugin-SDK
Here you will option to update build.<username>.properties file. Select
prompt.
That's it your system is ready with development environment for Liferay.
Step 6: In Liferay Plugin-SDK folder there will be a file called
build.username.properties
Set path of server to refer JBOSS directory.
Step 7:Create new Liferay Plugin Project.
Inside that Create New Portlet Project.
Select Liferay Portal Runtime as Tomcat, because Eclipse doesn't provide
runtime for JBOSS Application server so use some tricky way to deal with it.
After clicking on finish it will ask for updating build.<username>.properties file.
Select "No" option.
Okay Now you are done with project creation and Setting deployment server
as JBOSS.
Step 8: Deploy Liferay Portlet Project.
Step 9: Run standalone.bat from bin directory of JBOSS
For more details follow this blog http://liferaywithjboss.blogspot.in/.
Let me know if you need more details for the same.
Check your jboss-deployment-structure.xml file in ROOT.war/WEB-INF/ location to see any of the dependency modules mentioned in there uses ant-*.jars. The issue could be due to multiple jars with the same classname in the classpath.
new liferay versions provide a wildfly bundle... this could be a starting point, neverthelesse ClassNotFound typically originates from missing jars in that special context, whether physically or suppressed by the jboss modul-system ( starting is here the deployment-structure file, or even worse the module directory of your installation)
but in the end a guy like me decides often to get a new working environment before diving into that voluntarily...

Error deploying application to Glassfish 3

When I try to deploy my application named shopping-1 to Glassfish 3 I get the following error:
'Publishing to GlassFish Server Open Source Edition 3 (Java EE 6)2 at localhost...'has encountered a problen.
cannot Deploy shopping-1
Deployment Error for module: shopping-1: Exception while loading the app :
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
org.apache.catalina.LifecycleException:
java.lang.ClassNotFoundException:
org.springframework.web.servlet.DispatcherServlet
How do I track down and fix this issue?
apparently the shopping-1.war file doesn't include the archive containing the DispatcherServlet class.
unzip -l shopping-1.war | grep spring (on Linux) will give you the list of all spring-related included jar files
First run appserver admin-list applications
Check if there are any deployed applications on the server.
Undeploy by running them if there are.
Stop the application server.
Open the location folder where you have the war file for deployment
Check that there is only one war file at a time in it.
7.Start the application server
Deploy the war.
Should work fine.

weblogic 11g R1

I have prepared my ejb jars and war using weblogic.appc
weblogic 11g R1, all compilations were fine, I have prepared ear and deployed in weblogi server .I am getting belows erorr. afte deployment and ear status went to failed state.
I am not att all using this oracle.help.OHW file. don't know it is refered
Can any suggest how comeout of this problem.
[HTTP:101216]Servlet: "OHW" failed to preload on startup in Web application: "cbcm". javax.servlet.ServletException: [HTTP:101249][ServletContext#13514259[app:cbcm module:cbcm path:/cbcm spec-version:null]]: Servlet class oracle.help.OHW for servlet OHW could not be loaded because the requested class was not found in the classpath . java.lang.ClassNotFoundException: oracle.help.OHW. at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:551) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985) at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200) at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27) at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205) at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161) at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:140) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Check your web.xml within your WAR, there is a servlet and servlet-mapping for the Oracle help files and this servlet most likely.
Comment out those.
I received the same error as "failed to preload on startup in Web application:".
Below is how I am able to resolve the error.
in your web.xml, check if following property is present
<load-on-startup>0</load-on-startup>
this property is to load your bundled artifacts during the server restart itself. This was the cause of the issue because there were some jar file which weblogic server required to load before the loading of our bundled artifacts. Now since server is not yet started completely and all the libraries required to our application is not yet loaded, hence server is throwing "failed to preload on startup in Web application:".
The solution to this is remove load-on-startup from web.xml and That's it!!