I am learning "how to create portal application", went through some documents and tutorials. I found we need one application server, one portal container and one IDE.
please help me to understand it.
I want to create a portlet and deploy it on weblogic server. so what the things i required.
means: any plugin in eclipse
portlet container
application server
etc.....
Thanks
I've just got the pluto portlet container up and running. The tutorials for pluto are a bit sketchy and most contain errors that can throw you off course. As such, I've made this as thorough as I can.
I've since managed to get pluto running under WebLogic, albeit not perfectly (discussed later). So, I think your aims are:
Install a portlet container: e.g. pluto
Create a HelloWorld portlet, deploy it and publish it
Perhaps, deploy the portlet so that it runs under WebLogic? Not sure if this is what you intend.
Portlet communication
Build more heavyweight portlets that do what you want
Upgrade portal implementation (e.g. JetSpeed)
So, here goes:
1. Install a portlet container: e.g. pluto
I recommend you start with the pluto portlet as this is the reference implementation and adheres to version 2 of the spec (JSR-286). Download the binary distribution from:
http://portals.apache.org/pluto/v20/getting-started.html
This comes housed within a tomcat 6 webserver. So, to run a basic portlet, you just need to configure and start tomcat. The pluto web application can be found in the webapps directory.
To understand more about tomcat, see here:
http://www.puschitz.com/InstallingTomcat.html#InstallingTomcatSoftware
Note that this is slightly complicated (for good reason) as it recommends creating separate instances of tomcat. This tutorial really only takes an hour though so I'd recommend it in advance of your portlet work so that you have a good foundation.
In simple terms though, to start up pluto (well, tomcat), you just need to set your ${CATALINA_HOME} to be your tomcat installation directoy (pluto-2.0.2) and execute {pluto_install_dir}/bin/startup.sh. You can access the pluto portal from a browser with:
http://localhost:8080/pluto/portal
2. Create a HelloWorld portlet, deploy it and publish it
Happily, the pluto tutorial is nearly good enough to get you going. Unbelievably, all the tutorials I found had flaws or errors. With a little help, you should get this going though. It is at the same place:
http://portals.apache.org/pluto/v20/deploying.html
The directory structure shown under "Portlet Assembly" is slightly wrong. The webapp folder should be at the same level as the java folder, under main.
Here is a sample HelloWorld portlet that presents using direct output in the response (like a servlet):
package com.mycompany.portlet;
//imports omitted...
public class HelloWorldPortlet extends GenericPortlet{
protected void doView(RenderRequest request,RenderResponse response)
throws PortletException, IOException {
response.setContentType("text/html");
response.getWriter().println("Hello World");
}
}
Here's an example WEB-INF/portlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>HelloWorld Description</description>
<portlet-name>HelloWorldPortlet</portlet-name>
<display-name>Hello World Display Name</display-name>
<portlet-class>com.mycompany.portlet.HelloWorldPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Hello World</title>
<short-title>Hello World</short-title>
<keywords>Hello,pluto</keywords>
</portlet-info>
</portlet>
</portlet-app>
Here's an example WEB-INF/web.xml:
<web-app id="WebApp_ID">
<display-name>Hello World Portlet</display-name>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>tld/portlet.tld</taglib-location>
</taglib>
</web-app>
Put portlet.tld (the prtlet 2.0 version) in your tld directory. Note we aren't using JSPs so this will be empty. For a good (but broken) JSP based tutorial, see here:
http://www.ibm.com/developerworks/java/library/j-pluto/
Build using the mvn build script supplied in:
http://portals.apache.org/pluto/v20/deploying.html
If you don't add the automatic deployment section of the build script the move the build war to your pluto (tomcat) webapps.
Within your browser, you must publish your new HelloWorld webapp from the admin page within the pluto portal (add page -> add portlet). A new tab should be added containing your portlet.
3. Deploy the portlet under WebLogic
Add the pluto libraries to your WebLogic lib. I put these in your domain library directory (which contains a readme indicating this is for adding jars to be dynamically loaded on 10.2.3). This is ${MYDOMAIN}/lib. The jars to locate there are as follows:
http://portals.apache.org/pluto/v20/embedding.html
Add the pluto web application and any referenced (published) webapps into your WLS upload directory. This means including testsuite which is provided with pluto and your new helloworld webapp.
Configure WLS to be able to access your portlets:
The pluto webapps are security configured for users pluto and tomcat. So, you have to add a new "pluto" user to your WLS security realm [Security Realms -> myRealm]
Configure webapp security to map the security role to the WLS user. This means creating ${MYUPLOAD}/pluto/WEB-INF/weblogic.xml. Here add a "security-role-assignment" entry for principal pluto (your new WebLogic user).
Note that the testsuite/WEB-INF/web.xml is only authorised for user tomcat. Change this to pluto.
Add portlet_2_0.tld to ${UPLOAD}/testsuite/WEB-INF/tld (make tld dir). This is available at: http://svn.apache.org/repos/asf/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/tld/portlet_2_0.tld
Several of the testsuites will still fail under WLS. There are outstanding issues between apache and the community. They see it as a WLS issue (on the apache pluto jira at https://issues.apache.org/jira/browse/PLUTO-571).
There is an issue where by the portlet is actually presented outside the portlet frame (div) when using JSP rendering. Not got to the bottom of this yet.
4. Portlet Communication
Have two portlets interoperating. Refer to:
http://publib.boulder.ibm.com/infocenter/wpexpdoc/v6r1/index.jsp?topic=/com.ibm.wp.exp.doc_v6101/dev/pltcom_pubrndrprm.html
5. Build more heavyweight portlets
Refer to more complex webapp tutorial using JSPs at:
http://www.ibm.com/developerworks/java/library/j-pluto/
//Warning: portlet 1.0 (JSR-168) and contains errors
Then try your own...
6. Upgrade portal implementation
Try out JetSpeed for example. Refer to:
http://portals.apache.org/jetspeed-2/
Related
I've ported an application from JEE6 to JEE7 (glassfish 3.1.2.2 to 4.1),
I've upgraded the META-INF/validation.xml with latest version (as stated here): http://antoniogoncalves.org/2013/06/04/java-ee-7-deployment-descriptors/):
<validation-config
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"
version="1.1">
<message-interpolator>com.infomaxgroup.adaecommerce.validation.DatabaseMessageInterpolator</message-interpolator>
</validation-config>
The custom messageinterpolator is never called, so I've tried to set a name of a non existent class:
<message-interpolator>foo.foo.foo.Bar</message-interpolator>
and tried to insert an error (xxx after the opening tag):
<message-interpolatorxxx>foo.foo.foo.Bar</message-interpolator>
I've no exception into log, seems like that validation.xml (that my JEE6 application processes good) is not loaded at all into my ported JEE7 application...
Any idea on how to solve the issue ?
Many thanks in advance...
Solved from myself,
the problem was that validation.xml must be placed into META-INF/validation.xml folder of the "ejb module", into my JEE6 application I had that file into WEB-INF folder of the "web module" (strangely the JEE6 application works good...), now my JEE7 application correctly load validation.xml configuration and works using the message interpolator, very good !
We are integrating an internal framework into our weblogic application and we are running into deployment problems.
Technologies Used
Weblogic 10.3.6 application
Spring 3.0
Maven 2
Eclipse J2EE
The Problem
On startup of the weblogic application, we receive the following NoSuchMethodError while initializing one of the beans. This error is occuring when calling classes in the org.joda.time (2.0) jar.
Caused By: java.lang.NoSuchMethodError: org.joda.time.DateTimeZone.convertLocalToUTC(JZ)J
at org.joda.time.LocalDate.toDateTimeAtStartOfDay(LocalDate.java:715)
at org.joda.time.LocalDate.toDateTimeAtStartOfDay(LocalDate.java:690)
. . . excluded . . .
Things We Have Tried
After Googling "NoSuchMethodError spring", many of the problems seem to be incompatible Spring versions. After printing the dependency tree, the only Spring version in use is 3.0.
Googling "NoSuchMethodError" usually gave JAR hell solutions.
Multiple versions of the same dependency. After doing some maven dependency management, the only joda-time jar in use is 2.0. Additionally, the local repository was purged of any unnecessary jars.
.war / runtime may not have the correct jars included in the lib directory. After looking into the WEB_INF/lib directory, the only joda-time jar is version 2.0, which contains all of the appropriate class files
One mysterious thing is that the DateTimeZone.convertLocalToUTC(JZ)J has been a part of the org.joda.time project since 1.0, so even if we have incompatible versions, the method should still be found, especially if the class and package are able to be found.
Finally there are no other DateTimeZone classes in the project (ctrl+shift+T search in eclipse) so I'm confused as to which class is being loaded if the org.joda.DateTimeZone class is not being loaded.
Questions:
Can anyone explain why the method could not be found?
Are there more places to check for existing or conflicting jars?
Is there a way to check the DateTimeZone class that the LocalDate class is using during runtime via Eclipse debug?
Here's some interesting reading:
prefer-web-inf-classes Element
The weblogic.xml Web application deployment descriptor contains a
element (a sub-element of the
element). By default, this element is set to
False. Setting this element to True subverts the classloader
delegation model so that class definitions from the Web application
are loaded in preference to class definitions in higher-level
classloaders. This allows a Web application to use its own version of
a third-party class, which might also be part of WebLogic Server. See
“weblogic.xml Deployment Descriptor Elements.”
taken from: http://docs.oracle.com/cd/E15051_01/wls/docs103/programming/classloading.html
Other troubleshooting tips:
You can try: -verbose:class and check your managed server's logs to check if the class is being loaded properly.
An efficient way to confirm which intrusive jar might be getting loaded is by running a whereis.jsp within the same webcontext (i.e., JVM instance) of this app.
--whereis.jsp --
<%# page import="java.security.*" %>
<%# page import="java.net.URL" %>
<%
Class cls = org.joda.time.DateTimeZone.class;
ProtectionDomain pDomain = cls.getProtectionDomain();
CodeSource cSource = pDomain.getCodeSource();
URL loc = cSource.getLocation();
out.println(loc);
// it should print something like "c:/jars/MyJar.jar"
%>
You can also try jarscan on your $WEBLOGIC_HOME folder to see if you can find the jar that contains this class: https://java.net/projects/jarscan/pages/Tutorial
A NoSuchMethodError is almost always due to conflicting library versions. In this case I'm guessing there are multiple versions of joda libraries in the two projects.
Weblogic is pulling the org.joda jar.
Tryu adding this in your weblogic.xml to exclude the jar that weblogic is pulling, and instead use your appllication jar.
The below is from my application, you can have a look what all we have to removed for our application.
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>antlr.*</wls:package-name>
<wls:package-name>org.slf4j.*</wls:package-name>
<wls:package-name>org.slf4j.helpers.*</wls:package-name>
<wls:package-name>org.slf4j.impl.*</wls:package-name>
<wls:package-name>org.slf4j.spi.*</wls:package-name>
<wls:package-name>org.hibernate.*</wls:package-name>
<wls:package-name>org.springframework.*</wls:package-name>
<wls:package-name>javax.persistence.*</wls:package-name>
<wls:package-name>org.apache.commons.*</wls:package-name>
<wls:package-name>org.apache.xmlbeans.*</wls:package-name>
<wls:package-name>javassist.*</wls:package-name>
<wls:package-name>org.joda.*</wls:package-name>
<wls:package-name>javax.xml.bind.*</wls:package-name>
<wls:package-name>com.sun.xml.bind.*</wls:package-name>
<wls:package-name>org.eclipse.persistence.*</wls:package-name>
</wls:prefer-application-packages>
<wls:show-archived-real-path-enabled>true</wls:show-archived-real-path-enabled>
</wls:container-descriptor>
I am trying to deploy an oracle-adf application to Tomcat 7. I have done a lot of things but at the end, I got the exception below. Any suggestions ? [Using jdev studio, version 11.1.2.4; succeeded in running the application without Model part(without DB Interactions) ]
java.lang.ClassCastException: oracle.adfinternal.controller.faces.context.StubJSFPageLifecycleContext cannot be cast to oracle.adf.controller.faces.context.FacesPageLifecycleContext
oracle.adfinternal.controller.application.model.UpdateBindingListener.beforePhase(UpdateBindingListener.java:66)
oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.beforePhase(ADFLifecycleImpl.java:550)
oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchBeforeEvent(LifecycleImpl.java:100)
oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:191)
oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$200(ADFPhaseListener.java:23)
oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:232)
oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:274)
oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:75)
oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)
oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:447)
oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Although yilmazbahadirs answer works - it is no real solution. So I searched further and found the following Blog: byte bohemian
The result is essentially - you have to load your shared ADF-Libraries by the shared-classloader and not just put them into the tomcat/lib folder like the old Oracle Blog-Posts say. I have now finally up and running ADF on a Tomcat8 - but also tested on 6 and 7 with the following procedure:
Create a new Folder in your tomcat directory (CATALINA_BASE) called shared-lib. Edit the file config/catalina.properties and search the line with shared.loader=... Change it to the following:
shared.loader="${catalina.base}/shared-lib","${catalina.base}/shared-lib/*.jar","${catalina.home}/shared-lib","${catalina.home}/shared-lib/*.jar" This will tell Tomcat to load these files with a separate class-loader and will fix your problems, when all shared libraries are in that folder.
Download ADF-essentials ZIP and unpack it to shared-lib (you have to unpack them flat!!! So all JAR files from all subdirectories should lie directly in the folder without any subdirectories)
Deploy your ADF-Application with all dependent Libraries as an EAR File and copy all JAR Files from the EAR file to the shared-lib folder.
Check for duplicate JARs - log4j was always there in two versions for me, if you find duplicates, just keep the newer one.
Download GlassFish Server and copy the following files from glassfish/modules into the shared-lib folder:
bean-validator.jar
javax.mail-1.4.4.jar
javax.servlet.jsp.jstl.jar
javax.servlet.jsp.jstl-api.jar
javax.transaction.jar
Add ojdbc7.jar to tomcat/lib (NOT shared-lib)
Add the following Environment Option to Tomcat on Startup (e.g. in setenv.sh/setenv.bat): CATALINA_OPTS=-Doracle.mds.cache=simple
(Optional) If you want #PreDestroy annotations to work without raising errors and use TomCat 7 or 8, you have to register a custom listener, which will take care of these Annotations, since Oracle tries to access the Session in PreDestroy, while Tomcat adheres to the stupid official standard and invalidated the session before calling PreDestroy:
You will have to copy the following JAR-File (source included) to your shared-lib folder: adf-predestroy-helper.jar and register it in the WEB_INF/web.xml of every ADF Application like this:
<listener>
<listener-class>oracle.adf.PreDestroyHelper</listener-class>
</listener>
The PreDestroy listener is written by me and release OpenSource under CreativeCommons license, so you can use it however you want, but I would be happy about some feedback.
For reference - This is how my shared-lib folder looks like (160 files):
adf-businesseditor-model.jar
adf-businesseditor-objects.jar
adf-businesseditor-settings.jar
adf-controller-api.jar
adf-controller-rt-common.jar
adf-controller-schema.jar
adf-controller-security.jar
adf-controller.jar
adf-customizationset-ui.jar
adf-dt-at-rt-wizards.jar
adf-dt-at-rt.jar
adf-dynamic-faces.jar
adf-faces-changemanager-rt.jar
adf-faces-databinding-dt-core.jar
adf-faces-databinding-rt.jar
adf-faces-registration.jar
adf-faces-templating-dt-core.jar
adf-faces-templating-dtrt.jar
adf-loc.jar
adf-mobile-schema.jar
adf-pageflow-dtrt.jar
adf-pageflow-fwk.jar
adf-pageflow-impl.jar
adf-pageflow-rc.jar
adf-predestroy-helper.jar
adf-richclient-api-11.jar
adf-richclient-automation-11.jar
adf-richclient-bootstrap.jar
adf-richclient-impl-11.jar
adf-richclient-jmx.jar
adf-richclient-skin-editor.jar
adf-richclient-skin-repository.jar
adf-sec-idm-dc.jar
adf-share-base.jar
adf-share-ca.jar
adf-share-glassfish.jar
adf-share-security.jar
adf-share-support.jar
adf-share-web.jar
adf-stringeditor-api.jar
adf-view-databinding-dt-core.jar
adf-view-unified-databinding-dt-core.jar
adf.constants.jar
adfbcsvc-client.jar
adfbcsvc-registration.jar
adfbcsvc-share.jar
adfbcsvc.jar
adfdt_common.jar
adflibfilter.jar
adflibrary.jar
adflogginghandler.jar
adfm-debugger.jar
adfm-sqldc.jar
adfm.jar
adfmportlet.jar
adfmweb.jar
adfsharembean.jar
adftags.jar
adftransactionsdt.jar
batik-anim.jar
batik-awt-util.jar
batik-bridge.jar
batik-codec.jar
batik-css.jar
batik-dom.jar
batik-ext.jar
batik-extension.jar
batik-gui-util.jar
batik-gvt.jar
batik-parser.jar
batik-script.jar
batik-svg-dom.jar
batik-svggen.jar
batik-swing.jar
batik-transcoder.jar
batik-util.jar
batik-xml.jar
bc4j-mbeans.jar
bc4jhtml.jar
bc4jimdomains.jar
bc4jsyscat.jar
bean-validator.jar
bundleresolver.jar
com.bea.core.apache.commons.collections_1.0.0.0_3-2.jar
com.oracle.classloader.pcl_12.1.3.jar
com.oracle.http_client.http_client_12.1.3.jar
com.oracle.jrf.j2ee.web-common-schemas_12.1.3.jar
com.oracle.ojsp.globaltldcache_12.1.3.jar
com.oracle.ojsp.ojsp_12.1.3.jar
com.oracle.ojsp.web-common_12.1.3.jar
com.oracle.webservices.fmw.oc4j-ws-support-impl_12.1.3.jar
commons-el.jar
datatags.jar
db-ca.jar
dms.jar
dvt-as.jar
dvt-basemaps.jar
dvt-databinding-dt-core.jar
dvt-databindings-mds.jar
dvt-databindings.jar
dvt-faces.jar
dvt-facesbindings.jar
dvt-jclient-adf.jar
dvt-jclient.jar
dvt-shared-js.jar
dvt-trinidad.jar
dvt-utils.jar
facesconfigmodel.jar
groovy-all-2.1.6.jar
inspect4.jar
javamodel-rt.jar
javatools-nodeps.jar
javax.mail-1.4.4.jar
javax.servlet.jsp.jstl-api.jar
javax.servlet.jsp.jstl.jar
javax.transaction.jar
jdev-cm.jar
jewt4.jar
jmxdc.jar
jr_dav.jar
jrf-api.jar
jsf-api.jar
jsf-impl.jar
jsp-el-api.jar
mds-dc.jar
mdsrt.jar
mobile-repository.jar
oicons.jar
ojdbc6dms.jar
ojdl.jar
ojdl2.jar
oracle-el.jar
oracle.logging-utils_12.1.3.jar
oracle.xdb_12.1.0.jar
oraclexsql.jar
orai18n-mapping.jar
ordhttp.jar
ordim.jar
org.apache.bcel_5.1.jar
org.apache.commons.beanutils_1.8.3.jar
org.apache.commons.logging_1.1.1.jar
org.apache.http.components.httpclient-4.1.2.jar
org.apache.http.components.httpclient-cache-4.1.2.jar
org.apache.http.components.httpcore-4.1.2.jar
org.apache.http.components.httpmime-4.1.2.jar
prefuse.jar
rcs-adflib-rt.jar
rcsrt.jar
regexp.jar
resourcebundle.jar
share.jar
taglib.jar
trinidad-api.jar
trinidad-impl.jar
velocity-dep-1.4.jar
weld-integration.jar
xml-apis-ext.jar
xmlef.jar
xmlparserv2_sans_jaxp_services.jar
xsqlserializers.jar
And this is the standard tomcat/lib Folder (25 files):
annotations-api.jar
catalina-ant.jar
catalina-ha.jar
catalina-storeconfig.jar
catalina-tribes.jar
catalina.jar
ecj-4.4.2.jar
el-api.jar
jasper-el.jar
jasper.jar
jsp-api.jar
ojdbc7.jar
servlet-api.jar
tomcat-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar
tomcat-jdbc.jar
tomcat-jni.jar
tomcat-util-scan.jar
tomcat-util.jar
tomcat-websocket.jar
websocket-api.jar
The full ADF might be tricky, You should try ADF Essentials with Tomcat - http://technology.amis.nl/2014/01/03/deploy-oracle-adf-essentials-web-application-on-tomcat/
It seems you need to deploy your ADF application to Tomcat7 while it is up and running. Only it works in that case. If you restart tomcat, it starts to give the same exception again. So deploy your ADF applications to running Tomcat7 without restart.
I am taking a course in Enterprise Application Development. I am new to JSF. I am trying to deploy my app using Glassfish 3.1 using JSF and Netbeans IDE.
The error I get is listed below.
Error occurred during deployment: Exception while preparing the app : Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for F:\Seagate\docs backup\NetBeansProjects\ent-app-dev\Slamka_Project1\build\web.
If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected. Please see server.log for more details.
Below are the references to EJB I have made.
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ejb.EJB;
#EJB
Any help would be appreciated.
EDIT: This is a Java Web Application.
EDIT
WAR FILE STRUCTURE TREE
META-INF/MANIFEST.MF
WEB-INF/classes
WEB-INF/lib/primefaces-2.1.1.jar
WEB-INF/web.xml
index.shtml
My file does not have an EJB tag in teh xhtml document. it has what is listed below.
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsf/core">
Changing the web.xml web-app attribute version to 2.5 or higher resolved this issue.
Updated web-app element of web.xml will be,
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
So you have web application, it's not ejb-jar, it's web module that sould be packeged to *.war archive.
Structure should be
*.war/META-INF/persistence.xml
*.war/META-INF/MANIFEST.MF
*.war/WEB-INF/sun-web.xml
*.war/WEB-INF/web.xml
*.war/WEB-INF/classes/ - compiled classes in packages
*.war/WEB-INF/lib/ - libs
*.war/index.jsp - home page
example of sun-web.xml
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app>
<context-root>/app</context-root>
</sun-web-app>
if you are using Maven, you can use maven-war-plugin
Turns out the issue was a typo in a SQL statement (1 and l [lower case L]) and I needed to do a "Clean and build" on the project. Thank you for those who put effort into helping me solve my issue.
I'm working on a project which includes persistence library (JPA 1.2), EJB 3 and Web presentation layer (JSF). I develop application using Eclipse and application is published on Websphere Application Server Community Edition (Geronimo 2.1.4) through eclipse plugin (but the same thing happens if I publish manually). When publishing to server I get the following error:
java.lang.NoClassDefFoundError: Could not fully load class: manager.administration.vehicles.VehicleTypeAdminBean
due to:manager/vehicles/VehicleType
in classLoader:
org.apache.geronimo.kernel.classloader.TemporaryClassLoader#18878c7
at org.apache.xbean.finder.ClassFinder.(ClassFinder.java:177)
at org.apache.xbean.finder.ClassFinder.(ClassFinder.java:146)...
In web.xml I have reference to EJB:
<ejb-local-ref>
<ejb-ref-name>ejb/VehicleTypeAdmin</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>manager.administration.vehicles.VehicleTypeAdmin</local>
<ejb-link>VehicleTypeAdminBean</ejb-link>
</ejb-local-ref>
EJB project has a reference to persistence project, and Web project has references to both projects. I don't get any compilation errors, so I suppose classes and references are correct.
I don't know if it is app server problem, but I ran previously application on the same server using same configuration parameters.
Does anybody have a clue what might be the problem?
Looks almost like it couldn't find the class manager.vehicles.VehicleType when it was attempting to create/load the class manager.administration.vehicles.VehicleTypeAdminBean.
I've encountered similar problems before. When the class loader attempts to load the class it looks at the import statements (and other class usage declarations) and then attempts to load those classes and so on until it reaches the bottom of the chain (ie java.lang.Object). If it cannot find one class along the chain (in your case it looks like it cannot load VehicleType) then it will state that it cannot load the class at the top of the chain (in your case VehicleTypeAdminBean).
Is the VehicleType class in a different jar? If you have a web module and and EJB module do you have the jar containing the VehicleType class in the appropriate place(s). Sometimes with web projects you have to put the jars in the WebContent/WEB-INF/lib folder or it won't find them.
Are both of these projects deployed separately (ie. two ears? or one ear and one war?) or are they together (ie, one ear with jars and a war inside?). I'm assuming the second given you declared your EJB local?
The jars that you are dependent on also have to be declared in your MANIFEST.MF files in the projects that use it.
I'm kind of running on guesses since I do not know your project structure. Showing that would help quite a bit. But I'd still check on where VehicleType is located with regards to your EJB class. You might find it isn't where you think it is come packaging or runtime.
Thanks #Chris for WebContent/WEB-INF/lib idea ! it works for me by following these steps :
1- Export my EJBs to a JAR (MyEJBs.jar)
2- I created another jar with your_installation_path/IBM/SDP/runtimes/your_version/binCreateEJBStrub.bat via CMD.exe, by executing this command :
createEJBStubs.bat <my_path>/MyEJBs.jar -newfile –quiet
3- A new jar will be automatically created in the same directory as MyEJBs.jar named MyEJBs_withStubs.jar
4- Put your new jar in WebContent/WEB-INF/lib
5- Call your EJBs by :
MyEJBRemote eJBRemote;
InitialContext ic = new InitialContext();
obj = ic.lookup("your_ejb_name_jndi");
eJBRemote = (MyEJBRemote ) PortableRemoteObject.narrow(obj,
MyEJBRemote.class);
eJBRemote = (MyEJBRemote ) obj;
Now you can call your EJBs from another EAR