Dependency on tomcat EL implementation in weblogic
I am migrating an Spring 3 application from tomcat 6 to weblogic 10.3 and I am getting following error :
Caused by: java.lang.NoClassDefFoundError: org/apache/el/ExpressionFactoryImpl
at org.apache.tiles.evaluator.el.ELAttributeEvaluator.init(ELAttributeEvaluator.java:104)
at org.apache.tiles.factory.TilesContainerFactory.storeContainerDependencies(TilesContainerFactory.java:444)
at org.apache.tiles.factory.TilesContainerFactory.initializeContainer(TilesContainerFactory.java:368)
at org.apache.tiles.factory.TilesContainerFactory.createTilesContainer(TilesContainerFactory.java:287)
at org.apache.tiles.factory.TilesContainerFactory.createContainer(TilesContainerFactory.java:231)
at org.apache.tiles.startup.BasicTilesInitializer.createContainer(BasicTilesInitializer.java:117)
at org.apache.tiles.startup.BasicTilesInitializer.initialize(BasicTilesInitializer.java:53)
at org.springframework.web.servlet.view.tiles2.TilesConfigurer.afterPropertiesSet(TilesConfigurer.java:319)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCap
ableBeanFactory.java:1469)
In tomcat 6, the org.apache.el.ExpressionFactoryImpl class is in jasper-el.jar in tomcat lib. My question is why the application is looking for this class in weblogic and why it is not picking up the ExpressionFactory implementation class in weblogic. I guess that being a javaee 5 container, weblogic provides its own implementation of ExpressionFactory. If that's not the case, what's the best way of setting up a ExpressionFactory implementation in weblogic? I mean should I just include jasper-el.jar in application war file or is this something I can setup at server level?
Thanks!
HI,
WebLogic Provides Glassfish Implementation of the Mentioned API packaged with the WLS installer:
Found: ExpressionFactoryImpl
Class: com.sun.el.*ExpressionFactoryImpl*
Package: com.sun.el
Library Name: glassfish.el_2.1.0.jar
Library Path: C:\bea103\modules\glassfish.el_2.1.0.jar
But if you want to Use Tomcat provided Implementation which is available inside *"jasper-el.jar"* ..Then Please follow the Steps:
Step1). Place all the related Jars including *"jasper-el.jar"* inside your Applications *"WEB-INF/lib"* Directory.
Step2). Now Provide the "weblogic.xml" file inside "WEB-INF" directory .... just beside "web.xml" like following:
<weblogic-web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://www.bea.com/ns/weblogic/90″ xsi:schemaLocation=”http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd”>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
Why to use this Tag <prefer-web-inf-classes> ?
Please refer to: http://weblogic-wonders.com/weblogic/parsers_issues/
Step3). redeploy your Application.
Thanks
Jay SenSharma
Similar Messages
-
Error In Tomcat But Not In WebLogic
I have a .war file that runs perfectly in WebLogic 7.0. Today I tried to run that
same .war in Tomcat 4.0.6. Unfortunately, it did not run. I get the following
error:
java.lang.IllegalStateException: Cannot forward after response has been committed
Now, I know what this error means, but I don't know why I would get it when I
run in Tomcat but not WebLogic. Does WebLogic do something to "insulate" me from
this error that perhaps Tomcat does not do?
Aidan
The effect to use <jsp:forward> or RequestDispatcher.forward is different between
BEA and Tomcat (even Websphere). Weblogic stores the output in a buffer, before
the buffer reaches the limit, you can call those forward methods without obvious
problems. Tomcat (and Websphere I ever tested) is not so tolerable. If you have
send out something via Servlet writer or JSPWriter, or have something like HTML
tags/text before forwards, chances are big to encounter the exceptions you have.
So I use more include methods to assemble my JSPs and servlets, for the purpose
of portability.
"Aidan Monroe" <[email protected]> wrote:
>
>I have a .war file that runs perfectly in WebLogic 7.0. Today I tried
>to run that
>same .war in Tomcat 4.0.6. Unfortunately, it did not run. I get the following
>error:
>
>java.lang.IllegalStateException: Cannot forward after response has been
>committed
>
>Now, I know what this error means, but I don't know why I would get it
>when I
>run in Tomcat but not WebLogic. Does WebLogic do something to "insulate"
>me from
>this error that perhaps Tomcat does not do?
>
>Aidan
>
-
How to switch to a different JSP / EL implementation with WebLogic 10g?
Hi everyone,
we have a web application (JSP + servlets), that runs fine on Tomcat 5.5. We are porting it to WebLogic 10g3 - we've solved all of the issues except one. Some of the EL expressions are processes correctly in Tomcat, but it fails in WebLogic.
For example we have a custom tag (component inherited from a SimpleTag), that renders a combobox. The component has "textExpression" attribute, that it evaluated like
String text = (String) pageContext.getExpressionEvaluator().evaluate(textExpr, String.class, pageContext.getVariableResolver(), null);
but if the expression has two parts - i.e. something like "{...} {...}" - the parse fails, for example with the following exception:
javax.servlet.jsp.el.ELParseException: Error occured while trying to parse '${(option.partner.jmeno eq null && option.partner.prijmeni eq null && option.partner.nazevSpolecnostiFoPo ne null) ? option.partner.nazevSpolecnostiFoPo : option.partner.jmeno } ${(option.partner.jmeno eq null && option.partner.prijmeni eq null && option.partner.nazevSpolecnostiFoPo ne null) ? '' : option.partner.prijmeni}'
weblogic.jsp.internal.jsp.el.ExpressionEvaluatorImpl.parseEL(ExpressionEvaluatorImpl.java:171)
weblogic.jsp.internal.jsp.el.ExpressionEvaluatorImpl.parseExpression(ExpressionEvaluatorImpl.java:134)
weblogic.jsp.internal.jsp.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:125)
Is it possible to switch the JSP / EL engine to Jasper? I'd expect some property pointing to ExpressionEvaluator implementation / parameter in the deployment descriptor but I haven't found anything like that yet.
thanks
TomasAnyway I've achieved some progress with the Jasper - I've found that when precompiled using the JspC compiler from Jasper package, the resulting servlets are inherited from org.apache.jasper.runtime.HttpJspBase and thus should probably use the "proper" JSP EL implementation. But I still can't use these servlets from Weblogic, as I receive java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.runtime.PageContextImpl.
java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.runtime.PageContextImpl
at org.apache.jsp.WEB_002dINF.jsp.servletExceptionFragment_jsp._jspService(servletExceptionFragment_jsp.java:64)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:145)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:251)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1144)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:880)
The servlet is compiled properly, the jasper-runtime.jar is in the WEB-INF/lib directory, yet the weblogic is not able to load the PageContextImpl class :-(
Edited by: user6510516 on 25.2.2009 4:14 -
Migrating a spring application from tomcat 6 to dea weblogic 10
We deployed a spring application to TOMCAT 6.0. The application works. When the application is deployed in bea weblogic 10. it generates a a page not found.
Did you get the page not found on the index/welcome page or other pages? Do you see any exception in the server log? Can you give us a little info on your app?
It would be great if you can attach your app, or simiple reproducer so we can help you.
thanks
Michael -
Deploying JDO implementation on Weblogic
I need to plug-in the JDO mapping implementation on to a BEA Weblogic
Server, to be used by a session bean. Please let me know the way I can do
it.
Thanx.See:
http://docs.solarmetric.com/manual.html#j2ee_tutorial_weblogic
In article <bdff1m$tvj$[email protected]>, Kishore jaladi wrote:
I need to plug-in the JDO mapping implementation on to a BEA Weblogic
Server, to be used by a session bean. Please let me know the way I can do
it.
Thanx.--
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
I've implemented a custom realm on wl6.1 sp1 which extends the LDAPv2 realm
(implementing the ManageableRealm interface) for users and groups and
delegates to a rdbms delegate for aclentry management. I read an earlier
post about revoking a permission which requires a custom realm to augment
the weblogic.security.acl.AclImpl class. My question is similar in nature.
In a situation where a positive AclEntry needs to be changed to a negative
entry, what are the requirements imposed on the custom realm implementer?
Do I need to worry about the checkPermission call on the Acl implementation?
On the AclEntry implementation? Is there a BEA recommended path similar to
that for revoking permissions?
I would also recommend that the BEA responses to the revoking permissions
post and this be included in the documentation outlining the
responsibilities for implementing a custom realm.
Thanks!
Jon
Jon Wilmoth
Software Architect
eSage Group
(206) 264-5675 (Voice & Fax)
[email protected]
http://www.esagegroup.comHi Jon,
Your issue should be raised with BEA support. With regard to your second isssue:
"and this be included in the documentation outlining the
responsibilities for implementing a custom realm."
You should raise this as an enhancement either via the support channels or via
[email protected]
Kind Regards,
Richard Wallace.
Senior Developer Relations Engineer.
BEA Support.
"Jon Wilmoth" <[email protected]> wrote:
I've implemented a custom realm on wl6.1 sp1 which extends the LDAPv2
realm
(implementing the ManageableRealm interface) for users and groups and
delegates to a rdbms delegate for aclentry management. I read an earlier
post about revoking a permission which requires a custom realm to augment
the weblogic.security.acl.AclImpl class. My question is similar in nature.
In a situation where a positive AclEntry needs to be changed to a negative
entry, what are the requirements imposed on the custom realm implementer?
Do I need to worry about the checkPermission call on the Acl implementation?
On the AclEntry implementation? Is there a BEA recommended path similar
to
that for revoking permissions?
I would also recommend that the BEA responses to the revoking permissions
post and this be included in the documentation outlining the
responsibilities for implementing a custom realm.
Thanks!
Jon
Jon Wilmoth
Software Architect
eSage Group
(206) 264-5675 (Voice & Fax)
[email protected]
http://www.esagegroup.com -
Document for JMS Failover Implementation On WebLogic
Hi,
I am looking some good links and techniques to implement JMS failover using WebLogic 10.3.
FailOver* [As we do with our Databases (Concept of Clustring)]
System will consist of two app servers and each will have its own application deployments but if one failed for some reason the application messages should redirected to the other servere and vice versa.
Above efinition is very brief but if anyone can help provide some good documents and info how to implement it it will be appriciated.
Thanks :-)Thanks alot guys for your help. We successfully implemented it at our servers here by creating distributed queues targetting all servers in a cluster.
One point which I think is worth mentioning and I want to share with all us here is that; when App Server [where MDB will post the message finally after retrieving from queue] if that goes down what will happen, what MDB will do with that message?.
We impleneted the DLQ (error destination) and deploy one more MDB_DLQ_SERVER2 (Let say App SERVER 1 is down) which gets triggered when any message comes to DLQ and post that message to some other App Server, Let say message has been read by MDB_SERVER1 on SERVER1 but offcourse actaull server is down so message should get Re-directed to its Error Destination after it expiration peiod or whatever the settings are. DLQ (Error Destination) which is also a distributed destinatrion again targetting all servers in cluster same as actaull Request or Reply queues BUT MDB_DLQ_SERVER2 which is deployed on Server2 is NOT able to read this message. It get triggered but can not access the message.
After debugging for almost a day we found out its because message has been transafed to DLQ but actaully its resides in a FILESTORE_SERVER1 and MDB_DLQ_SERVER2 is not able to access it.
To work with that we have to define MDB_DLQ_SERVER1 to cater the SERVER1 failure and MDB_DLQ_SERVER2 to cater SERVER2 failure.
Reason I am mentioning this because as I said DLQ is also a normal Distributed Queue but at the same time its NOT as Distributed as its says.
Hope you all understand what I just wrote above.
Now I need to implement exactly the same scenario using four seperate physicall machine containing my four servers. I tried this scenario by creating four machines where node manager for each server is running and listning but when I am trying to start the server it gives me Certificate Exception with bad user name and password. Anyway I have seen some posts here regarding this; So i think i'll be fine.
Thanks Again,
Sheeraz -
Can distributed queues be implemented in weblogic 6.1
hi,
i am currently using weblogic 6.1 with 3 machines on a cluster.when using jms
there seems to be no way to use distributed queues on the machine.this feature
is however supported in weblogic 7.0.is there any workaround for this.this wuld
essentially mean a single point of failure as the queue wuld be present on only
1 wlserver and the other 2 servers though in cluster wuldnt have any reference
to this queue..
any help???
The JMS Performance Guide white-paper contains examples
of doing exactly this. You can find it here:
http://dev2dev.bea.com/technologies/jms/index.jsp
Illusionz wrote:
> hi,
> i am currently using weblogic 6.1 with 3 machines on a cluster.when using jms
> there seems to be no way to use distributed queues on the machine.this feature
> is however supported in weblogic 7.0.is there any workaround for this.this wuld
> essentially mean a single point of failure as the queue wuld be present on only
> 1 wlserver and the other 2 servers though in cluster wuldnt have any reference
> to this queue..
> any help???
-
Hi there,
I really need help here. Trying to deploy a tomcat web application on Weblogic, and didn't work.
What I did:
1, upload the webapp folder of the web application, onto Weblogic / user_projects/ domain / base_domain
2, login into Console, find the webapp folder, and deploy it in the AdminServer
3, try browse the web application, and got all different kind of errors (Unable to open database connection, or Unable to compile the stylesheet, or Sytax errors..)
I have written up a simple mysql test servlet and deploy it and test it and it works......
I also got whole bunch of errors when AdminServer starts up:
Ignoring: unable to load class:java.lang.ClassNotFoundException: com.pageseeder.review.NewReviewExplorer at: weblogic.xml.schema.binding.util.ClassUtil.loadClass(ClassUtil.java:76)
When processing WebService module 'webapp'. Failed to load servlet Class: com.pageseeder.review.ReviewSpace
Really out of my mind, first time using Weblogic, and have no idea where to start debug this issue.
Please any ideas? I can open the server port and give the login/pwd if needed.
Thanks!
cheneyHi Jay,
This is a great information and really points me to a right direction. However, things are always not going smooth as I imagine, once I put in:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
into weblogic.xml, my application failed to load. Here is what I got from screen:
<May 5, 2010 10:06:16 AM EST> <Error> <HTTP> <BEA-101216> <Servlet: "com.pageseeder.layout.UIMappingServlet" failed to preload on startup in Web application: "webapp".
java.lang.LinkageError: loader constraint violation: loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) previously initiated loading for a different type with name "org/xml/sax/XMLReader"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:344)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:301)
I have no idea about this error..... -
Running the J2EE CA implementation on Solaris (weblogic 6.0 sp1)
Hi! I am trying to run the J2EE CA Beta 2 implementation on weblogic 6.0 sp1. Everytimg
I run the server I get the following exception:
java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.getEntry(ZipFile.java:141)
at java.util.jar.JarFile.getEntry(JarFile.java:181)
at weblogic.utils.jars.VirtualJarFile.getEntry(VirtualJarFile.java:115)
Seems like the RevisedBlackBoxNoTx.rar is causing this problem. Could someone
please tell me how I should fix this problem.
Regards,
Nehal.
Edit the registry.xml file and change "6.0 Beta" to "6.0"
-Greg
On 12 Mar 2001 10:02:19 -0800, "Raman Trikkur" <[email protected]>
wrote:
>
Hello Kumar,
Here is my registry.xml.
<?xml version="1.0" encoding="UTF-8"?>
<bea-product-information>
<host name="ramantrik2pc">
<product name="WebLogic Server" format="1.0">
<release level="6.0 Beta" Status="installed" InstallDir="D:\bea\wlserver6.0"
InstallTime="Mar 1, 2001 5:18:57 PM" InstallSet="Server">
<component name="Program" />
<component name="Samples" />
</release>
</product>
</host>
</bea-product-information>
Thanks for helping me figure this out. If this doesn't work,
I'll just try installing the whole package (WLS 6.0 with SP1
applied) as Xiang suggested.
Regards,
Raman
Kumar Allamraju <[email protected]> wrote:
could you post your registry.xml ?
Raman Trikkur wrote:
Hi,
I'm trying to get the service pack SP1 ((wls60sp1_upgrade_win.exe)
) installed on my NT box. I have wls 6.0 installed andworking.
After unpacking and choosing my bea home directory (D:\bea),I
get an error that says "Weblogic Server Service Pack1 Installation
failed. You do not seem to have Weblogic server 6.0installed for
BEAHOME D:\bea".
But that is untrue. I DO have it installed in D:\bea,and I have
the environment shell up by running setEnv.cmd and Iinvoked the
service pack installer from within that shell.
Is there anything I'm missing? Has anyone else encounteredthis
problem? Any help with this would be much appreciated.
Regards,
Raman -
What is (roughly) the implementation duration for Oracle weblogic portal an
Dear All
i need to knwo r(oughly) how long does it take to implement oracle weblogic portal (for exmpale 5-7 months or 1 year,etc) for an company that contains around 2700 employees, and how much will it cost (roughly).
thanks in advance for any help.Hi Ryan,
Is there any posssibility of editing or adding the content from UCM-VCR,when i edit or add content through portal it is giving me unsupported feature exception.
Please let me know if there is any way????
-Prabu -
Hey Guys,
We are running our application on weblogic8.1 server (AIX box). Our application keeps throwing this error. Has anyone of you come across this error before.
java.sql.SQLException: This JDBC 2.0 method is not implemented at weblogic.jdbc.mssqlserver4.TdsResultSet.getType(TdsResultSet.java:684) at weblogic.jdbc.wrapper.ResultSet_weblogic_jdbc_mssqlserver4_TdsResultSet.getType(Unknown Source) at weblogic.jdbc.rmi.internal.ResultSetImpl.isResultSetCacheable(ResultSetImpl.java:140) at weblogic.jdbc.rmi.internal.ResultSetImpl.isRowCaching(ResultSetImpl.java:109) at weblogic.jdbc.rmi.internal.ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_weblogic_jdbc_mssqlserver4_TdsResultSet_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477) at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144) at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415) at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code)) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) Thanks Regards RichiRachith Srinivas wrote:
Hey Guys,
We are running our application on weblogic8.1 server (AIX box).
Our application keeps throwing this error. Has anyone of you come across
this error before.
java.sql.SQLException: This JDBC 2.0 method is not implemented
at weblogic.jdbc.mssqlserver4.TdsResultSet.getType(TdsResultSet.java:684)
...Hi. That old driver is telling you the truth. That JDBC 2.0 method is not implemented.
There has been no development of that driver since soon after the JDBC 2.0 spec was
finalized. We provide the weblogic.jdbc.sqlserver.SQLServerDriver in the 8.1 server,
and heartily recommend you switch to it. It's a much superior driver, and has the
considerable benefit if being fully supported and updated. The old ms4 driver is
strongly deprecated and won't exist in the next release of WebLogic.
Joe -
# of Connections between Web Server (Tomcat) and Weblogic AppServer
Hi guys,
does anybody know how many connections are used between a TomCat WebServer and the Weblogic ApplicationServer?
- One?
- One per active browser-user?
- Configurable? (freely, in some ranges, which values are recommandable?)
Does anybody has some links to related documentation maybe?
Answers would be very helpful.
Thanx in advance!
Markus
Hi,
While not an exact solution to your problem, I seem to recall a similar issue, not with this web server though, but similar still. As far as I recall, the problem was related to the loading order of the library files and overlapping class files within those libraries. I think it was an issue with j2ee.jar/javaee.jar and jbossall-client.jar.
For the standalone test, you have probably checked the following, but check again :)
- Exact same JDK
- Libraries in the web server lib directory
- Libraries in application/WEB-INF/lib
- Loading order
You might also want to check how war file class loading is done in the web server sp6.
Other links of interest:
[javax.xml.soap.SOAPException known versions|http://www.jarfinder.com/index.php/java/info/javax.xml.soap.SOAPException]
Cheers,
Øyvind -
EJB 3.0 lookup in Weblogic 10.3.0
Hello everyone,
1: Our application runs on Weblogic Application Server,version 10.3.0
2: In our system,we need to deploy an EJB conforming to the EJB 3.0 specification.
Please find the sample code for our UAT environment as below :
/*The remote interface*/
package com.serverside.ejb.session;
import javax.ejb.Remote;
@Remote
public interface ASimpleSessionBeanRemote {
public void printThis(String print);
/*The bean class*/
package com.serverside.ejb.session;
import javax.ejb.Remote;
import javax.ejb.Stateless;
* Session Bean implementation class ASimpleSessionBean
@Stateless(name="ASimpleSessionBean", mappedName = "ASimpleSessionEJB")
@Remote(ASimpleSessionBeanRemote.class)
public class ASimpleSessionBean implements ASimpleSessionBeanRemote {
* Default constructor.
public ASimpleSessionBean() {
// TODO Auto-generated constructor stub
@Override
public void printThis(String print) {
// TODO Auto-generated method stub
System.out.println("ASimpleSessionBean : "+print);
3: The above files when packaged in jar get deployed on the server successfully.
4: As per EJB 3.0 specification,the deployement descriptors are not mandatory.Hence,the jar doesn't include ejb-jar.xml and weblogic-ejb-jar.xml
5: Please find below,the EJB3.0 annotations reference as per the Weblogic Application Server Documentation :
Annotation : @Stateless
Package: javax.ejb.Stateless
Attribute : mappedName
Description :
Specifies the product-specific name to which the stateless session bean should be mapped.
You can also use this attribute to specify the JNDI name of this stateless session bean. WebLogic Server uses the value of the mappedName attribute when creating the bean’s global JNDI name. In particular, the JNDI name will be:
mappedName#name_of_businessInterface
where name_of_businessInterface is the fully qualified name of the business interface of this session bean.
For example, if you specify mappedName="bank" and the fully qualified name of the business interface is com.CheckingAccount, then the JNDI of the business interface is bank#com.CheckingAccount.
6: Conforming to the above specification, the sample EJB deployed on our application server has the binding name(as reflected in the jndi tree) as follows :
ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSessionBeanRemote
A jndi lookup using this name succeeds :
InitialContext.doLookup("ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSesionBeanRemote");
7: Now,we want the binding name to be a simple string i.e the lookup must be something like :
InitialContext.doLookup("ASimpleSessionEJB");
8: To implement point-7,we tried using the ejb-jar.xml and weblogic-ejb-jar.xml as follows :
->ejb-jar.xml
<?xml version="1.0" encoding="ASCII"?>
<ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
<display-name>ejb</display-name>
<enterprise-beans>
<session>
<ejb-name>ASimpleSessionBean</ejb-name>
<ejb-ref>
<ejb-ref-name>ASimpleSessionEJB</ejb-ref-name>
<remote>com.serverside.ejb.session.ASimpleSessionBeanRemote</remote>
<mapped-name>ASimpleSessionEJB</mapped-name>
</ejb-ref>
</session>
</enterprise-beans>
</ejb-jar>
->weblogic-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-ejb-jar xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
<!-- server-version: 10.3.0 --><wls:weblogic-enterprise-bean>
<wls:ejb-name>ASimpleSessionBean</wls:ejb-name>
<wls:stateless-session-descriptor>
<wls:business-interface-jndi-name-map>
<wls:business-remote>ASimpleSessionBeanRemote</wls:business-remote>
<wls:jndi-name>ASimpleSessionEJB</wls:jndi-name>
</wls:business-interface-jndi-name-map></wls:stateless-session-descriptor>
<wls:jndi-name>ASimpleSessionEJB</wls:jndi-name>
</wls:weblogic-enterprise-bean>
</wls:weblogic-ejb-jar>
9: Inspite of the point-8,the binding name remains as follows :
ASimpleSessionEJB#com.serverside.ejb.session.ASimpleSessionBeanRemote
10: Please guide us about the solution and implementation to attend point-7.
Thanks !Hi,
I find distributed applications very interesting (even though this application of mine could just use sockets - it is nicer than EJB 2.1). You don't need the @Local DI and local interface if you only do remote - so here is some minimal hello world code that currently works on a test network of mine.
In this example I have provided only a remote stateless session bean and an SE client (could be a pojo or servlet).
The *@Stateful* SB has been converted to a *@Stateless* SB (now the state field doesn't really hold state as the container pools the SSB - but this is an unrelated issue as I an not using transactions yet anyway). The key is naming the SSB with the mappedName attribute so you can easily reference it - or just check your logs after you deploy the EAR containing the EJB in your EE server.
Note: WebLogic also registers a legacy EJB 2.1 compliant jndi name alias for you as well appsdirorg_eclipse_persistence_example_distributed_ClientEAR_earorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home*
For your specific question about dependency injection (which is implemented by Spring AOP inside the server).
Use @Remote on your Remote inteface class
Use @Stateless on your session bean implementation class
Use @EJB to inject your stateless session bean into a servlet for example (I have not tried using @EJB on a POJO - it would need to be running on the WebLogic container in the WAR or EJB.jar - don't think that is supported - I have not tried @Resource or spring annotations for this yet)
This example (reduced to show a single remote server) uses a JNDI lookup to get a reference to the remote bean (full try/catch exception handlers in full code near end of post).
Hashtable<String, String> aTable = new Hashtable<String, String>();
aTable.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");
aTable.put("java.naming.provider.url", "beowulf5");
Context aContext = new InitialContext(aTable);
Object aRemoteReference = aContext.lookup("ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote");
NodeRemote aNode = (NodeRemote) PortableRemoteObject.narrow(aRemoteReference, NodeRemote.class);
aNode.setState(0)); // remote method invocationI deploy an EAR containing the SSB on distributed servers on any EE container - I chose WebLogic 10.3.4.
I run an SE app that connects to a list of servers that that are running the remote stateless session bean. The code is very naive at this point, it does retry bad connections and it is not yet multithreaded - just a proof of concept for EJB 3 remote session beans.
The InitialContext RMI handshaking will take around 10 sec per server to setup - then you can do up to 200k remote EJB RMI invokacations per second/thread on my machine.
The @Local code is only required if you wish to optimize using your SSB on the same JVM.
The JPA peristence code can be ignored (no EJB 3.0 Entities)
I just discovered the forum code tag in square brackets after 2 years
package org.eclipse.persistence.example.distributed;
import javax.ejb.Remote;
@Remote
public interface NodeRemote {
public void setState(int state);
public int getState();
package org.eclipse.persistence.example.distributed;
import javax.ejb.Stateful;
@Stateful(mappedName="ejb/Node")
public class Node implements NodeRemote {
private int state;
public void setState(int aState) { state = aState; }
public int getState() { return state; }
}weblogic-ejb-jar.xml ejb deployment descriptor - empty (we are using dependency injection annotations)
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-ejb-jar xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.2/weblogic-ejb-jar.xsd">
<!--weblogic-version:10.3.4-->
</wls:weblogic-ejb-jar>weblogic-application.xml deployment descriptor - essentially empty
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.2/weblogic-application.xsd">
<!--weblogic-version:10.3.4-->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
</wls:weblogic-application>application.xml JEE5 deployment descriptor - you can ignore the model.jar and war
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
<display-name>
org.eclipse.persistence.example.distributed.ClientEAR</display-name>
<module>
<java>org.eclipse.persistence.example.distributed.Model.jar</java>
</module>
<module>
<web>
<web-uri>org.eclipse.persistence.example.distributed.ClientWeb.war</web-uri>
<context-root>distributed</context-root>
</web>
</module>
<module>
<ejb>org.eclipse.persistence.example.distributed.ClientEJB.jar</ejb>
</module>
</application>SE java client code (run from Eclipse 3.6 EE edition)
package org.eclipse.persistence.example.distributed;
import java.rmi.ConnectException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import javax.ejb.EJBException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import org.eclipse.persistence.example.distributed.NodeRemote;
import org.eclipse.persistence.example.distributed.network.Cell;
import org.eclipse.persistence.example.distributed.network.Quad;
import org.eclipse.persistence.example.distributed.network.Wire;
* This class tests RMI connections to multiple WebLogic servers running on
* remote JVM's. It is intended for experimental concurrency investigations only.
* Note: for non-EE/ejb/web contexts (SE) use wlfullclient.jar generated from
* $WLS_INSTALL\wlserver_10.3\server\lib>java -jar wljarbuilder.jar
* 20110106: refactor for generic remote connections
* @author http://wiki.eclipse.org/User:Michael.obrien.oracle.com 20100916
public class Host {
/** RMI server key name - does not need to resolve under DNS */
public static String serverDNS[] = {"beowulf5","local"};//,"beowulf6"};
/** RMI t3 URL */
public static String serverT3[] = {"t3://1n.n.n.n:7001","t3://1n.n.n.n:7001"};
private int numberServers = serverDNS.length;
/** list of server names from above arrays */
private List<String> serverNames = new ArrayList<String>();
/** Input context map hashtable entries - For JNDI we are forced to use Hashtable instead of HashMap*/
private Map<String, Hashtable<String, String>> contextHashtableMap
= new HashMap<String, Hashtable<String, String>>();
/** output cached context maps for each remote server */
private Map<String, Context> rmiCachedContextMap
= new HashMap<String, Context>();
/** $Proxy remote objects */
private Map<String, NodeRemote> remoteObjects
= new HashMap<String, NodeRemote>();
/** remote propagation value */
private Map<String, Integer> stateToSet
= new HashMap<String, Integer>();
/** How many processors are available (real + hyperthreaded) */
private Map<String, Integer> availableProcessors
= new HashMap<String, Integer>();
/** whether the node is accepting requests or not */
private Map<String, Boolean> nodeUnavailable
= new HashMap<String, Boolean>();
/** map of t3 protocol URLs */
private Map<String, String> serverIPMap
= new HashMap<String, String>();
// verify that all EE libraries available via http://download.oracle.com/docs/cd/E12840_01/wls/docs103/client/jarbuilder.html
private static final String CONTEXT_FACTORY_NAME = "weblogic.jndi.WLInitialContextFactory";
private static final String SESSION_BEAN_REMOTE_NAME = "ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote";
//private String sessionBeanRemoteName = "java:comp/env/ejb/Node"; // EE only
//private String sessionBeanRemoteName = "org_eclipse_persistence_example_distributed_ClientEARorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home" ;
public Host() {
// initialize state
for(int i=0;i<numberServers;i++) {
// For each server add the name key and corresponding RMI URL
serverNames.add(serverDNS);
serverIPMap.put(serverDNS[i], serverT3[i]);
nodeUnavailable.put(serverDNS[i], false);
availableProcessors.put(serverDNS[i], 0);
Hashtable<String, String> aTable = new Hashtable<String, String>();
contextHashtableMap.put(serverDNS[i],aTable);
aTable.put(Context.INITIAL_CONTEXT_FACTORY,CONTEXT_FACTORY_NAME);
aTable.put(Context.PROVIDER_URL, serverT3[i]);
public void process() {
// process RMI Objects
try {
NodeRemote aNode;
StringBuffer aBuffer = new StringBuffer();
// Endlessly generate RMI requests
for(;;) {
// Send messages to entire grid in parallel
for(String remoteServer : remoteObjects.keySet()) {
aNode = remoteObjects.get(remoteServer);
// increment server's pending state
stateToSet.put(remoteServer, stateToSet.get(remoteServer).intValue() + 1);
if(!nodeUnavailable.get(remoteServer)) {
try {
// Issue: One JVM halt will affect the entire distributed app.
// don't let a node failure halt the host
aNode.setState(stateToSet.get(remoteServer)); // this remote call can throw an EJBException wrapping a java.rmi.ConnectException
aBuffer = new StringBuffer("State from: ");
aBuffer.append(remoteServer);
aBuffer.append(" = ");
aBuffer.append(aNode.getState());
System.out.println(aBuffer.toString());
} catch (EJBException e) {
// weblogic.transaction.internal.TimedOutException: Transaction timed out after 29 seconds
// or
// EJBException wrapping a java.rmi.ConnectException if the server is not running
e.printStackTrace();
// mark the current node as down, clear the flag in 5 min
nodeUnavailable.put(remoteServer, true);
} catch (Exception e) {
e.printStackTrace();
public void connect() {
// Setup RMI Objects
try {
// Establish RMI connections to the session beans
for(String aServer : serverNames) {
Context aContext = null;
try {
aContext = new InitialContext(contextHashtableMap.get(aServer));
rmiCachedContextMap.put(aServer, aContext);
System.out.println("Context for " + aServer + " : " + aContext);
// For qualified name look for weblogic log "EJB Deployed EJB with JNDI name"
Object aRemoteReference = aContext.lookup(SESSION_BEAN_REMOTE_NAME);
System.out.println("Remote Object: " + aRemoteReference);
// narrow the $proxy remote bean
NodeRemote aNode = (NodeRemote) PortableRemoteObject.narrow(aRemoteReference, NodeRemote.class);
remoteObjects.put(aServer, aNode);
System.out.println("Narrowed Session Bean: " + aNode);
// initialize state list
stateToSet.put(aServer, new Integer(0));
} catch (Exception ce) {
// server down throws a javax.naming.CommunicationException inside a java.net.ConnectException
ce.printStackTrace();
// mark the current node as down, clear the flag in 5 min
nodeUnavailable.put(aServer, true);
} catch (Exception e) {
e.printStackTrace();
public Map<String, Hashtable<String, String>> getContextMap() { return contextHashtableMap; }
public void setContextMap(Map<String, Hashtable<String, String>> contextMap) { this.contextHashtableMap = contextMap; }
public Map<String, Context> getRmiContextMap() { return rmiCachedContextMap; }
public void setRmiContextMap(Map<String, Context> rmiContextMap) { this.rmiCachedContextMap = rmiContextMap; }
public Map<String, NodeRemote> getRemoteObjects() { return remoteObjects; }
public void setRemoteObjects(Map<String, NodeRemote> remoteObjects) { this.remoteObjects = remoteObjects; }
public Map<String, Integer> getStateToSet() { return stateToSet; }
public void setStateToSet(Map<String, Integer> stateToSet) { this.stateToSet = stateToSet; }
public Map<String, Boolean> getNodeUnavailable() { return nodeUnavailable; }
public void setNodeUnavailable(Map<String, Boolean> nodeUnavailable) { this.nodeUnavailable = nodeUnavailable; }
public Map<String, String> getServerIPMap() { return serverIPMap; }
public void setServerIPMap(Map<String, String> aServerIPMap) { serverIPMap = aServerIPMap; }
public List<String> getServernames() { return serverNames; }
public void setServerNames(List<String> serverNames) { this.serverNames = serverNames; }
public int getNumberServers() { return numberServers; }
public void setNumberServers(int numberServers) { this.numberServers = numberServers; }
public Map<String, Integer> getAvailableProcessors() { return availableProcessors; }
public void setAvailableProcessors(Map<String, Integer> availableProcessors) { this.availableProcessors = availableProcessors; }
public static void main(String[] args) {
Host host = new Host();
host.connect();
host.process();
Path to run SE client from command line
java -cp .;wls/wlfullclient.jar org.eclipse.persistence.example.distributed.HostRemote Server Deploy logs
Local JVM
####<18-Jan-2011 11:13:45 o'clock AM VET> <Info> <EJB> <mfobrien-pc2> <AdminServer> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295365425233> <BEA-014021> <The EJB 'Node(Application: _appsdir_org.eclipse.persistence.example.distributed.ClientEAR_ear, EJBComponent: org.eclipse.persistence.example.distributed.ClientEJB.jar)' has been successfully deployed.
The following remote interfaces have been bound into JNDI with the specified JNDI names:>
####<18-Jan-2011 11:13:45 o'clock AM VET> <Info> <EJB> <mfobrien-pc2> <AdminServer> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295365425233> <BEA-014022> <********
org.eclipse.persistence.example.distributed.NodeRemote is bound with JNDI name:ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote ********>
####<18-Jan-2011 11:13:45 o'clock AM VET> <Info> <EJB> <mfobrien-pc2> <AdminServer> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295365425233> <BEA-010009> <EJB Deployed EJB with
JNDI name _appsdir_org_eclipse_persistence_example_distributed_ClientEAR_earorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home.>
beowulf5 JVM
####<Jan 18, 2011 11:27:46 AM EST> <Info> <EJB> <beowulf5> <AdminServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295368066578> <BEA-014021> <The EJB 'Node(Application: _appsdir_org.eclipse.persistence.example.distributed.ClientEAR_ear, EJBComponent: org.eclipse.persistence.example.distributed.ClientEJB.jar)' has been successfully deployed. The following remote interfaces have been bound into JNDI with the specified JNDI names:>
####<Jan 18, 2011 11:27:46 AM EST> <Info> <EJB> <beowulf5> <AdminServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295368066578> <BEA-014022> <******** org.eclipse.persistence.example.distributed.NodeRemote is bound with
JNDI name:ejb/Node#org.eclipse.persistence.example.distributed.NodeRemote ********>
####<Jan 18, 2011 11:27:46 AM EST> <Info> <EJB> <beowulf5> <AdminServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1295368066578> <BEA-010009> <EJB Deployed EJB with JNDI name _appsdir_org_eclipse_persistence_example_distributed_ClientEAR_earorg_eclipse_persistence_example_distributed_ClientEJB_jarNode_Home.>
local SE client logs
Context for beowulf5 : javax.naming.InitialContext@9980d5
Narrowed Session Bean: ClusterableRemoteRef(7753348759447467175S:10.156.53.10:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer [7753348759447467175S:10.156.53.10:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer/292])/292
Context for local : javax.naming.InitialContext@1a897a9
Narrowed Session Bean: ClusterableRemoteRef(-5707697697594367270S:10.156.52.246:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer [-5707697697594367270S:10.156.52.246:[7001,7001,-1,-1,-1,-1,-1]:base_domain:AdminServer/300])/300
State from: local = 1
State from: beowulf5 = 1
State from: local = 2
State from: beowulf5 = 2thank you
Glad to help out.
/Michael -
Deploying servlet on Tomcat using "ant install" not working. Please help.
Hello. Normally I can find answers by using search, but I can't today for some reason. So please bare with me if this has been mentioned before. I will try to provide as much info as possible so that helping me isn't too much a chore. Thank you.
I have downloaded and installed the JWSDP 1.3. and Tomcat is running. I am also using Ant 1.5.4 (previous installation - not one included with JWSDP) and modeled my build.xml file after the template provided here:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt.
When I run ant on my respository, everything builds fine. But when I run Ant with the install target, I get the following error:
BUILD FAILED
file:C:/owl/build.xml:366: java.io.IOException: Server returned HTTP response co
de: 401 for URL: http://localhost:8080/manager/deploy?path=%2Fowl&war=file%3A%2F
%2FC%3A%5Cowl%2Fbuild
Here is line 366 build.xml:
localWar="file://${build.home}"/>
...which is included in this block for the target "install":
<target name="install" depends="compile"
description="Install application to servlet container">
<deploy url="${manager.url}"
username="${manager.username}"
password="${manager.password}"
path="${app.path}"
localWar="file://${build.home}"/>
</target>
When I point my brower to the url located in the error verbose, I get the following:
FAIL - Encountered exception java.lang.NullPointerException
I am trying to get my environment set up correctly before I start spending time developing servlets, but I am getting tempted to just develop to servlets and "manually" installing/deploying them either by copying and pasting or by using the Tomcat manager. I would really like to do everything from Ant though if possible. Please help.I don't think this is at all correct:
localWar="file://${build.home}"/>You've got to create a real WAR file - a JAR file with WEB-INF and all its minions inside it:
http://access1.sun.com/techarticles/simple.WAR.html
That's the file you need to refer to there. You can manage that with Ant too, of course.
Here's what my Ant build.xml looks like for Web apps (there's a build-web.properties file that follows):
build-web.xml
<project name="Tomcat Build Tasks" default="clean" basedir=".">
<target name="init-props">
<tstamp>
<format property="touch.time" pattern="MM/dd/yyyy hh:mm aa" />
</tstamp>
<filterset id="ant.filters">
<filter token="DATE" value="${TODAY}" />
<filter token="TIME" value="${TSTAMP}" />
</filterset>
<!-- Load in all the settings in the properties file -->
<property file="build.properties" />
<!-- Load in all Tomcat settings in the properties file -->
<property file="build-web.properties" />
</target>
<target name="prepare" depends="init-props">
<mkdir dir="${war.classes}"/>
<mkdir dir="${war.lib}"/>
<mkdir dir="${manifest}" />
</target>
<target name="clean" depends="init-props" description="clean up temporary files">
<delete file="${project}.war" />
<delete dir="${war.root}"/>
<delete dir="${manifest}" />
</target>
<target name="set-tomcat-classpath" depends="prepare">
<path id="tomcat.class.path">
<fileset dir="${tomcat.home}/bin">
<patternset>
<include name="**/*.jar" />
</patternset>
</fileset>
<fileset dir="${tomcat.home}/shared/lib">
<patternset>
<include name="**/*.jar" />
</patternset>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<patternset>
<include name="**/*.jar" />
</patternset>
</fileset>
<fileset dir="${tomcat.home}/server/lib">
<patternset>
<include name="**/*.jar" />
</patternset>
</fileset>
<fileset dir="${ant.home}/lib">
<patternset>
<include name="**/*.jar" />
</patternset>
</fileset>
</path>
</target>
<target name="create" depends="set-tomcat-classpath" description="create the war file">
<!-- All files at root level -->
<!-- Temporarily put the JSPs at root until you figure this out -->
<copy todir="${war.root}">
<fileset dir="${src.jsp}"/>
</copy>
<!--
<copy todir="${war.root}">
<fileset dir="${src.html}" includes="*.html"/>
</copy>
-->
<copy todir="${war.root}/css">
<fileset dir="${src.css}"/>
</copy>
<copy todir="${war.root}/images">
<fileset dir="${src.images}"/>
</copy>
<copy todir="${war.root}/js">
<fileset dir="${src.js}"/>
</copy>
<!-- All files at the WEB-INF level and below -->
<copy todir="${war.web}">
<fileset dir="${src.etc}" includes="web.xml"/>
</copy>
<!-- All files in the CLASSPATH lib -->
<copy todir="${war.web}/lib">
<fileset dir="${src.lib}" includes="**/*.jar" excludes="**/*-tests.jar, **/junit.jar"/>
</copy>
<!-- Put the dispatcher XML in WEB-INF/config -->
<copy todir="${war.web}/config">
<fileset dir="${src.etc}" includes="${project}-config.xml"/>
</copy>
<!-- Put XSL stylesheets in WEB-INF/xsl -->
<copy todir="${war.web}/xsl">
<fileset dir="${src.xsl}" includes="**/*.xsl"/>
</copy>
<!-- Put the project JAR file in WEB-INF/lib -->
<copy todir="${war.web}/lib">
<fileset dir="${deploy}" includes="**/${project}.jar"/>
</copy>
<!-- Create the manifest -->
<buildnumber />
<manifest file="${manifest}/manifest.mf">
<attribute name="Implementation-Title" value="${project}" />
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Date" value="${TODAY}" />
<attribute name="Major-Version" value="${major}" />
<attribute name="Minor-Version" value="${minor}" />
<attribute name="Build-Number" value="${build.number}" />
</manifest>
<!-- Create the WAR file -->
<jar jarfile="${project}.war"
manifest="${manifest}/manifest.mf">
<fileset dir="${war.root}"/>
<metainf dir="${src.etc}" includes="context.xml"/>
</jar>
</target>
<target name="create-tomcat-admin-tasks" depends="set-tomcat-classpath">
<!--
<pathconvert targetos="windows" refid="tomcat.class.path" property="converted.class.path" />
<echo message="CLASSPATH: ${converted.class.path}" />
-->
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask" classpath="tomcat.class.path"/>
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask" classpath="tomcat.class.path"/>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask" classpath="tomcat.class.path"/>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" classpath="tomcat.class.path"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" classpath="tomcat.class.path"/>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask" classpath="tomcat.class.path"/>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask" classpath="tomcat.class.path"/>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask" classpath="tomcat.class.path"/>
<taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask" classpath="tomcat.class.path"/>
<taskdef name="roles" classname="org.apache.catalina.ant.RolesTask" classpath="tomcat.class.path"/>
</target>
<target name="install" depends="create-tomcat-admin-tasks" description="install the war file on Tomcat">
<install url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${project}"
config="file:/${basedir}/${src.etc}/context.xml"
war="file:/${basedir}/${project}.war" />
</target>
<target name="remove" depends="create-tomcat-admin-tasks" description="remove the war file on Tomcat">
<remove url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${project}" />
</target>
<target name="reload" depends="create-tomcat-admin-tasks" description="reload the war file on Tomcat">
<reload url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${project}" />
</target>
<target name="deploy" depends="create-tomcat-admin-tasks" description="deploy the war file on Tomcat">
<deploy url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${project}"
config="file:/${basedir}/${src.etc}/context.xml"
war="file:/${basedir}/${project}.war" />
</target>
<target name="undeploy" depends="create-tomcat-admin-tasks" description="undeploy the war file on Tomcat">
<undeploy url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${project}" />
</target>
<target name="start" depends="create-tomcat-admin-tasks" description="start an application on Tomcat">
<start url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${project}"/>
</target>
<target name="stop" depends="create-tomcat-admin-tasks" description="stop an application on Tomcat">
<stop url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${project}" />
</target>
<target name="list" depends="create-tomcat-admin-tasks" description="list all applications running on Tomcat">
<list url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"/>
</target>
<target name="resources" depends="create-tomcat-admin-tasks" description="list all resources on Tomcat">
<resources url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"/>
</target>
<target name="data-sources" depends="create-tomcat-admin-tasks" description="list all data sources on Tomcat">
<resources url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
type="javax.sql.DataSource"/>
</target>
<target name="roles" depends="create-tomcat-admin-tasks" description="list all user roles on Tomcat">
<roles url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"/>
</target>
</project>
build.properties
# Properties file for setting up an Ant build.xml
# Project specific items that change each time
project=api-prototype
major=1
minor=0
version=${major}.${minor}
jar.name=${project}
versiondate=${TODAY}
# Directory structure (these should never change)
bin=bin
deploy=deploy
doc=doc
manifest=META-INF
xml=xml
# Everything under src should come out of a repository
src=src
src.bin=${src}/bin
src.config=${src}/config
src.data=${src}/data
src.dtd=${src}/dtd
src.java=${src}/java
src.lib=${src}/lib
src.profile=${src}/profile
src.properties=${src}/properties
src.schema=${src}/schema
src.sql=${src}/sql
src.templates=${src}/templates
src.testdata=${src}/testdata
src.xml=${src}/xml
src.xsl=${src}/xsl
# These are created and deleted by Ant each time
javadocs=javadocs
reports=reports
output=output
output.classes=${output}/classes
output.lib=${output}/lib
# Required for proper use of XDoclet
xdoclet.home = C:/Tools/xdoclet-1.2b3
build-web.properties
war.root=war-root
war.pages=${war.root}/pages
war.web=${war.root}/WEB-INF
war.classes=${war.web}/classes
war.css=${war.web}/css
war.js=${war.web}/js
war.lib=${war.web}/lib
war.tld=${war.web}/tld
# Properties needed by Tomcat tasks
ant.home =
tomcat.home =
tomcat.manager.url = http://localhost:8080/manager
tomcat.username =
tomcat.password = MOD
Maybe you are looking for
-
when i try to reply to a text and click the send button it just closes down my messages. and when i tap on my apps it just returns to my homescreen. i cant back-up my iphone and i have pictures etc that i dont want to lose through restoring it. pleas
-
Hello all..! I added a new contact to my iPhone 5, and after a day or two tried to find it from contacts. Resolt? NOWHERE..!! I made all steps, before i write this question here. Tried almost(!) every help i found at sites. but didn't work. Finally,
-
Production Order Print . table data in print output of order
Hi SAP Buddies Can any one tell me what are the steps required for setting the SFC print output. IMG setting for print output.. of SFC papers Actually my main purpose is to get TABLE : MARD and Field LGPBE to printed on Goods Issue Slip. Warm Regards
-
I'm using CS3 to create a series of XSL files to transform XML but when i'm in DW, in the bindings tab, when I create a fragment XSL and point it to attach to a remote source I get 'unable to locate or parse the xml source' I'm sure my source is corr
-
i have dv6 -2155 laptop. this laptop have integrated tv tuner but donot veiw the tv. because not found epg channel