Liferay + jboss - 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...

Related

WFLYSRV0177: Error getting reflective information for class

I am developing a JEE project using Eclipse JEE (2019-09), Maven, Wildfly 17, JSF, PrimeFaces 7.0 running on Ubuntu 18.04.
My project used to compile, deploy and run on the WildFly 17 server until today. However, because I recieved strange errors when debugging, I installed an earlier Eclipse IDE to try to run my project on it.
After installing the older version of Eclipse (2019-03) in its own dedicated workspace, I got this error message when deploying my application to WildFly:
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class
I then switched back to my initial Eclipse JEE (2019-09) Version, but then I kept recieving the same error message upon deploying.
I' ve searched the internet and found these two similar problems:
Error getting reflective information for class
Wildfly: Error getting reflective information for class
but actually not a solution to my problem.
Could somebody please help?
The problem was that the Maven jar- dependencies were not added to the WEB-INF/lib path.
Actually, in the deployed .war file the folder WEB-INF/lib was completely missing.
I fixed the problem by right-mouse click on my project in Eclipse, then "Properties", then "Deployment Assembly".
I added the missing entry "Maven Dependencies" as follows:
1.) BEFORE MY FIX:
2.) AFTER MY FIX:

Fail to start MobileFirst development server

I have the following environment:
Windows 7 64-bit OS;
Eclipse Kepler SR2 32-bit + JDK 1.7 32-bit;
MobileFirst Platform Studio 6.3 20150106-1717
When I opened my eclipse I clicked on the green play button to start the development server, I got the following errors; or if I create a simple project and attempt to deploy it on the dev server, same errors come out; or if I delete the server and create a new one and then try to start it; or if I install 64-bit eclipse with 64-bit Java 7:
com.ibm.ws.kernel.boot.LaunchException: Caught unexpected exception java.lang.IllegalArgumentException: URI has an authority component
at com.ibm.ws.kernel.boot.internal.KernelBootstrap.rethrowException(KernelBootstrap.java:418)
at com.ibm.ws.kernel.boot.internal.KernelBootstrap.go(KernelBootstrap.java:183)
at com.ibm.ws.kernel.boot.Launcher.createPlatform(Launcher.java:131)
at com.ibm.ws.kernel.boot.Launcher.main(Launcher.java:55)
at com.ibm.ws.kernel.boot.cmdline.EnvCheck.main(EnvCheck.java:52)
Caused by: java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(Unknown Source)
at com.ibm.ws.kernel.boot.cmdline.Utils.getInstallDir(Utils.java:38)
at com.ibm.ws.kernel.productinfo.ProductInfo.getAllProductInfo(ProductInfo.java:53)
at com.ibm.ws.kernel.boot.internal.KernelBootstrap.getProductInfoDisplayName(KernelBootstrap.java:395)
at com.ibm.ws.kernel.boot.internal.KernelBootstrap.go(KernelBootstrap.java:119)
... 3 more
Listening for transport dt_socket at address: 10777
CWWKE0005E: The runtime environment could not be launched.
CWWKE0018E: An exception occurred while launching the runtime environment: java.lang.IllegalArgumentException: URI has an authority component
I tried everything but no luck, so please diagnose this issue, thanks.
This is unrelated to MobileFirst Platform, and may be instead related to the problem described in the following IBM tech note: http://www-01.ibm.com/support/docview.wss?uid=swg21584343
It is unclear from the question and comments if the workspace is in a different network drive than the Eclipse folder. If yes, consider placing both in the the same "physical location".
I did realize my system location was out of sync thus I did open the jvm.options file and copy pasted the below configuration
-Dibm.worklight.admin.db.type=DERBY
-Dfile.encoding=UTF-8
-Duser.language=en
-Duser.country=US
-Djava.awt.headless=true
-Dwas.debug.mode=true
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=10777
-Dcom.ibm.websphere.ras.inject.at.transform=true
-Dcom.ibm.ws.jmx.connector.client.rest.readTimeout=180000
-Dibm.worklight.admin.db.type=DERBY
-Xmx1024m
-Dos.name=Windows
-DwlSyncStart=false
-Dibm.worklight.rhino.debug=transport=socket,address=9000
Which worked in my case , all the best.

java.lang.ClassNotFoundException for a class in external JAR

I have a maven project in Eclipse Java EE IDE for Web Developers.
When running Tomcat, I'm getting an error for a class that I can see that I have included.
My question is - do I have to add these JARs to an additional place because of Tomcat Apache?
Error:
SEVERE: Servlet /Resource threw load() exception
java.lang.ClassNotFoundException: org.odata4j.jersey.producer.resources.ODataApplication
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:171)
at com.sun.jersey.core.reflection.ReflectionHelper.classForNameWithException(ReflectionHelper.java:240)
at com.sun.jersey.core.reflection.ReflectionHelper.classForNameWithException(ReflectionHelper.java:220)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:711)
And here is the class in my Library:
UPDATE:
My Web Deployment Assembly looks like:
The issue you are seeing is due to the fact that tomcat is looking at the wrong directory. It is currently most likely pointed at your src/main/webapp directory of your project. This does not jive with how maven works. Maven downloads the dependencies, but will only include them in the target build. You need to have the tomcat server look at target/myapp-0.0.1, or build to a war and deploy that way. The easiest solution as of now, would be for you to use the tomcat plugin. After setting it up, you can use an imbedded server, and just use the following command 'mvn tomcat:run'.
Maven Tomcat Plugin Docs
UPDATE:
I looked at the properties settings, and you should actually be able to edit the "Web Deployment Assembly" settings for your project (under project properties). Check screenshot for how I have mine setup. Notice how Maven Dependencies is mapped.
http://imgur.com/ofxryns

