RE: JDBC try/catch Pitfall ***MUST READ***

2002-04-10 Thread Jens Schumann

- Retry -

I don't know if there are any issues with finally clauses - at least you
should not wrap all close() in your finally block within _one_ try/catch
clause. Use e.g. a static helper class which encloses every close() in a
separate try/catch block. I have never had any issues by doing so -
especially in case of buggy oracle jdbc drivers.

Jens

| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of Greg Davis
| Sent: Tuesday, April 09, 2002 4:56 PM
| To: Orion-Interest
| Subject: JDBC try/catch Pitfall ***MUST READ***
|
|
| This deals with try/catch blocks and finallys. I always believed that "no
| matter what" a finally block is always called.  While this seems to remain
| true, it does not seem to necessarily properly call the code within the
| block.  In the section below I have some code and explanation of how a
| finally gets called, but does not execute the code within.
|
| There seems to be an issue with closing a JDBC connection if a method
| returns in the middle of the try/catch block.  It seems to call
| the finally,
| but does not close the connection.  It does seem to call static
| methods like
| System.out.println() perfectly fine.  I don't know if it being static has
| anything to do with it.  I haven't researched it too far since it
| was really
| hard to find.  First off you have to have a Factory like a ConnectionPool
| that spawns out inscances of an object for other classes to use. Then it
| must need to have the user close it's connection at some point so the
| Factory can control resources. The only example I really have on hand is a
| JDBC connection pool in a J2EE app server.  This is where the
| problem occurd
| for us.  If the methods "returns" are moved outside the try/catch
| block, the
| Connection.close() happens properly and the ConnectionPool does not
| complain.
|
| I realize the getColumnClose() is the better way to implement the code
| ayway, but I wanted to show everyone this problem in case they
| accidentally
| do it in their code somewhere.  Any returns in the try or catches
| seemed to
| make the finally not be properly executed. I seem to remember some wierd
| rule about this at JavaOne last year, but my head is still racing from all
| that information. :-)
|
| Any comments?
|
| package test;
|
| import java.sql.*;
| import javax.sql.DataSource;
| import javax.naming.*;
|
| /**
|  * Title: TryCatchTest
|  * Description: This is a test application for try/catch problem.  If
| using
|  * a Connection Pool in JDBC and you try to "return" a value within a
| try/catch
|  * that is inside a method, the finally of that try/catch is not
| completely
| run.
|  * It seems to go through the finally(I.E. Sytem.out.println() works, but
| the
|  * Connection.close() is either never called or not executed.  If the
| "return"
|  * is moved to the outside of the catch block, the connection is properly
| closed.
|  * 
|  * We found this because a J2EE server which had a connection pool was
| telling
|  * us we were not closing our connections.  I dn't know if there is some
| rule that
|  * when a "return" has been called only static methods or something like
| that can
|  * be called.
|  * Copyright: Copyright (c) 2002
|  * Company: Western Electronics 
|  * @author Greg Davis
|  * @version 1.0
|  */
|
| public class TryCatchTest
| {
|   Context jndiContext;
|
|   public TryCatchTest()
|   {
| try
| {
|   jndiContext = new InitialContext();
| }
| catch(NamingException ne)
| {}
|   }
|
|   public String getColumnNoClose()
|   {
| Connection conn = null;
| PreparedStatement ps = null;
| ResultSet rs = null;
| try
| {
|   String sql ="SELECT table_name FROM sequence";
|   conn
| =((DataSource)jndiContext.lookup("jdbc/mySourceDS")).getConnection();
|   ps = conn.prepareStatement(sql);
|   rs = ps.executeQuery();
|   if(rs != null && rs.next())
|   {
| //This return causes the ?non-static? code within the
| finally to not
| to be run.
| return rs.getString("table_name");
|   }
|   //same here, the finally ?non-static? code is not called.
|   return null;
| }
| catch(NamingException ne)
| {
|   //same here, the finally ?non-static? code is not called.
|   return null;
| }
| catch(SQLException sqle)
| {
|   sqle.printStackTrace();
|   //The same problem occurs here.  The finally ?non-static?
| code is not
| called
|   return null;
| }
| finally
| {
|   //This system out works, but the conn.close() does not.
| The only way
| I
|   //know how to check this is to create a ConnectionPool yourself that
| watches
|   //the connections it spawns out, or user a pre-built one
| that does the
| same.
|   //We use Orion 1.5.4 J2EE App server (free for development). if you
| want
|   //to test this out.
|   System.out.println("Finally called in noClose()");
|   try
|   {
| 

RE: timed events

2002-03-14 Thread Jens Schumann

Just one hint:
Set the classloader before calling start() for your thread to the
classloader of the servlet and you will not have issues on several other
commercial platforms.

Jens

| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of
| [EMAIL PROTECTED]
| Sent: Thursday, March 14, 2002 7:49 AM
| To: Orion-Interest
| Subject: RE: timed events
|
|
| Jens,
|
| Unfortunately, you're correct :-(. It is not portable for exactly what you
| have written (Context issues), but for Orion it is pretty simple and
| straightforward.
|
| Tibor
|
| -Original Message-
| From: Jens Schumann [mailto:[EMAIL PROTECTED]]
| Sent: Wednesday, March 13, 2002 11:15 PM
| To: Orion-Interest
| Subject: RE: timed events
|
|
| Which is not that portable across Application Servers ;)
| Typical issues are JNDI lookup problems up to ClassCastExceptions.
|
| Jens
|
| | -Original Message-
| | From: [EMAIL PROTECTED]
| | [mailto:[EMAIL PROTECTED]]On Behalf Of
| | [EMAIL PROTECTED]
| | Sent: Wednesday, March 13, 2002 5:21 PM
| | To: Orion-Interest
| | Subject: RE: timed events
| |
| |
| | Hi,
| |
| | I use a java.util.Timer wrapped my Scheduler class to schedule
| | tasks. I bind
| | an instance of this Scheduler to the JNDI from one of my
| servlet's init()
| | method.
| |
| | It works fine, use -userThreads switch to start orion if you
| want context
| | lookup from the scheduled threads.
| |
| | HTH,
| |
| | Tibor
| |
| | -Original Message-
| | From: daniele rizzi [mailto:[EMAIL PROTECTED]]
| | Sent: Wednesday, March 13, 2002 2:25 PM
| | To: Orion-Interest
| | Subject: R: timed events
| |
| |
| |
| | Hi Casper,
| |
| | EJB are not multithreaded but a normal class *is*.
| |
| | Try putting the stuff in a public class TryMe extends Thread{}
| |
| | d.
| |
| | ps. if you need a scheduler the things are tougher.
| |
| |
| |
| | -Messaggio originale-
| | Da: [EMAIL PROTECTED]
| | [mailto:[EMAIL PROTECTED]]Per conto di Casper
| | Højstrup
| | Inviato: mercoledì 13 marzo 2002 10.21
| | A: Orion-Interest
| | Oggetto: timed events
| |
| |
| |
| | This more of a regular EJB question, I suppose.
| |
| | I need to initiate some specific tasks and specific times in my
| | application,
| | since the application server aren't multithreaded(so to speak), and the
| | usage of threads is not recommended, I cannot make a simple
| | timer, that will
| | initiate the appropriate procedures at a given time.
| | How do one solve such problems in an EJB application ?
| |
| | Regards
| | .
| |
|





RE: timed events

2002-03-13 Thread Jens Schumann

Which is not that portable across Application Servers ;)
Typical issues are JNDI lookup problems up to ClassCastExceptions.

Jens

| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of
| [EMAIL PROTECTED]
| Sent: Wednesday, March 13, 2002 5:21 PM
| To: Orion-Interest
| Subject: RE: timed events
|
|
| Hi,
|
| I use a java.util.Timer wrapped my Scheduler class to schedule
| tasks. I bind
| an instance of this Scheduler to the JNDI from one of my servlet's init()
| method.
|
| It works fine, use -userThreads switch to start orion if you want context
| lookup from the scheduled threads.
|
| HTH,
|
| Tibor
|
| -Original Message-
| From: daniele rizzi [mailto:[EMAIL PROTECTED]]
| Sent: Wednesday, March 13, 2002 2:25 PM
| To: Orion-Interest
| Subject: R: timed events
|
|
|
| Hi Casper,
|
| EJB are not multithreaded but a normal class *is*.
|
| Try putting the stuff in a public class TryMe extends Thread{}
|
| d.
|
| ps. if you need a scheduler the things are tougher.
|
|
|
| -Messaggio originale-
| Da: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]Per conto di Casper
| Højstrup
| Inviato: mercoledì 13 marzo 2002 10.21
| A: Orion-Interest
| Oggetto: timed events
|
|
|
| This more of a regular EJB question, I suppose.
|
| I need to initiate some specific tasks and specific times in my
| application,
| since the application server aren't multithreaded(so to speak), and the
| usage of threads is not recommended, I cannot make a simple
| timer, that will
| initiate the appropriate procedures at a given time.
| How do one solve such problems in an EJB application ?
|
| Regards
| .
|





RE: Performance Monitoring Tools

2002-03-12 Thread Jens Schumann

Although it might sound strange I do not believe in low level tools such as
OptimzeIt on EJB level - first stage. Usually you end up using a component
based framework which might be distributed and EJB overhead just changes
results significantly. We switched to a simple set of classes which measure
response time on component level and watch it under load. In most cases we
are able to locate our hot spots easily. I can not release these classes to
public - just think about something which allows you to mark the beginning
and the end of a "transaction", measure the time in between - and cumulate.

Hope this helps,
Jens




| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of Cugier
| (extern)
| Sent: Tuesday, March 12, 2002 3:25 PM
| To: Orion-Interest
| Subject: Performance Monitoring Tools
|
|
| Hello,
|
| we are planning to perform some load tests against our
| application (Servlet,
| JSP and EJBs). We have found some tools that will create the load on the
| server and will monitor the response times. But we haven't found anything
| that can be used to monitor Orion's behaviour during the test.
| What we want
| to monitor is the memory consumption, CPU usage, Sessions etc.
| What is important is that we can record what we monitor so we will be able
| to look at the resutls of the test later.
|
| Does anyone has a recommendation for a tool that we can use?
|
| Thanks
|
| Peter





RE: modeling tool

2002-02-26 Thread Jens Schumann

Just a personal opinion:

One or more licenses of Together Control Center (for your architects/ system
designers) and Intellij Idea for every developer are pretty much what you
need to make a server side project successful. This assumes that the
framework you try to implement supports your developers and not your UML
Tool. Just in case Together is too expensive spend some time on your
architecture and you may not need what you are looking for - the key is KISS
;)

