RE: Debugging and orion

2001-02-22 Thread Ted Rice

 Hi,

 What tools / IDEs are people out there using to develop EJBs for use with
 Orion? At the moment we (as a project team, rather than company)
 are trying
 to standardise on an app server and IDE to use, requirements being the
 usual:

   cost
   speed
   flexibility
   resource usage
   debugging support from the IDE

you can pretty much use anu IDE you wish to employ for debuggin
if you use JDPA. i don't think orion is explicitly supported by
many IDEs, but if you start orion with something of the sort:

java -classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_
socket,server=y,suspend=n,address=5000 -jar orion.jar

you can then attatch via any IDE that supports remote debugging.

for example, with JBuilder 4, you can:

1. open the Run-Configurations menu
2. edit a configuration
3. click on the Debug tab
4. clic the enable remote debugging checkbox

then start orion with the command line above, open the
source you wish to debug in JBuilder, and then run the
runtime configuration where you setup remote debugging. set
your breakpoints and debug away.

hope this helps.

ted

---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 518859





RE: JSP TagLibs and UTF8 Encoding

2001-02-01 Thread Ted Rice
Title: SV: JSP TagLibs and UTF8 Encoding



I already have the following entry in my 
/orion/config/global-web-application.xml file:
orion-web-app jsp-cache-directory="./persistence" 
servlet-webdir="/servlet" development="true" default-charset="UTF-8"
In fact, in the resulting XXX.jsp.java file created, due to 
having the development attribute set to true,
this line of code appears:
response.setContentType("text/html;charset=UTF-8");
Therefore I 
believe the encodinding is getting set correctly. In fact the 
XML
files being 
imported by the JSP page have all been saved using UTF 8 
encoding
as well. The issue 
is that when i attempt to get the bodyContent, inside the
custom JSP Tag, 
the UTF8 characters become munged.


  What default encoding do you use for your webapp? 
  Could it be solved by just setting the default-charset to 
  UTF-8 in your orion-web.xml ? 
   I'm having an issue where a custom JSP BodyTag 
   used in JSP Pages is producing some undesirable 
   results. I am hoping someone out there has 
   already encountered a similar problem and can 
   point me in the right direction in solving mine. 
The issue is that my custom 
  JSP BodyTag is a wrapper  around JSP Code 
  producing UTF8 Encoded XML Content.  Portions of 
  this content is encoded in UTF8 because  they are 
  language resources and this is the only  way they 
  can be represented (e.g. ê and ? ). My JSP  Body 
  Tag Implementation takes the produced XML Content  
  and processes it against an XSL Style Sheet to produce  the desired display content. However, the UTF8 Characters 
   are being munged and not displayed correctly. 
The crux of the matter is 
  how do I maintain the encoding  of the produced 
  XML between the page being processed  and handing 
  it of to the XSL Parser for transformation.  
  Currently I am trying to use something of the nature:   StringReader 
  xmlReader = new  StringReader(bodyContent.getString().trim());  InputSource xmlInputSource = new 
  InputSource(xmlReader);   where the bodyContent is the standard internal JSP Tag 
  extension  member variable.   I then used the created InputSource 
  for any XML operations,  but my content still has 
  munged UTF8 characters.   Anyone have any suggestions?  
   Thanks Greatly, 
  ---Ted RiceAPAMA Ltd, 
  17 Millers Yard, Mill LaneCambridge CB2 1RQ, United 
  KingdomEmail: [EMAIL PROTECTED]Mobile: +44 (0)7899 
  876489Phone: +44 (0)1223 257973 [Histon 
  Office]Fax: +44 (0)1223 518859


RE: JSP TagLibs and UTF8 Encoding

2001-02-01 Thread Ted Rice


 Without knowing the details about your code: If you are using a
 standard XSL
 processor from your tag you should check that the output method setting of
 your XSL is correct. This is the output method I use to produce HTML, and
 you could modify it to produce the encoding you want:

   xsl:output method = "html"
   indent = "yes"
   encoding = "UTF-16"
   doctype-system = "http://www.w3.org/DTD/HTML4-strict-dtd"
   doctype-public = "-//W3C//DTD HTML 4.0//DA"
   media-type= "text/html"
 /

 Without this encoding my special characters get transformed aswell.
 I know this is not where you suggest the problem lies - but have
 you checked
 this issue?

Yes, thanks for this information.

The encoding in all of my xsl:ouput tags was set to my desired encoding:

xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/

I believe the real issue lies somewhere in the JSP Tag. What leads me
to this conclusion is a Servlet setup to filter XML content type, with
the exact XML and XSLT files used by the JSP Tag, works perfectly.
Therefore,
my conclusion is that the loss of encoding has something to do with
the way my BodyTag interface is processing the encoded XML. Does
this sound reasonable? If so, what are some gotchas that i should
pay attention too in side the JSP Tag Code?

Thanks grealty.

---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 518859