RAD / WebSphere: NoClassDefFoundError

When I deploy my application to the integrated WebSphere server, I get NoClassDefFoundErrors for two classes that are contained in the same project.
Note: I call the missing class com.my.package.MyClass here.
The consuming project contains Session Beans and imports the exporting project in "Configure Build path". The exporting project is listed as "EAR library" if the consuming project in the Enterprise Explorer.
The exporting project is a normal java project that contains com.my.package.MyClass. It exports its source folders.
The exceptions look like that:
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is com.ibm.ejs.container.ContainerEJBException: Unable to initialize deferred EJB.; nested exception is: java.lang.NoClassDefFoundError: com.my.package.MyClass]
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:1033)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:175)
at com.ibm.ws.naming.urlbase.UrlContextImpl.processBoundObjectForLookup(UrlContextImpl.java:1736)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1249)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1225)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1276)
at javax.naming.InitialContext.lookup(Unknown Source)
...
or like that
[22.03.13 14:56:12:994 CET] 00000025 EJBContainerI E WSVR0068E: Attempt to start EnterpriseBean MyEar#MyJar.jar#MyBean failed with exception: java.lang.NoClassDefFoundError: com.my.package.MyClass
at java.lang.Class.getDeclaredMethodsImpl(Native Method)
at java.lang.Class.getDeclaredMethods(Class.java:673)
at com.ibm.ws.metadata.ejb.EJBMDOrchestrator.processTimeoutMetaData(EJBMDOrchestrator.java:6494)
at com.ibm.ws.metadata.ejb.EJBMDOrchestrator.finishBMDInit(EJBMDOrchestrator.java:1488)
at com.ibm.ws.runtime.component.EJBContainerImpl.finishDeferredBeanMetaData(EJBContainerImpl.java:5036)
at com.ibm.ws.runtime.component.EJBContainerImpl.initializeDeferredEJB(EJBContainerImpl.java:4845)
at com.ibm.ejs.container.HomeOfHomes$1.run(HomeOfHomes.java:406)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ejs.container.HomeOfHomes.getHome(HomeOfHomes.java:403)
at com.ibm.ejs.container.HomeOfHomes.getHome(HomeOfHomes.java:339)
at com.ibm.ejs.container.util.EJBLocalInterfaceObjectFactory.getObjectInstance(EJBLocalInterfaceObjectFactory.java:139)
at javax.naming.spi.NamingManager.getObjectInstanceByFactoryInReference(Unknown Source)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:927)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:175)
at com.ibm.ws.naming.urlbase.UrlContextImpl.processBoundObjectForLookup(UrlContextImpl.java:1736)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1249)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1225)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1276)
at javax.naming.InitialContext.lookup(Unknown Source)
...
I'm using IBM Rational Application Developer for WebSphere in Version 8.0.4
and IBM WebSphere Application Server in Version 7.0.0.11
My workspace has no errors in the Problems view.
What I already tried:
- Starting RAD with the -clean parameter
- Refreshing all projects in the Enterprise Explorer
- Project > Clean
- In the Server view: stopping, restarted, cleaning, publishing
- Closing and restarting RAD
First I had a second problem: in RAD I wasn't able to find com.my.package.MyClass by Ctrl + Shift + T.
I solved it by deleting files (*.index files and the "savedIndexNames.txt") in
/.metadata/.plugins/org.eclipse.jdt.core.
But unfortunately that didn't solve the problem at runtime / deploy time. :-(
Can somebody give me hints?
Thanks in advance!
what you need to do is add the Java Project as a Deployment Assembly for the EAR project.
This will than automatically add the $PROJECT.jar from your Java Project under /lib/ folder for thie .ear
WebSphere automatically pics .jar files from lib folder and add them to the classpath and these .jar can be found by all EJB.jar and .war packaged inside the .ear file.
So, right click your EAR project, go to properties, and than selec "Deployment Assembly" than add your Java Project there, you should than see the generated jar under lib folder.

jboss 5.1 cannot startup after deployment migrate from 4.0.3sp1

I am trying to migrate deployment from 4.0.3sp1 to 5.1. I just copied the file under /opt/jboss/server to jboss 5.1 directory.
At first, it prompt failed to access server/conf/bootstrap.xml, etc, I copied them from /opt/jboss/server/default/conf/*.xml, then it come to the error:
14:27:19,785 ERROR [ScopedProfileServiceController] Error installing to Create: name=ProfileKey#92eb76[domain=default, server=default, name=bindings] state=Configured mode=On Demand requiredState=Installed
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
Caused by: java.io.IOException: Child not found bindingservice.beans/ for FileHandler#15606014[path= context=file:/opt/jboss-5.1.0.GA/server/...
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed:
*** PROFILES IN ERROR: Name -> Error
Profile: ProfileKey#92eb76[domain=default, server=default, name=bindings] in error due to java.lang.reflect.InvocationTargetException
is there any difference on configuration files between 4.0.3sp1 and 5.1? anything I need to add in jboss 5.1 server//conf?
I don't know if I undarstand you correctly but you cannot just copy profile between JBoss version. Between version 4.0.3 and 5.1 was a lot of changes and I really doubt if something like that can work (for example theres is a lot of different services, configuration changes, completely different kernel and so one).
Since JBoss 5 there is new way for setting port bindings and I believe that JBoss cannot find these configuration file.
If you want migrate to knew version of JBoss you should use for some JBoss 5.1 profile: default or all and in that profile install your application, data sources and other things.
This issue is because of missing myserver/conf/bindingservice.beans, i copied this folder from jboss 5.1 server/default/conf/bindingservice.beans, now this issue is gone.