french_c


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Vinícius de Faria
Silva
Sent: Tuesday, February 26, 2002 9:29 PM
To: Orion-Interest
Subject: modeling tool


Hey guys, i'd like to hear your comments about this situation.
My team has a well defined development process, for developing j2ee web
apps. This is a lightweight process based on uml diagrams. Our Java IDE is
JDeveloper9i and we are happy about it. We need now to get a uml graphical
modeling tool, which support the analisys/design phases of the development
process. JDeveloper9i doesn't support all the uml diagrams we need. At the
same time we don't want to spend a lot of money with a tool that will bring
much more than we need(process development, java IDE and so on).
I'm wondering to know what you guys think about it...

thanks in advance,

Vinícius





RE: Wow. It seems that 1.5.4 is released!!!

2002-02-15 Thread Jens Schumann

See changes.txt.

-- 1.5.4 --
Added support for local interfaces
Added support for many to many relationships
Added support for cascade-deletes
Added support for automatic primary keys (primary key class set to
java.lang.Object)
Added windows security workaround patch
Fixed #188 JMS publish messages for autostarted clients
Fixed #197 finder method for non-existent ejb is not detected
Fixed #348 Class-Path: ignored in (unpacked) ejb-jar Manifest file
Fixed #349 Orion crashes when using primary keys in an incorrect way
Fixed #418 Class _yw has missing access specifier
Fixed #480 Remote JMS Subscriber TopicConnection.start() hangs
Fixed #493 JMS TextMessage with not text gives nullpointer exception wh...
Fixed #495 staleness parameter in DataSourceUserManager not implemented
Fixed #511 Problem receiving messages from a TopicSubscriber when run a...
Fixed #515 Tag library variable declaration
Fixed #531 EJB 2.0 PFD 2 feature  not implemented properly
Fixed #532 findByPrimaryKey fails when EJB has
exclusive-write-access="false"
Fixed #533 Taglib null parameters are handed as "null"
Fixed #534 Wrong exception when roleManager.addToRole(...) is called with a
null argument
Fixed #541  tag doesn't conform to sun dtd
Fixed #568 incorrect max-tx-retries default
Fixed #569 Can't map servlet to *.db.htm
Fixed #575 Incorrect security exception when using JNDI
Fixed #576 array return types from taglibs not handled correctly
Fixed #582 ServletContext.getRequestDispatcher() handles non-existing JSP
Fixed #587 call to MessageDrivenContext.setRollbackOnly fails
Fixed #593 Can't send JMS messages from the init() method of a servlet
Fixed #611 CGI servlet errors
Fixed #619 Problem with HttpSession.invalidate()
Fixed #620 request.getServletPath() returns null if servlet is handling...
Fixed #626 Problem with conversion from literal String to object
Fixed #628 Memory leak using JMS
Fixed #632 jsp:param tag does not accept request time attributes
Fixed #637 application code causes a NPE in container-generated code
Fixed #646 Generated source for jsp is saved in a file whose name does...
Fixed #650 popBody in PageContext should not be abstract
Fixed #660 Log JSP compilation errors in a log file
Fixed #663 Child applications do not have proper user manager hierarchy
Fixed #664 EJBUserManager has unimplemented functions
Fixed #665 Cannot use java option -Xfuture
Fixed #669 Orion JMS hanging intermittently on Message send/receive
Fixed #679 ejbStore and dirty detection problem (EJB CMP2)
Fixed #680 method ServletRequest.getParameterMap() not implemented acco...
Fixed #693 Classloader gives highest priority to WEB-INF/lib


| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of Dan Haley
| Sent: Friday, February 15, 2002 11:54 AM
| To: Orion-Interest
| Subject: RE: Wow. It seems that 1.5.4 is released!!!
|
|
| It looks like it - there are Local EJB interfaces and MDBs in orion.jar!
|
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
| Sent: 15 February 2002 16:40
| To: Orion-Interest
| Subject: RE: Wow. It seems that 1.5.4 is released!!!
|
|
| Great to see that a new version is ready of this great
| application server!!!
|
| Just a question for the Orion guys. Does this version support the complete
| J2EE 1.3 standard (including all EJB2.0)?? I am very interested
| because this
| is a key issue for one of my projects!
|
| Thanks on any info.
| Erwin Teseling
|
|
| >See subj.
|
|
| _
| This message has been checked for all known viruses by MessageLabs.
|
|
| _
|
| Alison Associates
|
| The information contained in this e-mail and any attached files
| is intended only for the use of the person(s) to whom it is
| addressed and may be privileged, confidential and exempt from
| disclosure under applicable law. The views of the author may not
| necessarily reflect the views of the Company. If you are not the
| intended recipient please do not copy or convey this message or
| any attached files to any other person but delete this message
| and any attached files and notify us of incorrect receipt via
| e-mail to [EMAIL PROTECTED]
|
|
| _
| This message has been checked for all known viruses by MessageLabs.





