Cann't run example of transformXML in XML dic of jstl1.1 standard-examples
Today while learning JSP's transform mechanism using JSTL, i found that the example of transformXML in XML dic of jstl1.1 standard-examples could not be run, the error message followed as:
javax.servlet.ServletException: org/apache/xml/serializer/SerializerTrace
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.xml.TransformWithInclusion_jsp._jspService(org.apache.jsp.xml.TransformWithInclusion_jsp:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/xml/serializer/SerializerTrace
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1650)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:856)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1305)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
org.apache.xalan.processor.ProcessorStylesheetElement.getStylesheetRoot(ProcessorStylesheetElement.java:121)
org.apache.xalan.processor.ProcessorStylesheetElement.startElement(ProcessorStylesheetElement.java:72)
org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:623)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:920)
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:774)
org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag(TransformSupport.java:145)
org.apache.jsp.xml.TransformWithInclusion_jsp._jspx_meth_x_transform_0(org.apache.jsp.xml.TransformWithInclusion_jsp:180)
org.apache.jsp.xml.TransformWithInclusion_jsp._jspService(org.apache.jsp.xml.TransformWithInclusion_jsp:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
it seems that the class "org.apache.xml.serializer.SerializerTrace" is missing, is it? and i have add the path of "xalan.jar" in xalan-j_2_7_0 dic to the "CLASSPATH" enviroment parameter, but the class of "org.apache.xml.serializer.SerializerTrace" could not be found at that xalan.jar file.
could anyone help me overcome this error, thanks.
I met the same probem as you. Finally, I sove it. You can do as follows:
Put serializer.jar, xercesImpl.jar and xml-apis.jar into classpath also or put them into ANT_HOME/lib.
It is not enough to put xalan.jar only as some guid said:-), you need put all the jar files existed in <xalan-j_2_7_0> after you unzip the xalan-j_2_7_0-bin.zip file.
Good luck.
--Xu He.
Similar Messages
-
TextAnim - i need a running example. and please hurry :)
hi y'all,
i urgently need help with something which should be very straightforward:
i am unable to use TextAnim - no matter what. could anyone please send me a complete source code of a running example?
whatever i do - i run into an exception or a compile error. (for example - addChild cannot be used in SDK4.0 but i cannot use something else with the TextField component).
some TextAnim tutorial:
http://www.actionscript.org/forums/showthread.php3?t=226682
and the project website:
http://code.google.com/p/textanim/
so please send a running source code. much appreciated!
thanks,
ronnieok, progress was made - thanks for the tip Ben!
on SDK 4.1 it now compiles and runs but the screen stays white. following is the complete MXML code, feedback will be VERY welcome.
thanks,
r.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
initialize="application1_initializeHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import caurina.transitions.*;
import flash.text.*;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flupie.textanim.*;
import mx.events.FlexEvent;
function myEffect(block:TextAnimBlock):void {
block.scaleX = block.scaleY = 0;
block.rotation = -120;
Tweener.addTween(block, {rotation:0, scaleX:1, scaleY:1, time:.5, transition:"easeoutback"});
protected function application1_initializeHandler(event:FlexEvent):void
var myTextField:TextField = new TextField();
myTextField.x = 100;
myTextField.y = 200;
myTextField.htmlText = "TextAnim <font color=\"#FF0000\">Maker!</font> Lorem ipsum<br>tashin ishi quiring din.";
myTextField.autoSize = "left";
myTextField.embedFonts = true;
con.addChild(myTextField);
var txtanim:TextAnim = new TextAnim(myTextField);
txtanim.interval = 7;
txtanim.blocksVisible = false;
txtanim.effects = myEffect;
txtanim.start();
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:SpriteVisualElement id="con" />
</s:Application> -
Tomcat 4.0 can run example but cannot run my servlet!
I can run examples (both servlet and JSP) under Tomcat.
Now I have servlets class file in
C:\jakarta-tomcat-4.0.1\webapps\vpsystem\WEB-INF\classes\agent\bookmark\BookMark.class
but I cannot see "http://localhost:8080/vpsystem/agent/bookmark/BookMark" in IE.It tell me no resource found.
It's the matter of web.xml?It's the matter of server.xml?Or any another?
Please someone help me out.
Thanks!Maybe both. You should show how you have configured the web application in server.xml and the servlet in web.xml in order to be able to help you
-
I cann't run web browser on my xi host
Hi Guru's,
I have installed XI(3.0) successfully on Windows 2003 then went for post installation.I need to be importing the exchange proile.I cann't run a web browser on my XI host using this URL http://<j2ee_host>:<j2ee_port>/exchangeporile.How
can i copy the file exchange_proile.xml from the XI to a host were a web browser runs.
I have stucked the importing exchangeprofile,so could anybody please help on this regard.
Regards,
Venkat.Hi -
Are you sure you have the right j2ee port in the URL? To confirm, you can check SMICM->Goto->HTTP Server->Display Data for the J2EE HTTP port.
The URL for exchangeProfile is http://<j2ee_host>:<j2ee_port>/exchangeProfile
<i>>>>can i copy the file exchange_proile.xml from the XI to a host were a web browser runs.</i>
Yes, you can do that (e.g. copy the xml to your local pc, access exchangeProfile URL and import).
Regards,
Jin -
As10g ver10.1.2 report server cann't run in aix ver5.3 system
Hi,all
IBM computer
aix ver5.3 system
as10g ver10.1.2
Report server cann't run,other servers work well,
the same verion application server 10g be installed in windows system,all servers include report server work well.
Why report server don't work in aix system?
Thanks for any help!
Message was edited by:
user565112Hello,
Note.298175.1 Reports Server Fails To Start on AIX 5.3 in-process and Standalone
Regards -
Workstation cann't run .asp on IIS after installed ZEN agent
Hello,
I have Windows XP sp2 on workstation. I run .asp application on IIS. When i
installed Zenwork Desktop Agent (6.5). I cann't run .asp file. I reinstall IIS on
workstation. It's not work.
thank you
mooChanthep,
It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.
Has your problem been resolved? If not, you might try one of the following options:
- Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
- Check all of the other support tools and options available at
http://support.novell.com.
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://support.novell.com/forums)
Be sure to read the forum FAQ about what to expect in the way of responses:
http://support.novell.com/forums/faq_general.html
If this is a reply to a duplicate posting, please ignore and accept our apologies
and rest assured we will issue a stern reprimand to our posting bot.
Good luck!
Your Novell Product Support Forums Team
http://support.novell.com/forums/ -
PlatForm :IBM630
Operation System: AIX 5L
IAS version :10.1.2.0.2
Language :SIMPLIFIED CHINESE_CHINA.ZHS16GBK
opmnctl startall, report instance cann't run,and the report instance will restart every several minutes,then the form instance will restart following the report instance.
When ias installed in window system,all instances will work,
the same verison ias installed in AIX 5L,then the report install cann't work,why?
Do it need some special config?
The report instance work at same config at some time,one week later report called from form is not done,throw a error rep-300,
but the test.rdf can run in internet explorer address with "http://report_servername:7778/reports/rwservlet?report=test.rdf&destype=cache&desformat=pdf&userid=username/psw@db",
that is say the report instance can work.
How can I solve the problem?
Thanks for any help!
lind
email:[email protected]please give me some advice.
thanks for any help.
user565112 -
The attached VI works when I run it initially creating the XML file, but when I change data and run after the XML file is created, it's not updated with new data. What am I doing wrong?
Thank you.
Solved!
Go to Solution.
Attachments:
Attractive Force XML.vi 23 KBThat looks like the logic which was written into the VI
Inner true/ false case:
(file exists : false) write to XML file, unflatten for display
(file exists : true) read from XML file, unflatten for display
At no time when the file exists (true case) is the XML file updated... -
Running examples from J2EE Tutorial
Has anyone been successfully running examples from
J2EE Tutorial on Creator?
I tried to import the JSP but Creator complains that it is
not an XHTML document. Clicking on the 'Convert to XHTML'
button or 'Preview...' button does not seem to do anything.
Openning the Source panel shows parsing problems on
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
Does anyone know how to run these in Creator correctly?
- weijyhYes,
It runs successfully....
I have download the examples from Sun,
unzipped It into my Projektfolder and open it in Creator, start it and works fine ...
No error messages .... -
Cann't run the examples in dir "webapps\standard-examples\xml" of jstl1.1.2
i'm learning jstl.
fisrtly i downloaded the jstl1.1.2 zip file and upziped it, then i put the standard-examples.war file to the webapps dir of tomcat5.5 to run the examples.
now i could run some of those examples, but strangely i could not run the example of the directory of "standard-examples\xml". if i try to run, an error as follows will emerg:
javax.servlet.ServletException: org/apache/xpath/VariableStack
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.xml.Parse_jsp._jspService(org.apache.jsp.xml.Parse_jsp:90)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/xpath/VariableStack
org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:63)
org.apache.jsp.xml.Parse_jsp._jspx_meth_x_out_0(org.apache.jsp.xml.Parse_jsp:168)
org.apache.jsp.xml.Parse_jsp._jspService(org.apache.jsp.xml.Parse_jsp:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Could anyone give me some advices to deal with this problem? ThanksLOL.... i ran into the same problem with Tomcat 5.5... it's quite an idiotic problem cuz like you gotta hunt everywhere to figure out why it don't work... reason is cuz those brainchildren at Apache.org who make Tomcat also make the missing Jar file but forgot to include it with Tomcat... duh... :-p
any way... visit this site... http://xml.apache.org/xalan-j/
download the zip file and extract it (follow the instructions)
you only need to copy the xalan.jar file to your Tomcat 5.5's <installpath>\common\lib folder...
then that problem will be fixed...
have fun... :-p
- MaxxDmg...
- ' He who never sleeps... ' -
PL/SQL XML Parser - problem running example
Oracle 8.1.5 database on NT
When i try running the example with command:
SQL*Plus> exec domsample
('//SERVER_03/ORACLE/xml_tmp','family.xml', 'err.txt');
I get the following error:
ERROR at line 1:
ORA-20100: Error occurred while parsing:
//ORACLE/xml_tmp/err.txt
ORA-06512: at "OEF1_MGR.XMLPARSER", line 43
ORA-06512: at "OEF1_MGR.XMLPARSER", line 120
ORA-06512: at "OEF1_MGR.DOMSAMPLE", line 80
ORA-06512: at line 1
If i use backward-slashes '\' which should be OK for NT i get:
ORA-20100: Error occurred while parsing:
\\ORACLE\xml_tmp/err.txt
I tried using a directory (create directory ...) but this
results in the same error.
Thus anyone now how it should be done?
Thanks
nullThe use of "//" or "\\" appears to be a bug in JServer. It has
been filed. You should not specify the path as a shared
directory as a workaround.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Andre (guest) wrote:
: Oracle 8.1.5 database on NT
: When i try running the example with command:
: SQL*Plus> exec domsample
: ('//SERVER_03/ORACLE/xml_tmp','family.xml', 'err.txt');
: I get the following error:
: ERROR at line 1:
: ORA-20100: Error occurred while parsing:
: //ORACLE/xml_tmp/err.txt
: ORA-06512: at "OEF1_MGR.XMLPARSER", line 43
: ORA-06512: at "OEF1_MGR.XMLPARSER", line 120
: ORA-06512: at "OEF1_MGR.DOMSAMPLE", line 80
: ORA-06512: at line 1
: If i use backward-slashes '\' which should be OK for NT i get:
: ORA-20100: Error occurred while parsing:
: \\ORACLE\xml_tmp/err.txt
: I tried using a directory (create directory ...) but this
: results in the same error.
: Thus anyone now how it should be done?
: Thanks
null -
Error while running a sample XSQL from XML bible book from Steve Muench
I am running the sample XSQL code from Chapter 03, which deals with exporting XML and transform into SQL statements. I'm using JDeveloper and I believe I've setup libraries and HTML root directory etc. I'm getting the following error:
XSQL-011 Error processing XSLT stylesheet.
XSL-1009 Attribute xsl:version not found in xsl:stylesheet.
Can I get some help in fixing this error?
Thanks a lot,
Murali
nullHi,
This is the example I took from Steve Muench's book.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
</xsl:template1>
</xsl:stylesheet>
As you can see, I do have the version=1.0 attribute. Why is it complaining still? -
Messaging Server commadmin and running example programs
Hi
1.I am trying to add users to SunMessaging Server (i have installed the identity server and can login to the console ), when i use the commadmin command i Get a Internal server error , the following is the Error in the server Logs
2. There are some particluar examples that come with the messaging server , they are in the directory examples (hello_world.c) ... i am unable to compile them ...i get a linking error as given below (after the messaging server error)
SEVERE (10997): StandardWrapperValve[commLDAPAuth]: Servlet.service() for s
ervlet commLDAPAuth threw exception
javax.servlet.ServletException: com.sun.identity.authentication.spi.AuthLoginException: null
Failed to create New AuthContext: Error while processing XML request
XML response is either Empty or Invalid
at sun.comm.cli.server.servlet.commAuth.execute(commAuth.java:183)
at sun.comm.cli.server.servlet.commServlet.doPost(commServlet.java:90)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve
.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
Compile using
gcc hello_world.c -I/opt/SUNWmsgsr/include/ -L/opt/SUNWmsgsr/lib/ -limta -lsocket -lgen -lintl -lnsl -lpthread -lc -ldl -lposix4 -lm
Undefined first referenced
symbol in file
mtaErrno /var/tmp//ccKjYt2c.o
mtaEnqueueTo /var/tmp//ccKjYt2c.o
mtaEnqueueStart /var/tmp//ccKjYt2c.o
mtaEnqueueWriteLine /var/tmp//ccKjYt2c.o
mtaPostmasterAddress /var/tmp//ccKjYt2c.o
mtaDone /var/tmp//ccKjYt2c.o
mtaInit /var/tmp//ccKjYt2c.o
mtaDateTime /var/tmp//ccKjYt2c.o
mtaEnqueueFinish /var/tmp//ccKjYt2c.o
mtaStrError /var/tmp//ccKjYt2c.oI'm not sure what exactly you're trying to do.
Once you install commcli, you should be able to use the command-line tools. They work, but you have to have been consistant in giving answers to all the questions asked.
You also may not share the amadmin password with any other password. It must be unique.
There is no need to compile anything to get Messaging Server to work, or to provision it with commcli. -
I can't run example from JEE5tutorial - books
OS- Linux
NetBeans 5.5.1 ( with ant 1.7 )
ant 1.6
I tried run:
ant 1.6
[root@zet books(0)]# ant create-tables
Buildfile: build.xml
BUILD FAILED
/home/marcin/3ROK/1SEM/java1/javaeetutorial5/examples/web/books/build.xml:49: The following error occurred while executing this line:
/home/marcin/3ROK/1SEM/java1/javaeetutorial5/examples/bp-project/main.xml:20: Class org.apache.tools.ant.taskdefs.ConditionTask doesn't support the "else" attribute.
Total time: 1 secondon ant 1.7
[root@zet books(0)]# /usr/local/netbeans-5.5.1/ide7/ant/bin/ant create-tables
Unknown argument: -cp
ant [options] [target [target2 [target3] ...]]
Options:
-help, -h print this message
-projecthelp, -p print project help information
-version print the version information and exit
-diagnostics print information that might be helpful to
diagnose or report problems.
-quiet, -q be extra quiet
-verbose, -v be extra verbose
-debug, -d print debugging information
-emacs, -e produce logging information without adornments
-lib <path> specifies a path to search for jars and classes
-logfile <file> use given file for log
-l <file> ''
-logger <classname> the class which is to perform logging
-listener <classname> add an instance of class as a project listener
-noinput do not allow interactive input
-buildfile <file> use given buildfile
-file <file> ''
-f <file> ''
-D<property>=<value> use value for given property
-keep-going, -k execute all targets that do not depend
on failed target(s)
-propertyfile <name> load all properties from file with -D
properties taking precedence
-inputhandler <class> the class which will handle input requests
-find <file> (s)earch for buildfile towards the root of
-s <file> the filesystem and use it
-nice number A niceness value for the main thread:
1 (lowest) to 10 (highest); 5 is the defaultA possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
*http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
What happens if you open Firefox in Save mode?
*https://support.mozilla.com/kb/Safe+Mode
*Help > Restart with Add-ons Disabled -
J2EE client cann't run: javax.naming.NameNotFoundException
I am trying to run converter example in Sun's J2ee tutorial, relavant files are put in directories like the following, I have no problem with compiling, but when I run the client, there are error msgs:
Caught an unexpected exception!
javax.naming.NameNotFoundException: No object bound for java:comp/env
at com.sun.enterprise.naming.java.javaURLContext.lookip(javaURLContext.java:116)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at ConverterClient.main(Unknow Source)
since I didn't use deploytool provided by j2ee, I am not sure if the problem was caused by my deployment descriptor or naming server, I don't know what "java:comp/env" is, would anyone help? Thanks!!!
The relevant files are as the following, except the ConverterClient.java and ejb-jar.xml, others are exactly the same as that in j2ee tutorial
/mydir/javaprog/build/converter/Converter.class
ConverterHome.class
ConverterBean.class
ejb-jar.xml
/mydir/javaprog/client/converter/ConverterClient.class
/mydir/javaprog/lib/converter.jar
/*Converter.java*/
import javax.ejb.EJBObject;
import java.rmi.RemoteException;
import java.math.*;
public interface Converter extends EJBObject {
public BigDecimal dollarToYen(BigDecimal dollars) throws RemoteException;
public BigDecimal yenToEuro(BigDecimal yen) throws RemoteException;
/*ConverterHome.java*/
import java.io.Serializable;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
public interface ConverterHome extends EJBHome {
Converter create() throws RemoteException, CreateException;
/*ConverterBean.java*/
import java.rmi.RemoteException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import java.math.*;
public class ConverterBean implements SessionBean {
BigDecimal yenRate = new BigDecimal("121.6000");
BigDecimal euroRate = new BigDecimal("0.0077");
public BigDecimal dollarToYen(BigDecimal dollars) {
BigDecimal result = dollars.multiply(yenRate);
return result.setScale(2,BigDecimal.ROUND_UP);
public BigDecimal yenToEuro(BigDecimal yen) {
BigDecimal result = yen.multiply(euroRate);
return result.setScale(2,BigDecimal.ROUND_UP);
public ConverterBean() {}
public void ejbCreate() {}
public void ejbRemove() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void setSessionContext(SessionContext sc) {}
} // ConverterBean
/*ConverterClient.java*/
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.math.BigDecimal;
public class ConverterClient {
public static void main(String[] args) {
try {
Context initial = new InitialContext();
Context myEnv = (Context)initial.lookup("java:comp/env");
Object objref = myEnv.lookup("SimpleConverter");
ConverterHome home =
(ConverterHome)PortableRemoteObject.narrow(objref,
ConverterHome.class);
Converter currencyConverter = home.create();
BigDecimal param = new BigDecimal ("100.00");
BigDecimal amount = currencyConverter.dollarToYen(param);
System.out.println(amount);
amount = currencyConverter.yenToEuro(param);
System.out.println(amount);
System.exit(0);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
<description>Converter Application</description>
<display-name>Converter EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>SimpleConverter</ejb-name>
<home>ConverterHome</home>
<remote>Converter</remote>
<ejb-class>ConverterBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>I have such a problem with Bea weblogic 6.1 EJB Server, trying to connected it from Tomcat (don't know, if it would work anyway):
If I try to lookup with standard "java:comp/env/ejb/ObjRemote", it tell's me there is no comp/env/ejb Object !
All examples/docu I read for this topic told me to call lookup("ObjRemote").
So look it up this way: simply with this name lookup("ObjRemote")...
Maybe you are looking for
-
How to generate Simulation Report in BPM Suite 11g?
I cann't find the "Generate Report" buttion in the Simulation toolbar in the BPM Studio 11g. The current version is: Component Version ========= ======= ADF Business Components 11.1.1.56.60 BPMN Editor 11.1.1.3.0.6.84 Java(TM) Platfor
-
Maximum harddrive size for the
I have the hp pavilion slimline s3712f and my SATA internal harddrive crashed. What is the maximum size that I can intall in this system? I have my system restore disc. This question was solved. View Solution.
-
Can Message be used instead of Lyncs
So at work, we use Outlook and Lyncs. And I know you can add facebook chat and other things through Jabber to the message app, but can I add my microsoft Exchange account so that I could use OS X's Messages instead of using Microsofts version of Lync
-
I, as i'm sure everyone else does, have some artists in my music library with multiple albums. since i've downloaded ios7, my iPhone arranges these albums by release date and not alphabetically. it's really offputting because i can't remember when ev
-
I own the first iPad. I've got a Camera Connection Kit. Can I used it with the first iPad.