RE : JSP TagLibs and UTF8 Encoding - Further Info

2001-02-01 Thread Ted Rice



---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 51885 A little further information on my encoding
problem
 with the JSP Tags and XML translation.

 When I remove the JSP BodyTag wrapper around the
 JSP code producing XML, the XML is shown in the
 browser and all the UTF8 characters are displayed
 properly. Meaning that in the processing of the
 JSP the encoding is being preserved.

 However, in the JSP Tag Code, I have done the
 following test:

 public int doAfterBody() throws JspException {
   // _xmlContent is a member variable instance

 if (bodyContent == null){
   _xmlContent = "";
 }
 else{
   _xmlReader  = (InputStreamReader) bodyContent.getReader();

   logger.debug("Reader Encoding [ " +
 _xmlReader.getEncoding() + " ]");
 }

 return SKIP_BODY;
 }

 In my log file I see the following line:

 2001-02-01 10:12:28,902 [ApplicationServerThread] DEBUG Reader
 Encoding [ Cp1252 ]

 Meaning the encoding of the bodyContent reader is where the
 munging is occurring. Is there a way I can force the
 reader to use UTF8 encoding?

I have circumvented the problem of encoding being
lost via a hack. The code was:

  byte[] utf8Bytes = bodyContent.getString().trim().getBytes("Cp1252");
  ByteArrayInputStream stream = new ByteArrayInputStream(utf8Bytes);
  _xmlReader = new InputStreamReader(stream, "UTF-8");

This is going to be slow! I guess the real problem lies that
the Reader of the bodyContent is reading in Cp1252. How can
i force the Tag to read in UTF8?

Thanks.

---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 5188599





RE : JSP TagLibs and UTF8 Encoding - Further Info

2001-02-01 Thread Ted Rice

A little further information on my encoding problem
with the JSP Tags and XML translation.

When I remove the JSP BodyTag wrapper around the
JSP code producing XML, the XML is shown in the
browser and all the UTF8 characters are displayed
properly. Meaning that in the processing of the
JSP the encoding is being preserved.

However, in the JSP Tag Code, I have done the
following test:

public int doAfterBody() throws JspException {
// _xmlContent is a member variable instance

if (bodyContent == null){
  _xmlContent = "";
}
else{
  _xmlReader  = (InputStreamReader) bodyContent.getReader();

  logger.debug("Reader Encoding [ " + _xmlReader.getEncoding() + " ]");
}

return SKIP_BODY;
}

In my log file I see the following line:

2001-02-01 10:12:28,902 [ApplicationServerThread] DEBUG Reader Encoding [
Cp1252 ]

Meaning the encoding of the bodyContent reader is where the
munging is occurring. Is there a way I can force the
reader to use UTF8 encoding?

Thanks.


---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 518859





JSP TagLibs and UTF8 Encoding

2001-01-31 Thread Ted Rice

I'm having an issue where a custom JSP BodyTag
used in JSP Pages is producing some undesirable
results. I am hoping someone out there has
already encountered a similar problem and can
point me in the right direction in solving mine.

The issue is that my custom JSP BodyTag is a wrapper
around JSP Code producing UTF8 Encoded XML Content.
Portions of this content is encoded in UTF8 because
they are language resources and this is the only
way they can be represented (e.g.  and ? ). My JSP
Body Tag Implementation takes the produced XML Content
and processes it against an XSL Style Sheet to produce
the desired display content. However, the UTF8 Characters
are being munged and not displayed correctly.

The crux of the matter is how do I maintain the encoding
of the produced XML between the page being processed
and handing it of to the XSL Parser for transformation.
Currently I am trying to use something of the nature:

StringReader xmlReader   = new
StringReader(bodyContent.getString().trim());
InputSource  xmlInputSource  = new InputSource(xmlReader);

where the bodyContent is the standard internal JSP Tag extension
member variable.

I then used the created InputSource for any XML operations,
but my content still has munged UTF8 characters.

Anyone have any suggestions?

Thanks Greatly,

Ted

---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 518859





Mimicking Servlet Chaining in Orion

2001-01-30 Thread Ted Rice

I wish to micmic the functionality of
servlet chaining, easily achieved in Orion 1.3.8
via placing the following tags in the
global-web-application.xml file:

servlet-chaining servlet-name="XSLPainter" mime-type="text/xml"/
servlet-chaining servlet-name="XSLPainter"
mime-type="text/xml;charset=UTF-8"/

however, it is a requirment to use the Servlet 2.2 specifciation. Anyone
encountered this same problem and have suggestions to
the most transparent and efficient solution?

Thanks,

Ted Rice

---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 518859





Servlet Chaining/Forwading

2001-01-30 Thread Ted Rice

Please consider this scenario:

1. A JSP Page is processed, producing XML content.
2. The JSP Page producing this XML contains a JSP Tag Lib
   which extends the BodyTagSupport Interface. At the
   end of the Custom JSP Tag (which wraps the JSP code producing
   the XML), the generated XML is contained
   as a string inside the JSP Tag Library code.