RE: long sessions

2002-01-31 Thread Jens Schumann


| I don't believe Orion (or other J2EE containers) distribute
| changes to the ServletContext object to other VM/Cluster
| members?

According to Servlet Spec the ServletContext exists per VM only - and it
states that this is even true in a distributed environment. For global data
you should use EJB or DB instead. So no automatic sharing there.

| To address these requirements, you'd need to persist the user's
| access date state on a shared resource in your cluster.
| Serialized UserState objects on a shared file system, or a DB table.

Well - I am still not confident which works best.

Anyone else any experiences in implementing a clustered global application
context which allows sharing? In my current issue DB and file system aren't
an option - so we currently run an experiment with http servlets listing to
JMS (and write information in the app context and synch them via JMS).
Depending on the app server you run into issues because of non clusterable
JMS Server ...

Recommendations?

Jens





RE: IllegalStateException

2002-01-30 Thread Jens Schumann

Well ...

usually I avoid issues such as yours by calling the scheduled operations
from an external system. Although orion allows user threads other EJB
Containers don't. Also I have noticed that Orion looses from time to time
it's JNDI Context by doing so.

Bottom line: Don't use user threads. Don't break EJB spec.

I did not dig into former mails send by you to the list but why don't you
use CRON or equal to trigger your action? You might be able to solve it
within an hour ... are able to restart whenever you want ... and don't break
EJB spec.

Jens

| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of Magnus Hoem
| Sent: Wednesday, January 30, 2002 4:46 PM
| To: Orion-Interest
| Subject: Re: IllegalStateException
|
|
| Hello again!
| The original error still seems to be there. I've relocated my Timer to a
| seperate application (it was only used to post messages to a topic).
| Because of that I am no longer using a Thread in my EJB:s (which was
| suggested earlier that it might be the problem). I am starting orion
| with the switch -userThreads.
|
| No matter what I do I still get the "java.lang.IllegalStateException:
| Transaction expired (Committed)" error. My system starts without a
| problem, it runs for a short period of time, (with all the jsp-pages
| working fine) and then all of a sudden I get the error. I am monotoring
| all the messages sent to the topic, so I can se that the beans still are
| working (there are still messages beeing published on the Topic every
| now and then). The problem is that I can't access any of the methods in
| the home-interface.
|
| Anybody have an idea?
|
| Thanks,
| Magnus
|
| On måndag, januari 28, 2002, at 07:25 , Alex Paransky wrote:
|
| > You mention that one of the entity beans contains a timer, but you have
| > not mentioned how are you holding on to that timer.  Is it a "Static"
| > reference in the entity bean or is it a Member of the EJB?  Container
| > could physically remove the EJB from memory at any time, how are you
| > dealing with this?
| >  
| > A typical Timer implementation uses a thread.  You cannot start or stop
| > threads in an EJB object.  If you want to use a timer, you might want
| > to consider using an external object that lives outside of EJB and
| > triggers events on a periodic basis.  If you need access to that object
| > you might want to create an RMI object, and deploy it into the orion
| > JNDI tree so you can have access to it from EJB.
| >  
| > -AP_
| >
| > -Original Message-
| > From: [EMAIL PROTECTED] [mailto:owner-orion-
| > [EMAIL PROTECTED]]On Behalf Of Magnus Hoem
| > Sent: Monday, January 28, 2002 3:33 AM
| > To: Orion-Interest
| > Subject: IllegalStateException
| >
| > Hi!
| > I have a strange problem which I can't find a solution to. I am running
| > a system with a two message-driven beans and a couple of entity beans.
| > They are all listening to (and able to publish messages to) the same
| > Topic. One of the entity beans contains a Timer with a couple of
| > TimerTasks that publish messages to the topic that tells to mdb:s to do
| > different things. I also have a jsp that refreshes itself every couple
| > of minutes. When the system has been up and running for a while I
| > suddenly get a very strange error. When the self-refreshing jsp-page
| > (or load any other jsp-page connected to the system) is loaded I get
| > "java.lang.IllegalStateException: Transaction expired (Committed)" and
| > a reference to the line in the jsp where I try to connect to the Home
| > interface and run the create(), findByPrimaryKey() or findAll()
| > methods. Does anybody know why this happens and have a sollution?
| > I log all the messages sent to the topic, and the timer-bean keeps
| > sending messages after the error occurs...
| >
| > Thanks,
| > Magnus
| >
|





RE: java.lang.InternalError: Illegal removing from cache

2002-01-30 Thread Jens Schumann

Same happend to me some time ago.

Ensure your PK class is ok and you overrides equals() and hashcode(). I had
a copy and paste error in equals which caused the issue. (Yeah, I know, copy
and paste is not a design pattern ;).

Jens


| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of test test
| Sent: Wednesday, January 30, 2002 12:00 PM
| To: Orion-Interest
| Subject: java.lang.InternalError: Illegal removing from cache
|
|
| Whilst doing an ejbRemove on a BMP EJB I get the following exception. It
| would appear that the deletion from the database is successful,
| but is then
| rolled back. Has anyone got any ideas about this?
| Thanks in advance -
| Tom
| (Orion 1.5.2, SQL Server, Win 2000)
|
|
| java.lang.InternalError: Illegal removing from cache of
| com.aconitesolutions.esp.model.ESPBusinessFunctionKey@16592a6
|   at com.evermind[Orion/1.5.2 (build
| 10460)].server.ejb.EntityEJBHome.removeInstance(Unknown Source)
|   at
| ESPBusinessFunction_EntityBeanWrapper2.remove(ESPBusinessFunction_
| EntityBeanWrapper2.java:122)
|   at
| com.aconitesolutions.esp.manager.action.DeleteBusinessFunctionActi
| on.process(DeleteBusinessFunctionAction.java:90)
|   at
| com.aconitesolutions.utils.servlet.ActionServlet.processRequest(Ac
| tionServlet.java:154)
|   at
| com.aconitesolutions.utils.servlet.ActionServlet.doPost(ActionServ
| let.java:106)
|   at javax.servlet.http.HttpServlet.service(HttpServlet.java:211)
|   at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
|   at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
|   at com.evermind[Orion/1.5.2 (build 10460)]._cxb._abe(Unknown Source)
|   at com.evermind[Orion/1.5.2 (build 10460)]._cxb._uec(Unknown Source)
|   at com.evermind[Orion/1.5.2 (build 10460)]._io._twc(Unknown Source)
|   at com.evermind[Orion/1.5.2 (build 10460)]._io._gc(Unknown Source)
|   at com.evermind[Orion/1.5.2 (build 10460)]._if.run(Unknown Source)
|
|
| _
| Chat with friends online, try MSN Messenger: http://messenger.msn.com
|





RE: Favourite logging facility survey...

2001-12-21 Thread Jens Schumann

Resend.

| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of Paolo Perego
| Sent: Thursday, December 20, 2001 8:57 AM
| To: Orion-Interest
| Subject: Favourite logging facility survey...
|
|
| Hi orion gurus, I'm taking a look on logging facilities provided by log4j
| project and the upcoming Sun jdk1.4. I've, of course, to integrate one of
| these facilities in my application deployed with orion. What logging
| facilities do you use, if any of course, and which one dao you
| think is better between log4j and jdk1.4?

Log4j seems to be fast, feature rich and easy to use. Personally I have used
and recommended log4j extensively until ..., well, until someone asked me to
write a wrapper for existing logging frameworks.

So I took a look into the sources of log4j - and realized that the
hierarchical structure behind the scenes is way too complex for most of the
projects I was working on. Also the features I have used were just a subset
of the full log4j functionality. Unusually a logging framework takes care of
system level events and exceptions only  - business related events are
logged via a different tracking service. In the end people use a logging
framework for DEBUG statements during development and ERROR or FATAL for
problems during runtime. Therefore log4j seems to be a little bit oversized.

So what do I recommend?
Log4j is a good and reliable option.
But if you need a fast and clean logging framework write your own. 2 classes
and one interface are an easy way to start. Or check out protomatter
http://protomatter.sourceforge.net/ (See javaworld article for a quick
overview). I have never used jdk 1.4 so far ...