3. A servlet has been established to handle XML Content,
   extract XSL Processing Instructions, and transform the XML content.
4. I wish to take the String contained inside the JSP Tag Library
   Code and dispatch it to the established servlet for handling
   inside a HttpServletRequest so that a HttpServletRequest.getInputStream()
   call will return properly formed XML InputStrem that can be parsed by
   an XML Parser.

Without using Servlet Chaining, Filters, or Session variables, how
can I achieve this?

Thanks in advance.

Ted Rice

---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]
Mobile: +44 (0)7899 876489
Phone:  +44 (0)1223 257973 [Histon Office]
Fax:+44 (0)1223 518859





Obtaining ApplicationAdministrator Refrence

2000-12-19 Thread Ted Rice

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

In an attempt to obtain a reference to the Administrator
inside Orion, i have written the following code in my client.

snip
Hashtable orionProps = new Hashtable();
orionProps.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.ApplicationClientInitialContextFactory");
orionProps.put(Context.PROVIDER_URL, "ormi://localhost");
orionProps.put(Context.SECURITY_PRINCIPAL, "admin");
orionProps.put(Context.SECURITY_CREDENTIALS, "123");
Context orionInitialContext = new InitialContext(orionProps);
Object obj= orionInitialContext.lookup("java:comp/Administrator"); 
-- !!EXCEPTION HERE!!
ApplicationAdministrator admin =
(ApplicationAdministrator)javax.rmi.PortableRemoteObject.narrow(obj,Ap
plicationAdministrator.class);
snip

Additionally, in my META-INF directory there are two 
XML files:

1) application-client.xml , containing:

?xml version="1.0"?
!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD
J2EE Application Client 1.2//EN"
"http://java.sun.com/j2ee/dtds/application-client_1_2.dtd"
application-client
display-nameOrionHealthClient/display-name
/application-client   

2) orion-application-client.xml, containing:

?xml version="1.0"?
!DOCTYPE orion-application-client PUBLIC "-//Evermind//DTD J2EE
Application-client runtime 1.2//EN"
"http://www.orionserver.com/dtds/orion-application-client.dtd"
orion-application-client
/orion-application-client

However, when i attempt to lookup the Administrator in the line
marked above,
i receive the following exception:

javax.naming.CommunicationException: Can't find SerialContextProvider

at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java
:60)
at
com.sun.enterprise.naming.SerialContext.init(SerialContext.java:79)

at
com.sun.enterprise.naming.SerialContext.init(SerialContext.java:89)

at
com.sun.enterprise.naming.java.javaURLContext.getComponentContext(java
URLContext.java:397)
at
com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.ja
va:51)  
at javax.naming.InitialContext.lookup(InitialContext.java:350)  
at
com.apama.orion.OrionHealth.aquireAdministratorHome(OrionHealth.java:4
3)  
at com.apama.orion.OrionHealth.init(OrionHealth.java:26)  
at
com.apama.orion.test.HealthTestHarnass.main(HealthTestHarnass.java:21)

Could someone please point out my mistake.

thanks.
- ---
Ted Rice
APAMA Ltd, 17 Millers Yard, Mill Lane
Cambridge CB2 1RQ, United Kingdom
Email:  [EMAIL PROTECTED]

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 6.5.8 for non-commercial use http://www.pgp.com

iQA/AwUBOj8+70OGthGnWDSOEQKmegCfeOAPIB1DiEp7uWMs1ufsv2UbBcUAoOXq
2EA7hXNA8dlYwSVqvuqTFBib
=ep++
-END PGP SIGNATURE-





Servlet Caching Bug?

2000-10-26 Thread Ted Rice

We've experienced what we believe to be
a bug with Orion in terms of Servlet Caching.
The situation is detailed here:

1. We've setup a servlet as a filter for xml, by
   editing orion's global-web-application.xml thusly:

servlet-chaining servlet-name="XSLPainterServlet" mime-type="text/xml"/
servlet
servlet-nameXSLPainterServlet/servlet-name
servlet-classcom.apama.xsl.XSLPainterServlet/servlet-class
/servlet



2. Additionaly, we've edited orion's application.xml thusly:
library path="../../dev/ApplyXSLServlet"/

   and a jar file is placed in this directory containing the
XSLPainterServlet
   file.


We've tested this with an XML file and it works fine.

The problem is when we recompile the class file and rebuild the JAR file
while
Orion is running, the new servlet is not used. Orion continues to use the
old
servlet in memory.

Is there anyway to hot-redeploy servlets without explicitly restarting
orion?

Thanks,

Ted Rice






Debugging EJBs running in Orion with JBuilder

2000-10-24 Thread Ted Rice

Has anyone out there documented the 
process of debugging EJBs, via the JBuilder 4 IDE,
running within the Orion EJB Continer?

If so, could you please mail them to this list.

Thanks,

Ted Rice