Jens
PS: I run into some issues with the log4j base class Category, which caused
"not EJB Spec conform" exceptions (can't remember the correct name) while
deploying it into a J2EE server. Not Orion in this case.






RE: Orion Server with external webserver

2001-10-04 Thread Jens Schumann

Just to be curious.
Why do you want to connect from a (some time ago) 6 times slower jsp/servlet
engine to orion instead of using orion directly?

Jens

| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED]]On Behalf Of Fredrik
| Gusting (PAC)
| Sent: Thursday, October 04, 2001 5:12 PM
| To: Orion-Interest
| Subject: RE: Orion Server with external webserver
|
|
|
|
| Hi
|
| The generated principes.xml (in
| /application-deployments/time)is empty though but that
| should be empty i think. Ther is nothing I can do about it.
|
| My principles.xml in /config.
| looks like this. This should be correct or ?
|
| 
| http://www.orionserver.com/dtds/principals.dtd";>
|
| 
|   
|   
|   administrators
|   
|   
|   
|   
|   guests
|   
|   
|   users
|   
|   
|   
|   
|   
|   
|   The default administrator
|   
|   
|   
|   
|   
|   The default user
|   
|   
|   
|   
|   The default guest/anonyomous
| user
|   
|   
|   
| 
| -Original Message-
| From: Hanlan, Dominic - Senior Developer [mailto:[EMAIL PROTECTED]]
| Sent: Thursday, October 04, 2001 1:46 PM
| To: Orion-Interest
| Subject: RE: Orion Server with external webserver
|
|
| Is Admin enabled in principles.xml
|
| -Original Message-
| From: Fredrik Gusting (PAC) [mailto:[EMAIL PROTECTED]]
| Sent: 04 October 2001 08:38
| To: Orion-Interest
| Subject: Orion Server with external webserver
|
|
| Hi all
| I've trouble with my connection from my Tomcat webserver to Orion server.
| In tomcat have set upp a servlet which takes a request from a browser and
| then do a lookup for my orionserver that contains a small example of an
| entitybean that simple returns the current time. I've setup
| everything onmy
| local machine. Tomcat port 8080, and Orion port 8000.
| When I try to create my Initialcontext I get LoginException or something.
| Her is a part of my code
|
| public class Dispatcher extends HttpServlet {
|
|   /**Initialize global variables*/
|
|   private static final String CONTENT_TYPE = "text/html";
|   private Context context = null;
|
|   public void init(ServletConfig config) throws ServletException {
|
| super.init(config);
|
|   }
|
|   /**Process the HTTP Get request*/
|   public void doGet(HttpServletRequest request, HttpServletResponse
| response) throws ServletException, IOException {
|
| try
| {
|
|   Properties h = new Properties();
|
| h.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.Applica
| tionClient
| InitialContextFactory");
|   h.put(Context.PROVIDER_URL,"ormi://localhost:80/time");
|   h.put(Context.SECURITY_PRINCIPAL, "admin");
|   h.put(Context.SECURITY_CREDENTIALS, "123");
|
|   Context context = new InitialContext(h);  // HERE IT CRASHES
|
|   Object ref = (PerfectTimeHome)context.lookup("PerfectTimeHome");
|
|
| Do I have to configure orion for login, how???
| Has anybody got an external webserver to work with orion. Sample of that
| please!
|
| Regards
| Fredrik
| Fredrik Gusting(mailto: [EMAIL PROTECTED])
| System Designer
| Ericsson Process & Application Consulting
| Kistagången 4  Phone:  +46 8 568 63 189
| SE-125 82 Kista   Mobile: +46 70 52 63 189
|





Junit issues - ClassCastException

2001-09-30 Thread Jens Schumann

Since I saw a question regarding junit and classcastexceptions on this list
(before I subscribed to it) just one pointer for everyone:

Using stock junit for EJB calls you will run into classcastexceptions
because of the custom class loader junit is using. I already asked the junit
guys to put this in their FAQ - I spend way to much time to figure out the
reason.

So, whenever you want to use junit as application client put your
remote/home interfaces in excluded.properties within your junit distribution
or disable the custom class loader.

Jens
PS: Do the same for JMS Object messages.



BEGIN:VCARD
VERSION:2.1
N:Schumann;Jens
FN:Jens Schumann
NOTE;ENCODING=QUOTED-PRINTABLE:=0D=0A=0D=0A
TEL;HOME;VOICE:+49 (441) 594 9118
TEL;CELL;VOICE:+49 (172) 930 5834
ADR;HOME:;;Louise Schroeder Strasse 7;Oldenburg;;26131;Germany
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:Louise Schroeder Strasse 7=0D=0AOldenburg 26131=0D=0AGermany
URL;WORK:http://void.fm
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
EMAIL;INTERNET:[EMAIL PROTECTED]
REV:20010815T205757Z
END:VCARD