You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(55) |
Mar
(100) |
Apr
(203) |
May
(330) |
Jun
(190) |
Jul
(302) |
Aug
(323) |
Sep
(197) |
Oct
(245) |
Nov
(490) |
Dec
(330) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(194) |
Feb
(400) |
Mar
(416) |
Apr
(415) |
May
(359) |
Jun
(381) |
Jul
(491) |
Aug
(311) |
Sep
(291) |
Oct
(273) |
Nov
(355) |
Dec
(266) |
| 2005 |
Jan
(306) |
Feb
(303) |
Mar
(520) |
Apr
(346) |
May
(255) |
Jun
(221) |
Jul
(171) |
Aug
(247) |
Sep
(147) |
Oct
(125) |
Nov
(165) |
Dec
(65) |
| 2006 |
Jan
(90) |
Feb
(53) |
Mar
(121) |
Apr
(103) |
May
(113) |
Jun
(103) |
Jul
(104) |
Aug
(67) |
Sep
(78) |
Oct
(82) |
Nov
(78) |
Dec
(70) |
| 2007 |
Jan
(77) |
Feb
(76) |
Mar
(63) |
Apr
(30) |
May
(47) |
Jun
(41) |
Jul
(44) |
Aug
(44) |
Sep
(49) |
Oct
(33) |
Nov
(25) |
Dec
(21) |
| 2008 |
Jan
(45) |
Feb
(13) |
Mar
(15) |
Apr
(12) |
May
(9) |
Jun
(33) |
Jul
(30) |
Aug
(7) |
Sep
(20) |
Oct
(17) |
Nov
(20) |
Dec
(10) |
| 2009 |
Jan
(8) |
Feb
(5) |
Mar
(12) |
Apr
(17) |
May
(19) |
Jun
(97) |
Jul
(77) |
Aug
(33) |
Sep
(24) |
Oct
(41) |
Nov
(16) |
Dec
(32) |
| 2010 |
Jan
(24) |
Feb
(14) |
Mar
(50) |
Apr
(71) |
May
(70) |
Jun
(64) |
Jul
(45) |
Aug
(62) |
Sep
(32) |
Oct
(4) |
Nov
(12) |
Dec
(2) |
| 2011 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(6) |
Jun
(1) |
Jul
(4) |
Aug
(3) |
Sep
(4) |
Oct
(6) |
Nov
(3) |
Dec
(3) |
| 2012 |
Jan
(4) |
Feb
(8) |
Mar
(6) |
Apr
(10) |
May
(2) |
Jun
(3) |
Jul
(11) |
Aug
(10) |
Sep
(4) |
Oct
|
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
(9) |
Apr
(1) |
May
(8) |
Jun
(2) |
Jul
(5) |
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(10) |
Dec
(8) |
| 2014 |
Jan
(3) |
Feb
(12) |
Mar
(9) |
Apr
(12) |
May
(2) |
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(2) |
| 2015 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(9) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(7) |
Oct
(9) |
Nov
(7) |
Dec
(9) |
| 2016 |
Jan
(7) |
Feb
(5) |
Mar
(5) |
Apr
(5) |
May
(8) |
Jun
(4) |
Jul
(5) |
Aug
(4) |
Sep
(6) |
Oct
(7) |
Nov
(2) |
Dec
(3) |
| 2017 |
Jan
(7) |
Feb
(8) |
Mar
(7) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(5) |
Aug
(8) |
Sep
(4) |
Oct
(2) |
Nov
(3) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
(5) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2026 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Colin S. <col...@ex...> - 2003-08-26 03:44:20
|
Here's a patch for SingleConnectionDataSource which allows the setAutoCommit call to be controlled, as per earlier discussion. By default, the class will no longer call setCommit at all if an existing connection is given to it in the constructor. Otherwise it will behave the same as before by default (i.e. if the connection is obtained from DriveManager then setAutoCommit(true) is called). There are flags to control the calling of setAutoCommit and the initial state. As to whether the class should even allow overriding this when the connection comes from DriverManger; it's true that most people would expect the state to be autocommit=true as per the Connection javadocs, but on the other hand the code was simpler this way, and maybe the extra flexibility will help in testing... Regards, Colin |
|
From: Colin S. <col...@ex...> - 2003-08-26 02:29:48
|
I am anything but an expert in this area unfortunately, but after thinking about it, from my point of view, it's somewhat of a wash as to which approach is 'cleaner'. There is a very simple requirement and use case here. You already have a connection object, and at the same location are creating another object which under ideal circumstances uses the very same connection, and should get it with as little work as possible. So in your ideal use scenario of using the real datasource, you can rely on the fact that asking your container (somwhat more indirectly) for a connection from that datasource, will get you the same connection. But it's actually out of your control and there's not necessarily much you can do about it if the container doesn't do this, in which case your are looking at a potentially much less efficient result. I've found two references to the possiblity that maybe OC4J and the Advanced container in WebSphere don't do the local transaction optimization: (search for 6.12) http://otn.oracle.com/tech/java/oc4j/doc_library/902/servicesjun02/jca.htm http://www-3.ibm.com/software/webservers/appserv/doc/v40/ae/infocenter/was/040901.html So I think in this particular case the use of the 'real' DataSource just complicates things without really adding any advtantages. It's not making testing easier, it's not providing better separation of concerns (the contrary, I would say, actually), etc. In any case, this is somewhat orthogonal to the original post which was about the need to allow the autoComit flag to go either way on the connection obtained from SingleConnectionDataSource, whether or not it was given an existing connection or gets it through DriverManager. Hopefully we are both in agreement that the option is needed in this class. Regards, Colin jürgen höller [werk3AT] wrote: >>Since in this case the DataSource is not already bound to the thread, in this case, my JDBC code ends up calling getConnection on the real DataSource (from JNDI). Then that datasource ends up allocating a new connection from its pool, which is returned to me. There is no issue in terms of working together with the existing connection, JTA takes care of that, but the whole process is a lot more heavyweight and takes more resources (two pooled connections instead of one), plus the coordination among them. >> >> > >To the best of my knowledge, any decent JTA implementation will return the same Connection instance if asked for a Connection for the same DataSource again within an active transaction. This is even recommended by the JTA spec, under the name "local transaction optimization" IIRC. JTA transaction managers will typically not perform 2PC for such single DataSource transactions but just for actual distributed ones. I consider it safe to assume that all major containers implement it that way. > >Juergen > > >jürgen höller [werk3AT] wrote: > > > >>Colin, >> >>You obviously want to perform plain JDBC access within the same transaction as the Hibernate access. This can be achieved easily via HibernateTransactionManager or JtaTransactionManager, without any specific gluing. >> >>If you define a respective JDBC DataSource in the application context, pointing to the same one that Hibernate uses (be it a local one specified on LocalSessionFactoryBean or a shared JNDI one), you can make HibernateTransactionManager export its transactions for this particular DataSource by passing the DataSource as bean reference into its "dataSource" property. HibernateTransactionManager will simply take the very JDBC Connection that the Hibernate Session uses and bind it to the thread via DataSourceUtils for plain JDBC access on that DataSource. The latter does not have to be aware that it is working with a Hibernate-provided Connection! >> >>With JtaTransactionManager, it's similar: Define the same JNDI DataSource that the Hibernate SessionFactory uses for the JdbcTemplate, and JTA will care for returning the same Connection to both the Hibernate Session and the JDBC access code if in an active transaction. >> >>So in any case, this "same DataSource" approach is as efficient as passing the Hibernate Session's JDBC Connection manually to a JdbcTemplate instance, as it reuses the same Connection for both the Hibernate Session and the JdbcTemplate within a transaction. I strongly recommend such a solution over manual gluing. >> >>Juergen >> >> >> >> -----Ursprüngliche Nachricht----- >> Von: Colin Sampaleanu [mailto:col...@ex...] >> Gesendet: Mo 25.08.2003 23:14 >> An: jürgen höller [werk3AT] >> Cc: spr...@li... >> Betreff: Re: [Springframework-developer] Why does SingleConnectionDataSource always set autoCommit=true? >> >> >> >> W/regards to auto commit in the default case (when the class gets the >> connection itself), I would say, exactly, the JDBC specs specifically >> say the getConnection called on the datasource will return a connection >> with autoCommit on by default. So why is SingleConnectionDataSource then >> going and setting it on as well. Given that SingleConnectionDatasource >> doesn't have any clue about the intended use of the connection, the most >> correct behaviour is probably to not have it call setAutoCommit with >> either state, by default, which would mirror normal >> datasource/connection usage, and also allow a mechanism to specify that >> it should be called one way or another. However, this may be more work >> than is worth it, and a default call with the option to on, along with a >> mechanism (another constructor with a value for the call) to override >> it, would be fine. So to be clear, I do think even when >> SingleConnectionDataSource gets the connection there is a need for an >> override. >> >> As for my use case, I don't think I was clear enough. I have some code >> in a Hibernate specific DAO/Mapper object. I am already executing inside >> a transaction introduced via Spring's AOP interceptor. So I do have a >> SessionFactory, etc. bound to the thread. Now inside a method in this >> mapper I need to do an operation on a BLOB/CLOB, where there are a >> number of db platform specific issues, and Hibernate's support of >> BLOBs/CLOBs is not good enough. Given that I have a Hibernate Session >> which already has a connection available, using it is the best mechanism >> (as opposed to trying to get a real DataSource in Spring's context to >> use). Now I am using JDBCTemplate and JDBCHelper as convenience classes, >> to wrap JDBC exceptions, and for the methods they provide. Now I could call >> DataSourceUtils.getThreadObjectManager().bindThreadObject(...) >> to bind the SingleConnectionDatasource to the thread, before using the >> JDBCTemplate, but I'm not sure that's buying me much over the case of >> not binding it. In either case, JDBCTemplate is simply going to end up >> getting the same Connection. Because I am using the >> SingleConnectionDatasource, it's not like in this case there is a real >> DataSource object, and you only want to call getConnection on it once... >> >> Hopefully my exaplanation is clear now... >> >> >> jürgen höller [werk3AT] wrote: >> >> >I agree that in case of an existing connection, SingleConnectionDataSource should not override the commit mode. For the default case, I consider auto commit mode appropriate though. Any J2EE DataSource will return an auto commit connection outside a transaction, so why shouldn't SingleConnectionDataSource do too? >> > >> >BTW, what you are trying to do seems a bit awkward. Why manually feed the Connection of a Hibernate Session via SingleConnectionDataSource to JdbcTemplate? JdbcTemplate is supposed to be a threadsafe, reusable object, fetching connections on demand. Wouldn't it be easier to use Spring's thread-binding mechanism (DataSourceUtils.getThreadObjectManager) to make JdbcTemplate use a specific connection, be it implicitly via HibernateTransactionManager or explicitly in some custom way? >> > >> >Juergen >> > >> > >> > >> > -----Ursprüngliche Nachricht----- >> > Von: Colin Sampaleanu [mailto:col...@ex...] >> > Gesendet: Mo 25.08.2003 20:02 >> > An: spr...@li... >> > Cc: >> > Betreff: [Springframework-developer] Why does SingleConnectionDataSource always set autoCommit=true? >> > >> > >> > >> > I want to use SingleConnectionDataSource with Hibernate, so I can wrap a >> > connection I get from a Hibernate Session, and feed it as a DataSource >> > to JDBCTemplate/JDBCHelper. >> > >> > However, right now I've had to make my own variant since the current >> > code always calls >> > source.setAutoCommit(true); >> > in the init() method. This seems very arbitrary to me. At least in the >> > case when the class is given an existing connection, it should just >> > assume the commit option has been set appropriately on the connection. >> > >> > Even in the case when the class is opening the connection itself from an >> > existing DataSource, there needs to be an option to set autoCommit >> > either way. >> > >> > Regards, >> >> |
|
From: <jue...@we...> - 2003-08-26 02:13:11
|
Lars,
You mean that
<servlet>
<servlet-name>contextLoader</servlet-name>
=
<servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-=
class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>example</servlet-name>
=
<servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-cla=
ss>
<load-on-startup>2</load-on-startup>
</servlet>
still loads the DispatcherServlet before the ContextLoaderServlet? =
Ignoring the load-on-startup values would be a major bug in WebLogic's =
web container. Are you *really* sure that a web.xml with entries like =
the above causes wrong initialization order? Please recheck that =
thoroughly!
It's bad enough that WebLogic invokes the listeners at the wrong time, =
but unfortunately that is not actually conflicting with the current =
spec. I can't believe that it ignores servlet load-on-startup values =
though - how did it get its J2EE 1.3 certification then? It seems to =
work on Thomas' installation, so there should be a way to make it work =
on yours.
Even in the extreme case, a solution can be found. You could for example =
just use a servlet-specific context and no root context, by simply =
omitting the context loader definition. You could subclass =
DispatcherServlet to perform initialization of the root context before =
continuing with its own. But I'm pretty sure that none of these will be =
necessary.
Juergen
-----Original Message-----
From: Lars Fischer [mailto:lar...@gm...]
Sent: Monday, August 25, 2003 10:32 AM
To: j=FCrgen h=F6ller [werk3AT]
Cc: tri...@tr...; spr...@li...
Subject: RE: [Springframework-developer] Example classes needed
J=FCrgen,
the problem is that the ***-servlet.xml stuff is always loaded before
the applicationContext.xml stuff no matter what I define in=20
web.xml. This is against the documentation.
I will open a case with BEA support (this would be the first time they
would solve an issue but you can never know ...).
It seems like I have to use another server but unless there is no error
in my application Spring is no alternative for production applications
(Petclinic does not work too at the moment).
Is there any difference between the Java SDK versions ?
Thanks
Lars
> Lars, Thomas,
>=20
> I guess that WebLogic simply invokes the listeners after =
load-on-startup=20
> servlets. Bad WebLogic ;-)
>=20
> Unfortunately, the Servlet 2.3 spec leaves this unspecified. The =
Servlet=20
> 2.4 spec clarifies that listeners have to be *initialized before* and=20
> *destroyed after* any servlets. Tomcat and Resin already behave this=20
> way, Orion does too since 2.0.2 after I've informed them about the=20
> Servlet 2.4 clarification...
>=20
> For a solution with current WebLogic versions, I agree that using the=20
> servlet initializers like ContextLoaderServlet and Log4jConfigServlet =
is=20
> probably the best choice, as Thomas has recommended.
>=20
> Juergen
>=20
>=20
> -----Original Message-----
> From: tri...@tr... [mailto:tri...@tr...]
> Sent: Sunday, August 24, 2003 10:49 PM
> To: Lars Fischer
> Cc: spr...@li...
> Subject: Re: [Springframework-developer] Example classes needed
>=20
>=20
> Lars,
>=20
> Loading ContextLoaderServlet as a servlet with load-on-startup set to =
1=20
> and
> loading DispatcherServlet with load-on-startup set to 2 works for me =
on=20
> WebLogic
> 8.1 SP1. If it does not work, could you send me the web.xml and your=20
> log output?
>=20
> Also, I get the same errors deploying the Petclinic, so it does not =
work=20
> for me.
> Can you send me the petclinic war file that works with WebLogic 8.1 =
SP1=20
> so I
> can try it on my server?
>=20
> Thomas
>=20
>=20
> > Thomas,
> >=20
> > thanks for the suggestion. Tried it but it doesn't work.
> >=20
> > This is a serious one:
> >=20
> > Tested my app with Tomcat 4.1.24 and it works.
> >=20
> > I does NOT work with
> >=20
> > WebLogic 8.1 SP1, WebLogic Express SP1, WebLogic 7.0 SP3.
> >=20
> > What makes me wonder is that Petclinic works with WebLogic 8.1 SP1.
> >=20
> > Regards
> > Lars
> >=20
> > > Lars,
> > >=20
> > > I have looked into this a little bit more. What happens is that=20
> > > ServletContextListener.contextInitialized() method is called =
_after_=20
> the =20
> > > HttpServlet.init() method is called on servlets specified with=20
> <load-on-
> > > startup>. This causes the xxx-servlet.xml to be loaded before the =
> > > applicationContext.xml is loaded, so that is why you can't =
reference=20
>=20
> > > the 'cwxDao' bean. This behavior is the opposite of what I see =
for
> > > Tomcat,=20
> > > and I'm sure the same is true for Orion and Resin that Juergen is=20
> using.=20
> > > I=20
> > > looked in the Servlet 2.3 specification, but I did not see =
anything
> > > specifying=20
> > > which order these methods should be called in. Maybe Juergen or =
Rod=20
> can
> > > shed=20
> > > some more light on this issue. =20
> > >=20
> > > You should be able to use the ContextLoaderServlet for now.
> > >=20
> > > Thomas
>=20
|
|
From: <tri...@tr...> - 2003-08-26 01:32:11
|
Juergen, > Anyway, ContextLoaderServlet *will* be in 1.0 M1, to be released at the end > of this week if there aren't any major obstacles. BTW, can everybody please > test the current CVS contents against own applications? > I am updating the Step-by-step-MVC document - what will the exact name of the directory and the jar file be? I'm assuming 'spring-framework-1.0M1' and 'spring-full-1.0M1.jar'. Thomas |
|
From: Lars F. <lar...@gm...> - 2003-08-25 22:41:27
|
Thomas,
unfortunately I've deleted the working petclinic.war yesterday and was not
able to
reproduce it but I'll try to look into the logs.
I've deployed the application with the following options in web.xml:
<listener>
<listener-class>com.interface21.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>cwxRootContext</servlet-name>
<servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>cwx</servlet-name>
<servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
Attached is the output from WebLogic and TomCat (TomCat works without
problems).
WebLogic complains about not finding the requested class in the classpath.
Hope this helps
Lars
> Lars,
>
> Loading ContextLoaderServlet as a servlet with load-on-startup set to 1
> and
> loading DispatcherServlet with load-on-startup set to 2 works for me on
> WebLogic
> 8.1 SP1. If it does not work, could you send me the web.xml and your log
> output?
>
> Also, I get the same errors deploying the Petclinic, so it does not work
> for me.
> Can you send me the petclinic war file that works with WebLogic 8.1 SP1
> so I
> can try it on my server?
>
> Thomas
>
>
> > Thomas,
> >
> > thanks for the suggestion. Tried it but it doesn't work.
> >
> > This is a serious one:
> >
> > Tested my app with Tomcat 4.1.24 and it works.
> >
> > I does NOT work with
> >
> > WebLogic 8.1 SP1, WebLogic Express SP1, WebLogic 7.0 SP3.
> >
> > What makes me wonder is that Petclinic works with WebLogic 8.1 SP1.
> >
> > Regards
> > Lars
> >
> > > Lars,
> > >
> > > I have looked into this a little bit more. What happens is that
> > > ServletContextListener.contextInitialized() method is called _after_
> the
> > > HttpServlet.init() method is called on servlets specified with
> <load-on-
> > > startup>. This causes the xxx-servlet.xml to be loaded before the
> > > applicationContext.xml is loaded, so that is why you can't reference
> > > the 'cwxDao' bean. This behavior is the opposite of what I see for
> > > Tomcat,
> > > and I'm sure the same is true for Orion and Resin that Juergen is
> using.
> > > I
> > > looked in the Servlet 2.3 specification, but I did not see anything
> > > specifying
> > > which order these methods should be called in. Maybe Juergen or Rod
> can
> > > shed
> > > some more light on this issue.
> > >
> > > You should be able to use the ContextLoaderServlet for now.
> > >
> > > Thomas
> > >
> > >
> > > > Lars,
> > > >
> > > > This might be a WebLogic specific issue - I just saw similar error
> when
> > > I
> > > > deployed my app in WebLogic 8.1.
> > > >
> > > > I will try to research this in more detail later on today or
> tomorrow.
> > > In
> > > > the
> > > > meantime try this in your web.xml
> > > >
> > > > <servlet>
> > > > <servlet-name>cwxRootContext</servlet-name>
> > > >
> > >
> <servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-
> > > class>
> > > > <load-on-startup>1</load-on-startup>
> > > > </servlet>
> > > >
> > > > <servlet>
> > > > <servlet-name>cwx</servlet-name>
> > > >
> > >
> >
>
<servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-class>
> > > > <load-on-startup>2</load-on-startup>
> > > > </servlet>
> > > >
> > > > Thomas
> > > >
> > > >
> > > >
> > > > > Thomas,
> > > > >
> > > > > attached is the web.xml.
> > > > >
> > > > > Without the ContextLoaderListener nothing would happen, not even
> > > > > the Hibernate stuff in applicationContext.xml.
> > > > >
> > > > > Thanks
> > > > > Lars
> > > > >
> > > > > > Lars,
> > > > > >
> > > > > > You did not include your web.xml, but my guess is you need to
> add a
> > > > > > ContextLoaderListener. The application context has to be loaded
> > > first,
> > > > > > and the
> > > > > > error messages indicates that the bean 'cwxDao' can't be found,
> so
> > > it
> > > > > > looks like
> > > > > > that did not happen.
> > > > > >
> > > > > > web.xml:
> > > > > >
> > > > > > <web-app>
> > > > > >
> > > > > > <!--
> > > > > > - Loads the root application context of this web app at
> startup,
> > > > > > - by default from "/WEB-INF/applicationContext.xml".
> > > > > > -->
> > > > > > <listener>
> > > > > > <listener-class>
> > > > > > com.interface21.web.context.ContextLoaderListener
> > > > > > </listener-class>
> > > > > > </listener>
> > > > > >
> > > > > > <!-- more definitions -->
> > > > > >
> > > > > > </web-app>
> > > > > >
> > > > > >
> > > > > > Hope this helps.
> > > > > >
> > > > > > Thomas
> > > > > >
> > > > > >
> > > > > >
> > > > > > > Hi all Spring experts,
> > > > > > >
> > > > > > > can anyone provide me the example classes mentioned in several
> > > > skeletons
> > > > > >
> > > > > > > (e.g. exampleController, exampleBusinessObject,
> > > > exampleDataAccessObject)
> > > > > > ?
> > > > > > >
> > > > > > > The two provided sample applications don't reflect the
> skeletons
> > > very
> > > > > > well.
> > > > > > > There should be one 'big' application showing all the stuff
> and
> > > many
> > > > > > small
> > > > > > > ones to show single options (like in WebWork 1).
> > > > > > >
> > > > > > > I've defined the following in applicationContext.xml (and it
> > > works):
> > > > > > >
> > > > > > > <bean id="cwxDao" class="example.dao.CwxDaoHibernate">
> > > > > > > <property name="sessionFactory"><ref
> > > > > > bean="cwxSessionFactory"/></property>
> > > > > > > </bean>
> > > > > > >
> > > > > > > When defining
> > > > > > >
> > > > > > > (cwx-servlet.xml)
> > > > > > >
> > > > > > > <!-- Controller for the initial "Hello" page -->
> > > > > > > <bean id="cwxController" class="example.web.CwxController">
> > > > > > > <property name="cwxDao"><ref external="cwxDao"/></property>
> > > > > > > </bean>
> > > > > > >
> > > > > > > (CwxController)
> > > > > > >
> > > > > > > private CwxDao cwxDao;
> > > > > > >
> > > > > > > public void setCwxDao(CwxDao cwxDao) {
> > > > > > > this.cwxDao = cwxDao;
> > > > > > > }
> > > > > > >
> > > > > > >
> > > > > > > I always get
> > > > > > >
> > > > > > > ERROR [com.interface21.web.servlet.DispatcherServlet] -
> <Servlet
> > > with
> > > > > > name
> > > > > > > 'cwx' : initialization error>
> > > > > > > com.interface21.beans.factory.NoSuchBeanDefinitionException:
> No
> > > bean
> > > > > > named
> > > > > > > [cwxDao] is defined {class
> > > > > > com.interface21.beans.factory.xml.XmlBeanFactory:
> > > > > > > defined beans
> > > [messageSource,viewResolver,urlMapping,cwxController]}
> > > > > > >
> > > > > > > This is the second time I get almost useless error messages.
> This
> > > is
> > > > one
> > > > > > > point where EJBs are far ahead (
> > > > > > > there is almost always an error message telling you what
> excactly
> > > is
> > > > > > > wrong).
> > > > > > >
> > > > > > > Another (dumb) question:
> > > > > > >
> > > > > > > What is the difference between a DAO *implementation* and a
> > > business
> > > > > > object
> > > > > > > and where does
> > > > > > > e. g. Petclinic reflect this ? I'm asking this because of the
> > > > diiference
> > > > > > > between the skeletons and the
> > > > > > > sample applications. The skeletons provide a DAO and a
> Business
> > > Object
> > > > > > using
> > > > > > > the DAO definition,
> > > > > > > Petclinic does not. The samples should be as close as possible
> to
> > > the
> > > > > > > skeletons or the skeletons should
> > > > > > > at least provide the java classes (shouldn't be too hard).
> > > > > > >
> > > > > > > Thanks in advance
> > > > > > > Lars
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > -------------------------------------------------------
> > > > > > > This SF.net email is sponsored by: VM Ware
> > > > > > > With VMware you can run multiple operating systems on a single
> > > > machine.
> > > > > > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual
> machines
> > > > > > > at the same time. Free trial click
> > > > > > here:http://www.vmware.com/wl/offer/358/0
> > > > > > > _______________________________________________
> > > > > > > Springframework-developer mailing list
> > > > > > > Spr...@li...
> > > > > > >
> > > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.net email is sponsored by: VM Ware
> > > > With VMware you can run multiple operating systems on a single
> machine.
> > > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > > > at the same time. Free trial click
> > > here:http://www.vmware.com/wl/offer/358/0
> > > > _______________________________________________
> > > > Springframework-developer mailing list
> > > > Spr...@li...
> > > >
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > > >
> > >
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: VM Ware
> > > With VMware you can run multiple operating systems on a single
> machine.
> > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > > at the same time. Free trial click
> > > here:http://www.vmware.com/wl/offer/358/0
> > > _______________________________________________
> > > Springframework-developer mailing list
> > > Spr...@li...
> > > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: VM Ware
> > With VMware you can run multiple operating systems on a single machine.
> > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > at the same time. Free trial click
> here:http://www.vmware.com/wl/offer/358/0
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click
> here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
> |
|
From: <jue...@we...> - 2003-08-25 22:36:30
|
PiBTaW5jZSBpbiB0aGlzIGNhc2UgdGhlIERhdGFTb3VyY2UgaXMgbm90IGFscmVhZHkgYm91bmQg dG8gdGhlIHRocmVhZCwgaW4gdGhpcyBjYXNlLCBteSBKREJDIGNvZGUgZW5kcyB1cCBjYWxsaW5n IGdldENvbm5lY3Rpb24gb24gdGhlIHJlYWwgRGF0YVNvdXJjZSAoZnJvbSBKTkRJKS4gVGhlbiB0 aGF0IGRhdGFzb3VyY2UgZW5kcyB1cCBhbGxvY2F0aW5nIGEgbmV3IGNvbm5lY3Rpb24gZnJvbSBp dHMgcG9vbCwgd2hpY2ggaXMgcmV0dXJuZWQgdG8gbWUuIFRoZXJlIGlzIG5vIGlzc3VlIGluIHRl cm1zIG9mIHdvcmtpbmcgdG9nZXRoZXIgd2l0aCB0aGUgZXhpc3RpbmcgY29ubmVjdGlvbiwgSlRB IHRha2VzIGNhcmUgb2YgdGhhdCwgYnV0IHRoZSB3aG9sZSBwcm9jZXNzIGlzIGEgbG90IG1vcmUg aGVhdnl3ZWlnaHQgYW5kIHRha2VzIG1vcmUgcmVzb3VyY2VzICh0d28gcG9vbGVkIGNvbm5lY3Rp b25zIGluc3RlYWQgb2Ygb25lKSwgcGx1cyB0aGUgY29vcmRpbmF0aW9uIGFtb25nIHRoZW0uDQog DQpUbyB0aGUgYmVzdCBvZiBteSBr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gICAgICBleGlzdGluZyBEYXRhU291cmNlLCB0aGVyZSBuZWVkcyB0byBiZSBhbiBvcHRpb24g dG8gc2V0IGF1dG9Db21taXQNCj4gICAgICAgPiAgICAgICBlaXRoZXIgd2F5Lg0KPiAgICAgICA+ ICAgICANCj4gICAgICAgPiAgICAgICBSZWdhcmRzLA0KPiAgICAgICA+ICAgICAgIENvbGluDQo+ ICAgICAgID4gICAgIA0KPiAgICAgICA+DQo+ICAgICAgDQo+ICAgICAgDQo+ICAgICAgDQo+DQo+ IA0KPg0KDQoNCg0K |
|
From: Colin S. <col...@ex...> - 2003-08-25 22:29:59
|
I agree that if I used HibernateTransactionManager, the impact is essentially the same, since the HibernateTransactionManager is going to directly bind the DataSource to the thread, and when a connection is needed the spring classes will see it there and return the existing thread bound connection instead of ever calling getConnection on it. My feeling however is that with JTATransactionManager things are much worse if I don't bind the fake datasource myself, or feed it to JDBCTemplate. Since in this case the DataSource is not already bound to the thread, in this case, my JDBC code ends up calling getConnection on the real DataSource (from JNDI). Then that datasource ends up allocating a new connection from its pool, which is returned to me. There is no issue in terms of working together with the existing connection, JTA takes care of that, but the whole process is a lot more heavyweight and takes more resources (two pooled connections instead of one), plus the coordination among them. Is this not an accurate description of the situation? Regards, Colin jürgen höller [werk3AT] wrote: >Colin, > >You obviously want to perform plain JDBC access within the same transaction as the Hibernate access. This can be achieved easily via HibernateTransactionManager or JtaTransactionManager, without any specific gluing. > >If you define a respective JDBC DataSource in the application context, pointing to the same one that Hibernate uses (be it a local one specified on LocalSessionFactoryBean or a shared JNDI one), you can make HibernateTransactionManager export its transactions for this particular DataSource by passing the DataSource as bean reference into its "dataSource" property. HibernateTransactionManager will simply take the very JDBC Connection that the Hibernate Session uses and bind it to the thread via DataSourceUtils for plain JDBC access on that DataSource. The latter does not have to be aware that it is working with a Hibernate-provided Connection! > >With JtaTransactionManager, it's similar: Define the same JNDI DataSource that the Hibernate SessionFactory uses for the JdbcTemplate, and JTA will care for returning the same Connection to both the Hibernate Session and the JDBC access code if in an active transaction. > >So in any case, this "same DataSource" approach is as efficient as passing the Hibernate Session's JDBC Connection manually to a JdbcTemplate instance, as it reuses the same Connection for both the Hibernate Session and the JdbcTemplate within a transaction. I strongly recommend such a solution over manual gluing. > >Juergen > > > > -----Ursprüngliche Nachricht----- > Von: Colin Sampaleanu [mailto:col...@ex...] > Gesendet: Mo 25.08.2003 23:14 > An: jürgen höller [werk3AT] > Cc: spr...@li... > Betreff: Re: [Springframework-developer] Why does SingleConnectionDataSource always set autoCommit=true? > > > > W/regards to auto commit in the default case (when the class gets the > connection itself), I would say, exactly, the JDBC specs specifically > say the getConnection called on the datasource will return a connection > with autoCommit on by default. So why is SingleConnectionDataSource then > going and setting it on as well. Given that SingleConnectionDatasource > doesn't have any clue about the intended use of the connection, the most > correct behaviour is probably to not have it call setAutoCommit with > either state, by default, which would mirror normal > datasource/connection usage, and also allow a mechanism to specify that > it should be called one way or another. However, this may be more work > than is worth it, and a default call with the option to on, along with a > mechanism (another constructor with a value for the call) to override > it, would be fine. So to be clear, I do think even when > SingleConnectionDataSource gets the connection there is a need for an > override. > > As for my use case, I don't think I was clear enough. I have some code > in a Hibernate specific DAO/Mapper object. I am already executing inside > a transaction introduced via Spring's AOP interceptor. So I do have a > SessionFactory, etc. bound to the thread. Now inside a method in this > mapper I need to do an operation on a BLOB/CLOB, where there are a > number of db platform specific issues, and Hibernate's support of > BLOBs/CLOBs is not good enough. Given that I have a Hibernate Session > which already has a connection available, using it is the best mechanism > (as opposed to trying to get a real DataSource in Spring's context to > use). Now I am using JDBCTemplate and JDBCHelper as convenience classes, > to wrap JDBC exceptions, and for the methods they provide. Now I could call > DataSourceUtils.getThreadObjectManager().bindThreadObject(...) > to bind the SingleConnectionDatasource to the thread, before using the > JDBCTemplate, but I'm not sure that's buying me much over the case of > not binding it. In either case, JDBCTemplate is simply going to end up > getting the same Connection. Because I am using the > SingleConnectionDatasource, it's not like in this case there is a real > DataSource object, and you only want to call getConnection on it once... > > Hopefully my exaplanation is clear now... > > > jürgen höller [werk3AT] wrote: > > >I agree that in case of an existing connection, SingleConnectionDataSource should not override the commit mode. For the default case, I consider auto commit mode appropriate though. Any J2EE DataSource will return an auto commit connection outside a transaction, so why shouldn't SingleConnectionDataSource do too? > > > >BTW, what you are trying to do seems a bit awkward. Why manually feed the Connection of a Hibernate Session via SingleConnectionDataSource to JdbcTemplate? JdbcTemplate is supposed to be a threadsafe, reusable object, fetching connections on demand. Wouldn't it be easier to use Spring's thread-binding mechanism (DataSourceUtils.getThreadObjectManager) to make JdbcTemplate use a specific connection, be it implicitly via HibernateTransactionManager or explicitly in some custom way? > > > >Juergen > > > > > > > > -----Ursprüngliche Nachricht----- > > Von: Colin Sampaleanu [mailto:col...@ex...] > > Gesendet: Mo 25.08.2003 20:02 > > An: spr...@li... > > Cc: > > Betreff: [Springframework-developer] Why does SingleConnectionDataSource always set autoCommit=true? > > > > > > > > I want to use SingleConnectionDataSource with Hibernate, so I can wrap a > > connection I get from a Hibernate Session, and feed it as a DataSource > > to JDBCTemplate/JDBCHelper. > > > > However, right now I've had to make my own variant since the current > > code always calls > > source.setAutoCommit(true); > > in the init() method. This seems very arbitrary to me. At least in the > > case when the class is given an existing connection, it should just > > assume the commit option has been set appropriately on the connection. > > > > Even in the case when the class is opening the connection itself from an > > existing DataSource, there needs to be an option to set autoCommit > > either way. > > > > Regards, > > Colin > > > > > > > > > > |
|
From: <jue...@we...> - 2003-08-25 22:04:18
|
Q29saW4sDQogDQpZb3Ugb2J2aW91c2x5IHdhbnQgdG8gcGVyZm9ybSBwbGFpbiBKREJDIGFjY2Vz cyB3aXRoaW4gdGhlIHNhbWUgdHJhbnNhY3Rpb24gYXMgdGhlIEhpYmVybmF0ZSBhY2Nlc3MuIFRo aXMgY2FuIGJlIGFjaGlldmVkIGVhc2lseSB2aWEgSGliZXJuYXRlVHJhbnNhY3Rpb25NYW5hZ2Vy IG9yIEp0YVRyYW5zYWN0aW9uTWFuYWdlciwgd2l0aG91dCBhbnk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biAxLjAgTTEs IHRvIGJlIHJlbGVhc2VkIGF0DQoJPiB0aGUNCgk+ID4gZW5kDQoJPiA+ICAgICA+IG9mIHRoaXMg d2VlayBpZiB0aGVyZSBhcmVuJ3QgYW55IG1ham9yIG9ic3RhY2xlcy4gQlRXLCBjYW4gZXZlcnli b2R5DQoJPiA+IHBsZWFzZQ0KCT4gPiAgICAgPiB0ZXN0IHRoZSBjdXJyZW50IENWUyBjb250ZW50 cyBhZ2FpbnN0IG93biBhcHBsaWNhdGlvbnM/DQoJPiA+ICAgICA+DQoJPiA+ICAgIA0KCT4gPiAg ICAgSSBhbSB1cGRhdGluZyB0aGUgU3RlcC1ieS1zdGVwLU1WQyBkb2N1bWVudCAtIHdoYXQgd2ls bCB0aGUgZXhhY3QgbmFtZQ0KCT4gb2YNCgk+ID4gdGhlDQoJPiA+ICAgICBkaXJlY3RvcnkgYW5k IHRoZSBqYXIgZmlsZSBiZT8gIEknbSBhc3N1bWluZyAnc3ByaW5nLWZyYW1ld29yay0xLjBNMScN Cgk+IGFuZA0KCT4gPiAgICAgJ3NwcmluZy1mdWxsLTEuME0xLmphcicuDQoJPiA+ICAgIA0KCT4g PiAgICAgVGhvbWFzDQoJPiA+ICAgIA0KCT4gPg0KCT4gPg0KCT4NCgk+DQoJPg0KCQ0KCQ0KDQo= |
|
From: Lars F. <lar...@gm...> - 2003-08-25 21:18:48
|
I agree with Thomas, I once made a mistake because I didn't realize that I was using an older version. The jar-files should be named after the version. > Juergen, > > The drawback then is that you can't tell from the jar file if it is M1, M2 > or > the release jar. > > Thomas > > > It's gonna be "spring-framework-1.0m1" and "spring-full-1.0.jar", if we > stick > > to the current plan. We've used the same naming strategy for 0.9.x, e.g. > > "spring-framework-0.9.1" but still "spring-full-0.9.jar". I prefer that > way > > to ease drop-in replacement in the literal sense :-) The build > properties > > reflect this in "spring-version=1.0" and "spring-version-detail=1.0m1". > > > > Juergen > > > > > > > > -----Ursprüngliche Nachricht----- > > Von: tri...@tr... [mailto:tri...@tr...] > > Gesendet: Mo 25.08.2003 19:21 > > An: jürgen höller [werk3AT] > > Cc: Lars Fischer; spr...@li... > > Betreff: RE: [Springframework-developer] Example classes needed > > > > > > > > Juergen, > > > > > Anyway, ContextLoaderServlet *will* be in 1.0 M1, to be released at > the > > end > > > of this week if there aren't any major obstacles. BTW, can everybody > > please > > > test the current CVS contents against own applications? > > > > > > > I am updating the Step-by-step-MVC document - what will the exact name > of > > the > > directory and the jar file be? I'm assuming 'spring-framework-1.0M1' > and > > 'spring-full-1.0M1.jar'. > > > > Thomas > > > > > > > > > |
|
From: Colin S. <col...@ex...> - 2003-08-25 21:14:28
|
W/regards to auto commit in the default case (when the class gets the connection itself), I would say, exactly, the JDBC specs specifically say the getConnection called on the datasource will return a connection with autoCommit on by default. So why is SingleConnectionDataSource then going and setting it on as well. Given that SingleConnectionDatasource doesn't have any clue about the intended use of the connection, the most correct behaviour is probably to not have it call setAutoCommit with either state, by default, which would mirror normal datasource/connection usage, and also allow a mechanism to specify that it should be called one way or another. However, this may be more work than is worth it, and a default call with the option to on, along with a mechanism (another constructor with a value for the call) to override it, would be fine. So to be clear, I do think even when SingleConnectionDataSource gets the connection there is a need for an override. As for my use case, I don't think I was clear enough. I have some code in a Hibernate specific DAO/Mapper object. I am already executing inside a transaction introduced via Spring's AOP interceptor. So I do have a SessionFactory, etc. bound to the thread. Now inside a method in this mapper I need to do an operation on a BLOB/CLOB, where there are a number of db platform specific issues, and Hibernate's support of BLOBs/CLOBs is not good enough. Given that I have a Hibernate Session which already has a connection available, using it is the best mechanism (as opposed to trying to get a real DataSource in Spring's context to use). Now I am using JDBCTemplate and JDBCHelper as convenience classes, to wrap JDBC exceptions, and for the methods they provide. Now I could call DataSourceUtils.getThreadObjectManager().bindThreadObject(...) to bind the SingleConnectionDatasource to the thread, before using the JDBCTemplate, but I'm not sure that's buying me much over the case of not binding it. In either case, JDBCTemplate is simply going to end up getting the same Connection. Because I am using the SingleConnectionDatasource, it's not like in this case there is a real DataSource object, and you only want to call getConnection on it once... Hopefully my exaplanation is clear now... jürgen höller [werk3AT] wrote: >I agree that in case of an existing connection, SingleConnectionDataSource should not override the commit mode. For the default case, I consider auto commit mode appropriate though. Any J2EE DataSource will return an auto commit connection outside a transaction, so why shouldn't SingleConnectionDataSource do too? > >BTW, what you are trying to do seems a bit awkward. Why manually feed the Connection of a Hibernate Session via SingleConnectionDataSource to JdbcTemplate? JdbcTemplate is supposed to be a threadsafe, reusable object, fetching connections on demand. Wouldn't it be easier to use Spring's thread-binding mechanism (DataSourceUtils.getThreadObjectManager) to make JdbcTemplate use a specific connection, be it implicitly via HibernateTransactionManager or explicitly in some custom way? > >Juergen > > > > -----Ursprüngliche Nachricht----- > Von: Colin Sampaleanu [mailto:col...@ex...] > Gesendet: Mo 25.08.2003 20:02 > An: spr...@li... > Cc: > Betreff: [Springframework-developer] Why does SingleConnectionDataSource always set autoCommit=true? > > > > I want to use SingleConnectionDataSource with Hibernate, so I can wrap a > connection I get from a Hibernate Session, and feed it as a DataSource > to JDBCTemplate/JDBCHelper. > > However, right now I've had to make my own variant since the current > code always calls > source.setAutoCommit(true); > in the init() method. This seems very arbitrary to me. At least in the > case when the class is given an existing connection, it should just > assume the commit option has been set appropriately on the connection. > > Even in the case when the class is opening the connection itself from an > existing DataSource, there needs to be an option to set autoCommit > either way. > > Regards, > Colin > > |
|
From: <tri...@tr...> - 2003-08-25 20:53:46
|
Juergen, The drawback then is that you can't tell from the jar file if it is M1, M2 or the release jar. Thomas > It's gonna be "spring-framework-1.0m1" and "spring-full-1.0.jar", if we stick > to the current plan. We've used the same naming strategy for 0.9.x, e.g. > "spring-framework-0.9.1" but still "spring-full-0.9.jar". I prefer that way > to ease drop-in replacement in the literal sense :-) The build properties > reflect this in "spring-version=1.0" and "spring-version-detail=1.0m1". > > Juergen > > > > -----Ursprüngliche Nachricht----- > Von: tri...@tr... [mailto:tri...@tr...] > Gesendet: Mo 25.08.2003 19:21 > An: jürgen höller [werk3AT] > Cc: Lars Fischer; spr...@li... > Betreff: RE: [Springframework-developer] Example classes needed > > > > Juergen, > > > Anyway, ContextLoaderServlet *will* be in 1.0 M1, to be released at the > end > > of this week if there aren't any major obstacles. BTW, can everybody > please > > test the current CVS contents against own applications? > > > > I am updating the Step-by-step-MVC document - what will the exact name of > the > directory and the jar file be? I'm assuming 'spring-framework-1.0M1' and > 'spring-full-1.0M1.jar'. > > Thomas > > > |
|
From: Martin H. <mar...@ya...> - 2003-08-25 20:43:20
|
Hi All,
Thanks to Jean-Pierre the for the alwaysUseFullPath suggestion. It did
solve my problem where I was mapping /foo/[a-z]* to a servlet, but I am
running into another quandary.
When I map longer URL's the code seems to break. I am trying to map
/journal/entry/2003-aug10/test/DSCN5023.jpg
to a web form. My project-servlet.xml looks like:
<bean id="urlMapping" class="...">
<property name="alwaysUseFullPath"><value>true</value></property>
<property name="mappings">
<props>
<prop key="/journal/entry.html">JournalEntryForm</prop>
<prop key="/journal/entry/*">JournalEntryForm</prop>
...
</props>
</property>
</bean>
and within my web.xml I use the following:
<servlet-mapping>
<servlet-name>project451</servlet-name>
<url-pattern>/journal/*</url-pattern>
</servlet-mapping>
I have tracked down the problem to PathMatcher.java where the conditional
"patIdxStart > patIdxEnd" seems to disallow my URL to be properly mapped.
As a test I just return true at that spot and everything is fine.
Am I doing something wrong or is there a problem with the path matcher?
Thanks,
Martin
---
PS Here's some debug output from within PathMatcher in that if statement:
looking for '/journal/entry/2003-aug10/test/DSCN5023.jpg' in
'/journal/entry/*'
pattern=/journal/entry/*
str=/journal/entry/2003-aug10/test/DSCN5023.jpg
patIdxStart=3
patIdxEnd=2
strIdxStart=3
strIdxEnd=4
returning false 3a
|
|
From: <jue...@we...> - 2003-08-25 20:38:09
|
SSBhZ3JlZSB0aGF0IGluIGNhc2Ugb2YgYW4gZXhpc3RpbmcgY29ubmVjdGlvbiwgU2luZ2xlQ29u bmVjdGlvbkRhdGFTb3VyY2Ugc2hvdWxkIG5vdCBvdmVycmlkZSB0aGUgY29tbW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UgY3VycmVudCBDVlMgY29udGVudHMgYWdhaW5zdCBv d24gYXBwbGljYXRpb25zPw0KCT4NCgkNCglJIGFtIHVwZGF0aW5nIHRoZSBTdGVwLWJ5LXN0ZXAt TVZDIGRvY3VtZW50IC0gd2hhdCB3aWxsIHRoZSBleGFjdCBuYW1lIG9mIHRoZQ0KCWRpcmVjdG9y eSBhbmQgdGhlIGphciBmaWxlIGJlPyAgSSdtIGFzc3VtaW5nICdzcHJpbmctZnJhbWV3b3JrLTEu ME0xJyBhbmQNCgknc3ByaW5nLWZ1bGwtMS4wTTEuamFyJy4NCgkNCglUaG9tYXMgDQoJDQoNCg== |
|
From: Kopylenko, D. <dko...@ac...> - 2003-08-25 19:15:35
|
Hello everybody,
Now there is an EventPublicationInterceptor which could publish any
ApplicationEvent to all the ApplicationListeners registered with
ApplicationContext. It could be used like this:
<bean id="referenceDataChangedEventPublicationInterceptor"
class="org.springframework.context.interceptor.EventPublicationInterceptor">
<property name="applicationEventClassName">
<value>com.mycompany.referencedata.ReferenceDataChangedEvent</value></proper
ty>
</bean>
<bean id="addSomeRefDataMethodPointcut"
class="org.springframework.aop.framework.RegexpMethodPointcut">
<property name="pattern"><value>.*addRefData</value></property>
<property name="interceptor"><ref
bean="referenceDataChangedEventPublicationInterceptor"/></property>
</bean>
<bean id="myBusinessService"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property
name="proxyInterfaces"><value>com.mycompany.MyBusinessService</value></prope
rty>
<property
name="interceptorNames"><value>addSomeRefDataMethodPointcut,myBusinessServic
eTarget</value></property>
</bean>
Please note that the applicationEventClassName property of the
EventPublicationInterceptor must be of type
org.springframework.context.ApplicationEvent
Regards,
Dmitriy.
|
|
From: Colin S. <col...@ex...> - 2003-08-25 18:02:28
|
I want to use SingleConnectionDataSource with Hibernate, so I can wrap a connection I get from a Hibernate Session, and feed it as a DataSource to JDBCTemplate/JDBCHelper. However, right now I've had to make my own variant since the current code always calls source.setAutoCommit(true); in the init() method. This seems very arbitrary to me. At least in the case when the class is given an existing connection, it should just assume the commit option has been set appropriately on the connection. Even in the case when the class is opening the connection itself from an existing DataSource, there needs to be an option to set autoCommit either way. Regards, Colin |
|
From: <jue...@we...> - 2003-08-25 16:37:46
|
Thomas, Lars, Oops, didn't think of that: Yes, we dropped ContextLoaderServlet before = 0.9, and re-added it after 0.9.1 for Servlet 2.2 containers. Seems that = we now have one more reason for it: Servlet 2.3 containers with awkward = initialization order. Anyway, ContextLoaderServlet *will* be in 1.0 M1, to be released at the = end of this week if there aren't any major obstacles. BTW, can everybody = please test the current CVS contents against own applications? Lars, 1.0 M1 will be the first release with org.springframework as = package name, but it should still be a drop-in replacement if you = replace com.interface21 with org.springframework in all of your code = (both Java source and XML files). Juergen -----Original Message----- From: tri...@tr... [mailto:tri...@tr...] Sent: Monday, August 25, 2003 4:33 PM To: j=FCrgen h=F6ller [werk3AT] Cc: Lars Fischer; spr...@li... Subject: RE: [Springframework-developer] Example classes needed Juergen, The problem is that 'com.interface21.web.context.ContextLoaderServlet' = can't=20 be found in the classpath - it is not in the spring-full-0.9.jar from = the=20 distribution. Did we remove this file and later add it back in? Lars - I have attached a jar file that contains this missing class - add = that=20 to your lib directory. Also, remove the <listener> entry in web.xml. Thomas > Lars, >=20 > You mean that >=20 > <servlet> > <servlet-name>contextLoader</servlet-name> > =20 > = <servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-= class> > <load-on-startup>1</load-on-startup> > </servlet> >=20 > <servlet> > <servlet-name>example</servlet-name> > =20 > = <servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-cla= ss> > <load-on-startup>2</load-on-startup> > </servlet> >=20 > still loads the DispatcherServlet before the ContextLoaderServlet? = Ignoring > the load-on-startup values would be a major bug in WebLogic's web = container. > Are you *really* sure that a web.xml with entries like the above = causes wrong > initialization order? Please recheck that thoroughly! >=20 > It's bad enough that WebLogic invokes the listeners at the wrong time, = but > unfortunately that is not actually conflicting with the current spec. = I can't > believe that it ignores servlet load-on-startup values though - how = did it > get its J2EE 1.3 certification then? It seems to work on Thomas' > installation, so there should be a way to make it work on yours. >=20 > Even in the extreme case, a solution can be found. You could for = example just > use a servlet-specific context and no root context, by simply omitting = the > context loader definition. You could subclass DispatcherServlet to = perform > initialization of the root context before continuing with its own. But = I'm > pretty sure that none of these will be necessary. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: Lars Fischer [mailto:lar...@gm...] > Sent: Monday, August 25, 2003 10:32 AM > To: j=FCrgen h=F6ller [werk3AT] > Cc: tri...@tr...; = spr...@li... > Subject: RE: [Springframework-developer] Example classes needed >=20 >=20 > J=FCrgen, >=20 > the problem is that the ***-servlet.xml stuff is always loaded before > the applicationContext.xml stuff no matter what I define in=20 > web.xml. This is against the documentation. >=20 > I will open a case with BEA support (this would be the first time they > would solve an issue but you can never know ...). >=20 > It seems like I have to use another server but unless there is no = error > in my application Spring is no alternative for production applications > (Petclinic does not work too at the moment). >=20 > Is there any difference between the Java SDK versions ? >=20 > Thanks > Lars >=20 > > Lars, Thomas, > >=20 > > I guess that WebLogic simply invokes the listeners after = load-on-startup=20 > > servlets. Bad WebLogic ;-) > >=20 > > Unfortunately, the Servlet 2.3 spec leaves this unspecified. The = Servlet=20 > > 2.4 spec clarifies that listeners have to be *initialized before* = and=20 > > *destroyed after* any servlets. Tomcat and Resin already behave this = > > way, Orion does too since 2.0.2 after I've informed them about the=20 > > Servlet 2.4 clarification... > >=20 > > For a solution with current WebLogic versions, I agree that using = the=20 > > servlet initializers like ContextLoaderServlet and = Log4jConfigServlet is=20 > > probably the best choice, as Thomas has recommended. > >=20 > > Juergen > >=20 > >=20 > > -----Original Message----- > > From: tri...@tr... [mailto:tri...@tr...] > > Sent: Sunday, August 24, 2003 10:49 PM > > To: Lars Fischer > > Cc: spr...@li... > > Subject: Re: [Springframework-developer] Example classes needed > >=20 > >=20 > > Lars, > >=20 > > Loading ContextLoaderServlet as a servlet with load-on-startup set = to 1=20 > > and > > loading DispatcherServlet with load-on-startup set to 2 works for me = on=20 > > WebLogic > > 8.1 SP1. If it does not work, could you send me the web.xml and = your=20 > > log output? > >=20 > > Also, I get the same errors deploying the Petclinic, so it does not = work=20 > > for me. > > Can you send me the petclinic war file that works with WebLogic 8.1 = SP1=20 > > so I > > can try it on my server? > >=20 > > Thomas > >=20 > >=20 > > > Thomas, > > >=20 > > > thanks for the suggestion. Tried it but it doesn't work. > > >=20 > > > This is a serious one: > > >=20 > > > Tested my app with Tomcat 4.1.24 and it works. > > >=20 > > > I does NOT work with > > >=20 > > > WebLogic 8.1 SP1, WebLogic Express SP1, WebLogic 7.0 SP3. > > >=20 > > > What makes me wonder is that Petclinic works with WebLogic 8.1 = SP1. > > >=20 > > > Regards > > > Lars > > >=20 > > > > Lars, > > > >=20 > > > > I have looked into this a little bit more. What happens is that = > > > > ServletContextListener.contextInitialized() method is called = _after_=20 > > the =20 > > > > HttpServlet.init() method is called on servlets specified with=20 > > <load-on- > > > > startup>. This causes the xxx-servlet.xml to be loaded before = the=20 > > > > applicationContext.xml is loaded, so that is why you can't = reference=20 > >=20 > > > > the 'cwxDao' bean. This behavior is the opposite of what I see = for > > > > Tomcat,=20 > > > > and I'm sure the same is true for Orion and Resin that Juergen = is=20 > > using.=20 > > > > I=20 > > > > looked in the Servlet 2.3 specification, but I did not see = anything > > > > specifying=20 > > > > which order these methods should be called in. Maybe Juergen or = Rod=20 > > can > > > > shed=20 > > > > some more light on this issue. =20 > > > >=20 > > > > You should be able to use the ContextLoaderServlet for now. > > > >=20 > > > > Thomas > >=20 >=20 >=20 |
|
From: <jue...@we...> - 2003-08-25 14:41:58
|
Lars, Thomas, I guess that WebLogic simply invokes the listeners after load-on-startup = servlets. Bad WebLogic ;-) Unfortunately, the Servlet 2.3 spec leaves this unspecified. The Servlet = 2.4 spec clarifies that listeners have to be *initialized before* and = *destroyed after* any servlets. Tomcat and Resin already behave this = way, Orion does too since 2.0.2 after I've informed them about the = Servlet 2.4 clarification... For a solution with current WebLogic versions, I agree that using the = servlet initializers like ContextLoaderServlet and Log4jConfigServlet is = probably the best choice, as Thomas has recommended. Juergen -----Original Message----- From: tri...@tr... [mailto:tri...@tr...] Sent: Sunday, August 24, 2003 10:49 PM To: Lars Fischer Cc: spr...@li... Subject: Re: [Springframework-developer] Example classes needed Lars, Loading ContextLoaderServlet as a servlet with load-on-startup set to 1 = and loading DispatcherServlet with load-on-startup set to 2 works for me on = WebLogic 8.1 SP1. If it does not work, could you send me the web.xml and your = log output? Also, I get the same errors deploying the Petclinic, so it does not work = for me. Can you send me the petclinic war file that works with WebLogic 8.1 SP1 = so I can try it on my server? Thomas > Thomas, >=20 > thanks for the suggestion. Tried it but it doesn't work. >=20 > This is a serious one: >=20 > Tested my app with Tomcat 4.1.24 and it works. >=20 > I does NOT work with >=20 > WebLogic 8.1 SP1, WebLogic Express SP1, WebLogic 7.0 SP3. >=20 > What makes me wonder is that Petclinic works with WebLogic 8.1 SP1. >=20 > Regards > Lars >=20 > > Lars, > >=20 > > I have looked into this a little bit more. What happens is that=20 > > ServletContextListener.contextInitialized() method is called _after_ = the =20 > > HttpServlet.init() method is called on servlets specified with = <load-on- > > startup>. This causes the xxx-servlet.xml to be loaded before the=20 > > applicationContext.xml is loaded, so that is why you can't reference = > > the 'cwxDao' bean. This behavior is the opposite of what I see for > > Tomcat,=20 > > and I'm sure the same is true for Orion and Resin that Juergen is = using.=20 > > I=20 > > looked in the Servlet 2.3 specification, but I did not see anything > > specifying=20 > > which order these methods should be called in. Maybe Juergen or Rod = can > > shed=20 > > some more light on this issue. =20 > >=20 > > You should be able to use the ContextLoaderServlet for now. > >=20 > > Thomas |
|
From: <tri...@tr...> - 2003-08-24 20:48:35
|
Lars,
Loading ContextLoaderServlet as a servlet with load-on-startup set to 1 and
loading DispatcherServlet with load-on-startup set to 2 works for me on WebLogic
8.1 SP1. If it does not work, could you send me the web.xml and your log output?
Also, I get the same errors deploying the Petclinic, so it does not work for me.
Can you send me the petclinic war file that works with WebLogic 8.1 SP1 so I
can try it on my server?
Thomas
> Thomas,
>
> thanks for the suggestion. Tried it but it doesn't work.
>
> This is a serious one:
>
> Tested my app with Tomcat 4.1.24 and it works.
>
> I does NOT work with
>
> WebLogic 8.1 SP1, WebLogic Express SP1, WebLogic 7.0 SP3.
>
> What makes me wonder is that Petclinic works with WebLogic 8.1 SP1.
>
> Regards
> Lars
>
> > Lars,
> >
> > I have looked into this a little bit more. What happens is that
> > ServletContextListener.contextInitialized() method is called _after_ the
> > HttpServlet.init() method is called on servlets specified with <load-on-
> > startup>. This causes the xxx-servlet.xml to be loaded before the
> > applicationContext.xml is loaded, so that is why you can't reference
> > the 'cwxDao' bean. This behavior is the opposite of what I see for
> > Tomcat,
> > and I'm sure the same is true for Orion and Resin that Juergen is using.
> > I
> > looked in the Servlet 2.3 specification, but I did not see anything
> > specifying
> > which order these methods should be called in. Maybe Juergen or Rod can
> > shed
> > some more light on this issue.
> >
> > You should be able to use the ContextLoaderServlet for now.
> >
> > Thomas
> >
> >
> > > Lars,
> > >
> > > This might be a WebLogic specific issue - I just saw similar error when
> > I
> > > deployed my app in WebLogic 8.1.
> > >
> > > I will try to research this in more detail later on today or tomorrow.
> > In
> > > the
> > > meantime try this in your web.xml
> > >
> > > <servlet>
> > > <servlet-name>cwxRootContext</servlet-name>
> > >
> > <servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-
> > class>
> > > <load-on-startup>1</load-on-startup>
> > > </servlet>
> > >
> > > <servlet>
> > > <servlet-name>cwx</servlet-name>
> > >
> >
> <servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-class>
> > > <load-on-startup>2</load-on-startup>
> > > </servlet>
> > >
> > > Thomas
> > >
> > >
> > >
> > > > Thomas,
> > > >
> > > > attached is the web.xml.
> > > >
> > > > Without the ContextLoaderListener nothing would happen, not even
> > > > the Hibernate stuff in applicationContext.xml.
> > > >
> > > > Thanks
> > > > Lars
> > > >
> > > > > Lars,
> > > > >
> > > > > You did not include your web.xml, but my guess is you need to add a
> > > > > ContextLoaderListener. The application context has to be loaded
> > first,
> > > > > and the
> > > > > error messages indicates that the bean 'cwxDao' can't be found, so
> > it
> > > > > looks like
> > > > > that did not happen.
> > > > >
> > > > > web.xml:
> > > > >
> > > > > <web-app>
> > > > >
> > > > > <!--
> > > > > - Loads the root application context of this web app at startup,
> > > > > - by default from "/WEB-INF/applicationContext.xml".
> > > > > -->
> > > > > <listener>
> > > > > <listener-class>
> > > > > com.interface21.web.context.ContextLoaderListener
> > > > > </listener-class>
> > > > > </listener>
> > > > >
> > > > > <!-- more definitions -->
> > > > >
> > > > > </web-app>
> > > > >
> > > > >
> > > > > Hope this helps.
> > > > >
> > > > > Thomas
> > > > >
> > > > >
> > > > >
> > > > > > Hi all Spring experts,
> > > > > >
> > > > > > can anyone provide me the example classes mentioned in several
> > > skeletons
> > > > >
> > > > > > (e.g. exampleController, exampleBusinessObject,
> > > exampleDataAccessObject)
> > > > > ?
> > > > > >
> > > > > > The two provided sample applications don't reflect the skeletons
> > very
> > > > > well.
> > > > > > There should be one 'big' application showing all the stuff and
> > many
> > > > > small
> > > > > > ones to show single options (like in WebWork 1).
> > > > > >
> > > > > > I've defined the following in applicationContext.xml (and it
> > works):
> > > > > >
> > > > > > <bean id="cwxDao" class="example.dao.CwxDaoHibernate">
> > > > > > <property name="sessionFactory"><ref
> > > > > bean="cwxSessionFactory"/></property>
> > > > > > </bean>
> > > > > >
> > > > > > When defining
> > > > > >
> > > > > > (cwx-servlet.xml)
> > > > > >
> > > > > > <!-- Controller for the initial "Hello" page -->
> > > > > > <bean id="cwxController" class="example.web.CwxController">
> > > > > > <property name="cwxDao"><ref external="cwxDao"/></property>
> > > > > > </bean>
> > > > > >
> > > > > > (CwxController)
> > > > > >
> > > > > > private CwxDao cwxDao;
> > > > > >
> > > > > > public void setCwxDao(CwxDao cwxDao) {
> > > > > > this.cwxDao = cwxDao;
> > > > > > }
> > > > > >
> > > > > >
> > > > > > I always get
> > > > > >
> > > > > > ERROR [com.interface21.web.servlet.DispatcherServlet] - <Servlet
> > with
> > > > > name
> > > > > > 'cwx' : initialization error>
> > > > > > com.interface21.beans.factory.NoSuchBeanDefinitionException: No
> > bean
> > > > > named
> > > > > > [cwxDao] is defined {class
> > > > > com.interface21.beans.factory.xml.XmlBeanFactory:
> > > > > > defined beans
> > [messageSource,viewResolver,urlMapping,cwxController]}
> > > > > >
> > > > > > This is the second time I get almost useless error messages. This
> > is
> > > one
> > > > > > point where EJBs are far ahead (
> > > > > > there is almost always an error message telling you what excactly
> > is
> > > > > > wrong).
> > > > > >
> > > > > > Another (dumb) question:
> > > > > >
> > > > > > What is the difference between a DAO *implementation* and a
> > business
> > > > > object
> > > > > > and where does
> > > > > > e. g. Petclinic reflect this ? I'm asking this because of the
> > > diiference
> > > > > > between the skeletons and the
> > > > > > sample applications. The skeletons provide a DAO and a Business
> > Object
> > > > > using
> > > > > > the DAO definition,
> > > > > > Petclinic does not. The samples should be as close as possible to
> > the
> > > > > > skeletons or the skeletons should
> > > > > > at least provide the java classes (shouldn't be too hard).
> > > > > >
> > > > > > Thanks in advance
> > > > > > Lars
> > > > > >
> > > > > >
> > > > > >
> > > > > > -------------------------------------------------------
> > > > > > This SF.net email is sponsored by: VM Ware
> > > > > > With VMware you can run multiple operating systems on a single
> > > machine.
> > > > > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > > > > > at the same time. Free trial click
> > > > > here:http://www.vmware.com/wl/offer/358/0
> > > > > > _______________________________________________
> > > > > > Springframework-developer mailing list
> > > > > > Spr...@li...
> > > > > >
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: VM Ware
> > > With VMware you can run multiple operating systems on a single machine.
> > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > > at the same time. Free trial click
> > here:http://www.vmware.com/wl/offer/358/0
> > > _______________________________________________
> > > Springframework-developer mailing list
> > > Spr...@li...
> > > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: VM Ware
> > With VMware you can run multiple operating systems on a single machine.
> > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > at the same time. Free trial click
> > here:http://www.vmware.com/wl/offer/358/0
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Lars F. <lar...@gm...> - 2003-08-24 16:15:02
|
Thomas,
thanks for the suggestion. Tried it but it doesn't work.
This is a serious one:
Tested my app with Tomcat 4.1.24 and it works.
I does NOT work with
WebLogic 8.1 SP1, WebLogic Express SP1, WebLogic 7.0 SP3.
What makes me wonder is that Petclinic works with WebLogic 8.1 SP1.
Regards
Lars
> Lars,
>
> I have looked into this a little bit more. What happens is that
> ServletContextListener.contextInitialized() method is called _after_ the
> HttpServlet.init() method is called on servlets specified with <load-on-
> startup>. This causes the xxx-servlet.xml to be loaded before the
> applicationContext.xml is loaded, so that is why you can't reference
> the 'cwxDao' bean. This behavior is the opposite of what I see for
> Tomcat,
> and I'm sure the same is true for Orion and Resin that Juergen is using.
> I
> looked in the Servlet 2.3 specification, but I did not see anything
> specifying
> which order these methods should be called in. Maybe Juergen or Rod can
> shed
> some more light on this issue.
>
> You should be able to use the ContextLoaderServlet for now.
>
> Thomas
>
>
> > Lars,
> >
> > This might be a WebLogic specific issue - I just saw similar error when
> I
> > deployed my app in WebLogic 8.1.
> >
> > I will try to research this in more detail later on today or tomorrow.
> In
> > the
> > meantime try this in your web.xml
> >
> > <servlet>
> > <servlet-name>cwxRootContext</servlet-name>
> >
> <servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-
> class>
> > <load-on-startup>1</load-on-startup>
> > </servlet>
> >
> > <servlet>
> > <servlet-name>cwx</servlet-name>
> >
>
<servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-class>
> > <load-on-startup>2</load-on-startup>
> > </servlet>
> >
> > Thomas
> >
> >
> >
> > > Thomas,
> > >
> > > attached is the web.xml.
> > >
> > > Without the ContextLoaderListener nothing would happen, not even
> > > the Hibernate stuff in applicationContext.xml.
> > >
> > > Thanks
> > > Lars
> > >
> > > > Lars,
> > > >
> > > > You did not include your web.xml, but my guess is you need to add a
> > > > ContextLoaderListener. The application context has to be loaded
> first,
> > > > and the
> > > > error messages indicates that the bean 'cwxDao' can't be found, so
> it
> > > > looks like
> > > > that did not happen.
> > > >
> > > > web.xml:
> > > >
> > > > <web-app>
> > > >
> > > > <!--
> > > > - Loads the root application context of this web app at startup,
> > > > - by default from "/WEB-INF/applicationContext.xml".
> > > > -->
> > > > <listener>
> > > > <listener-class>
> > > > com.interface21.web.context.ContextLoaderListener
> > > > </listener-class>
> > > > </listener>
> > > >
> > > > <!-- more definitions -->
> > > >
> > > > </web-app>
> > > >
> > > >
> > > > Hope this helps.
> > > >
> > > > Thomas
> > > >
> > > >
> > > >
> > > > > Hi all Spring experts,
> > > > >
> > > > > can anyone provide me the example classes mentioned in several
> > skeletons
> > > >
> > > > > (e.g. exampleController, exampleBusinessObject,
> > exampleDataAccessObject)
> > > > ?
> > > > >
> > > > > The two provided sample applications don't reflect the skeletons
> very
> > > > well.
> > > > > There should be one 'big' application showing all the stuff and
> many
> > > > small
> > > > > ones to show single options (like in WebWork 1).
> > > > >
> > > > > I've defined the following in applicationContext.xml (and it
> works):
> > > > >
> > > > > <bean id="cwxDao" class="example.dao.CwxDaoHibernate">
> > > > > <property name="sessionFactory"><ref
> > > > bean="cwxSessionFactory"/></property>
> > > > > </bean>
> > > > >
> > > > > When defining
> > > > >
> > > > > (cwx-servlet.xml)
> > > > >
> > > > > <!-- Controller for the initial "Hello" page -->
> > > > > <bean id="cwxController" class="example.web.CwxController">
> > > > > <property name="cwxDao"><ref external="cwxDao"/></property>
> > > > > </bean>
> > > > >
> > > > > (CwxController)
> > > > >
> > > > > private CwxDao cwxDao;
> > > > >
> > > > > public void setCwxDao(CwxDao cwxDao) {
> > > > > this.cwxDao = cwxDao;
> > > > > }
> > > > >
> > > > >
> > > > > I always get
> > > > >
> > > > > ERROR [com.interface21.web.servlet.DispatcherServlet] - <Servlet
> with
> > > > name
> > > > > 'cwx' : initialization error>
> > > > > com.interface21.beans.factory.NoSuchBeanDefinitionException: No
> bean
> > > > named
> > > > > [cwxDao] is defined {class
> > > > com.interface21.beans.factory.xml.XmlBeanFactory:
> > > > > defined beans
> [messageSource,viewResolver,urlMapping,cwxController]}
> > > > >
> > > > > This is the second time I get almost useless error messages. This
> is
> > one
> > > > > point where EJBs are far ahead (
> > > > > there is almost always an error message telling you what excactly
> is
> > > > > wrong).
> > > > >
> > > > > Another (dumb) question:
> > > > >
> > > > > What is the difference between a DAO *implementation* and a
> business
> > > > object
> > > > > and where does
> > > > > e. g. Petclinic reflect this ? I'm asking this because of the
> > diiference
> > > > > between the skeletons and the
> > > > > sample applications. The skeletons provide a DAO and a Business
> Object
> > > > using
> > > > > the DAO definition,
> > > > > Petclinic does not. The samples should be as close as possible to
> the
> > > > > skeletons or the skeletons should
> > > > > at least provide the java classes (shouldn't be too hard).
> > > > >
> > > > > Thanks in advance
> > > > > Lars
> > > > >
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > This SF.net email is sponsored by: VM Ware
> > > > > With VMware you can run multiple operating systems on a single
> > machine.
> > > > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > > > > at the same time. Free trial click
> > > > here:http://www.vmware.com/wl/offer/358/0
> > > > > _______________________________________________
> > > > > Springframework-developer mailing list
> > > > > Spr...@li...
> > > > >
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: VM Ware
> > With VMware you can run multiple operating systems on a single machine.
> > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > at the same time. Free trial click
> here:http://www.vmware.com/wl/offer/358/0
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click
> here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: <tri...@tr...> - 2003-08-23 23:15:34
|
Lars,
I have looked into this a little bit more. What happens is that
ServletContextListener.contextInitialized() method is called _after_ the
HttpServlet.init() method is called on servlets specified with <load-on-
startup>. This causes the xxx-servlet.xml to be loaded before the
applicationContext.xml is loaded, so that is why you can't reference
the 'cwxDao' bean. This behavior is the opposite of what I see for Tomcat,
and I'm sure the same is true for Orion and Resin that Juergen is using. I
looked in the Servlet 2.3 specification, but I did not see anything specifying
which order these methods should be called in. Maybe Juergen or Rod can shed
some more light on this issue.
You should be able to use the ContextLoaderServlet for now.
Thomas
> Lars,
>
> This might be a WebLogic specific issue - I just saw similar error when I
> deployed my app in WebLogic 8.1.
>
> I will try to research this in more detail later on today or tomorrow. In
> the
> meantime try this in your web.xml
>
> <servlet>
> <servlet-name>cwxRootContext</servlet-name>
> <servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-
class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> <servlet>
> <servlet-name>cwx</servlet-name>
> <servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-class>
> <load-on-startup>2</load-on-startup>
> </servlet>
>
> Thomas
>
>
>
> > Thomas,
> >
> > attached is the web.xml.
> >
> > Without the ContextLoaderListener nothing would happen, not even
> > the Hibernate stuff in applicationContext.xml.
> >
> > Thanks
> > Lars
> >
> > > Lars,
> > >
> > > You did not include your web.xml, but my guess is you need to add a
> > > ContextLoaderListener. The application context has to be loaded first,
> > > and the
> > > error messages indicates that the bean 'cwxDao' can't be found, so it
> > > looks like
> > > that did not happen.
> > >
> > > web.xml:
> > >
> > > <web-app>
> > >
> > > <!--
> > > - Loads the root application context of this web app at startup,
> > > - by default from "/WEB-INF/applicationContext.xml".
> > > -->
> > > <listener>
> > > <listener-class>
> > > com.interface21.web.context.ContextLoaderListener
> > > </listener-class>
> > > </listener>
> > >
> > > <!-- more definitions -->
> > >
> > > </web-app>
> > >
> > >
> > > Hope this helps.
> > >
> > > Thomas
> > >
> > >
> > >
> > > > Hi all Spring experts,
> > > >
> > > > can anyone provide me the example classes mentioned in several
> skeletons
> > >
> > > > (e.g. exampleController, exampleBusinessObject,
> exampleDataAccessObject)
> > > ?
> > > >
> > > > The two provided sample applications don't reflect the skeletons very
> > > well.
> > > > There should be one 'big' application showing all the stuff and many
> > > small
> > > > ones to show single options (like in WebWork 1).
> > > >
> > > > I've defined the following in applicationContext.xml (and it works):
> > > >
> > > > <bean id="cwxDao" class="example.dao.CwxDaoHibernate">
> > > > <property name="sessionFactory"><ref
> > > bean="cwxSessionFactory"/></property>
> > > > </bean>
> > > >
> > > > When defining
> > > >
> > > > (cwx-servlet.xml)
> > > >
> > > > <!-- Controller for the initial "Hello" page -->
> > > > <bean id="cwxController" class="example.web.CwxController">
> > > > <property name="cwxDao"><ref external="cwxDao"/></property>
> > > > </bean>
> > > >
> > > > (CwxController)
> > > >
> > > > private CwxDao cwxDao;
> > > >
> > > > public void setCwxDao(CwxDao cwxDao) {
> > > > this.cwxDao = cwxDao;
> > > > }
> > > >
> > > >
> > > > I always get
> > > >
> > > > ERROR [com.interface21.web.servlet.DispatcherServlet] - <Servlet with
> > > name
> > > > 'cwx' : initialization error>
> > > > com.interface21.beans.factory.NoSuchBeanDefinitionException: No bean
> > > named
> > > > [cwxDao] is defined {class
> > > com.interface21.beans.factory.xml.XmlBeanFactory:
> > > > defined beans [messageSource,viewResolver,urlMapping,cwxController]}
> > > >
> > > > This is the second time I get almost useless error messages. This is
> one
> > > > point where EJBs are far ahead (
> > > > there is almost always an error message telling you what excactly is
> > > > wrong).
> > > >
> > > > Another (dumb) question:
> > > >
> > > > What is the difference between a DAO *implementation* and a business
> > > object
> > > > and where does
> > > > e. g. Petclinic reflect this ? I'm asking this because of the
> diiference
> > > > between the skeletons and the
> > > > sample applications. The skeletons provide a DAO and a Business Object
> > > using
> > > > the DAO definition,
> > > > Petclinic does not. The samples should be as close as possible to the
> > > > skeletons or the skeletons should
> > > > at least provide the java classes (shouldn't be too hard).
> > > >
> > > > Thanks in advance
> > > > Lars
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.net email is sponsored by: VM Ware
> > > > With VMware you can run multiple operating systems on a single
> machine.
> > > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > > > at the same time. Free trial click
> > > here:http://www.vmware.com/wl/offer/358/0
> > > > _______________________________________________
> > > > Springframework-developer mailing list
> > > > Spr...@li...
> > > > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > > >
> > >
> > >
> > >
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: <tri...@tr...> - 2003-08-23 16:55:22
|
Lars,
This might be a WebLogic specific issue - I just saw similar error when I
deployed my app in WebLogic 8.1.
I will try to research this in more detail later on today or tomorrow. In the
meantime try this in your web.xml
<servlet>
<servlet-name>cwxRootContext</servlet-name>
<servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>cwx</servlet-name>
<servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
Thomas
> Thomas,
>
> attached is the web.xml.
>
> Without the ContextLoaderListener nothing would happen, not even
> the Hibernate stuff in applicationContext.xml.
>
> Thanks
> Lars
>
> > Lars,
> >
> > You did not include your web.xml, but my guess is you need to add a
> > ContextLoaderListener. The application context has to be loaded first,
> > and the
> > error messages indicates that the bean 'cwxDao' can't be found, so it
> > looks like
> > that did not happen.
> >
> > web.xml:
> >
> > <web-app>
> >
> > <!--
> > - Loads the root application context of this web app at startup,
> > - by default from "/WEB-INF/applicationContext.xml".
> > -->
> > <listener>
> > <listener-class>
> > com.interface21.web.context.ContextLoaderListener
> > </listener-class>
> > </listener>
> >
> > <!-- more definitions -->
> >
> > </web-app>
> >
> >
> > Hope this helps.
> >
> > Thomas
> >
> >
> >
> > > Hi all Spring experts,
> > >
> > > can anyone provide me the example classes mentioned in several skeletons
> >
> > > (e.g. exampleController, exampleBusinessObject, exampleDataAccessObject)
> > ?
> > >
> > > The two provided sample applications don't reflect the skeletons very
> > well.
> > > There should be one 'big' application showing all the stuff and many
> > small
> > > ones to show single options (like in WebWork 1).
> > >
> > > I've defined the following in applicationContext.xml (and it works):
> > >
> > > <bean id="cwxDao" class="example.dao.CwxDaoHibernate">
> > > <property name="sessionFactory"><ref
> > bean="cwxSessionFactory"/></property>
> > > </bean>
> > >
> > > When defining
> > >
> > > (cwx-servlet.xml)
> > >
> > > <!-- Controller for the initial "Hello" page -->
> > > <bean id="cwxController" class="example.web.CwxController">
> > > <property name="cwxDao"><ref external="cwxDao"/></property>
> > > </bean>
> > >
> > > (CwxController)
> > >
> > > private CwxDao cwxDao;
> > >
> > > public void setCwxDao(CwxDao cwxDao) {
> > > this.cwxDao = cwxDao;
> > > }
> > >
> > >
> > > I always get
> > >
> > > ERROR [com.interface21.web.servlet.DispatcherServlet] - <Servlet with
> > name
> > > 'cwx' : initialization error>
> > > com.interface21.beans.factory.NoSuchBeanDefinitionException: No bean
> > named
> > > [cwxDao] is defined {class
> > com.interface21.beans.factory.xml.XmlBeanFactory:
> > > defined beans [messageSource,viewResolver,urlMapping,cwxController]}
> > >
> > > This is the second time I get almost useless error messages. This is one
> > > point where EJBs are far ahead (
> > > there is almost always an error message telling you what excactly is
> > > wrong).
> > >
> > > Another (dumb) question:
> > >
> > > What is the difference between a DAO *implementation* and a business
> > object
> > > and where does
> > > e. g. Petclinic reflect this ? I'm asking this because of the diiference
> > > between the skeletons and the
> > > sample applications. The skeletons provide a DAO and a Business Object
> > using
> > > the DAO definition,
> > > Petclinic does not. The samples should be as close as possible to the
> > > skeletons or the skeletons should
> > > at least provide the java classes (shouldn't be too hard).
> > >
> > > Thanks in advance
> > > Lars
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: VM Ware
> > > With VMware you can run multiple operating systems on a single machine.
> > > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > > at the same time. Free trial click
> > here:http://www.vmware.com/wl/offer/358/0
> > > _______________________________________________
> > > Springframework-developer mailing list
> > > Spr...@li...
> > > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > >
> >
> >
> >
|
|
From: <tri...@tr...> - 2003-08-23 14:17:55
|
Lars,
You did not include your web.xml, but my guess is you need to add a
ContextLoaderListener. The application context has to be loaded first, and the
error messages indicates that the bean 'cwxDao' can't be found, so it looks like
that did not happen.
web.xml:
<web-app>
<!--
- Loads the root application context of this web app at startup,
- by default from "/WEB-INF/applicationContext.xml".
-->
<listener>
<listener-class>
com.interface21.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- more definitions -->
</web-app>
Hope this helps.
Thomas
> Hi all Spring experts,
>
> can anyone provide me the example classes mentioned in several skeletons
> (e.g. exampleController, exampleBusinessObject, exampleDataAccessObject) ?
>
> The two provided sample applications don't reflect the skeletons very well.
> There should be one 'big' application showing all the stuff and many small
> ones to show single options (like in WebWork 1).
>
> I've defined the following in applicationContext.xml (and it works):
>
> <bean id="cwxDao" class="example.dao.CwxDaoHibernate">
> <property name="sessionFactory"><ref bean="cwxSessionFactory"/></property>
> </bean>
>
> When defining
>
> (cwx-servlet.xml)
>
> <!-- Controller for the initial "Hello" page -->
> <bean id="cwxController" class="example.web.CwxController">
> <property name="cwxDao"><ref external="cwxDao"/></property>
> </bean>
>
> (CwxController)
>
> private CwxDao cwxDao;
>
> public void setCwxDao(CwxDao cwxDao) {
> this.cwxDao = cwxDao;
> }
>
>
> I always get
>
> ERROR [com.interface21.web.servlet.DispatcherServlet] - <Servlet with name
> 'cwx' : initialization error>
> com.interface21.beans.factory.NoSuchBeanDefinitionException: No bean named
> [cwxDao] is defined {class com.interface21.beans.factory.xml.XmlBeanFactory:
> defined beans [messageSource,viewResolver,urlMapping,cwxController]}
>
> This is the second time I get almost useless error messages. This is one
> point where EJBs are far ahead (
> there is almost always an error message telling you what excactly is
> wrong).
>
> Another (dumb) question:
>
> What is the difference between a DAO *implementation* and a business object
> and where does
> e. g. Petclinic reflect this ? I'm asking this because of the diiference
> between the skeletons and the
> sample applications. The skeletons provide a DAO and a Business Object using
> the DAO definition,
> Petclinic does not. The samples should be as close as possible to the
> skeletons or the skeletons should
> at least provide the java classes (shouldn't be too hard).
>
> Thanks in advance
> Lars
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Kopylenko, D. <dko...@ac...> - 2003-08-23 13:56:36
|
Lars,
can you please post entire contents of applicationContext.xml and
cwx-servlet.xml ?
Thanks,
Dmitriy.
-----Original Message-----
From: Lars Fischer
To: spr...@li...
Sent: 8/23/2003 8:35 AM
Subject: [Springframework-developer] Example classes needed
Hi all Spring experts,
can anyone provide me the example classes mentioned in several skeletons
(e.g. exampleController, exampleBusinessObject, exampleDataAccessObject)
?
The two provided sample applications don't reflect the skeletons very
well.
There should be one 'big' application showing all the stuff and many
small
ones to show single options (like in WebWork 1).
I've defined the following in applicationContext.xml (and it works):
<bean id="cwxDao" class="example.dao.CwxDaoHibernate">
<property name="sessionFactory"><ref
bean="cwxSessionFactory"/></property>
</bean>
When defining
(cwx-servlet.xml)
<!-- Controller for the initial "Hello" page -->
<bean id="cwxController" class="example.web.CwxController">
<property name="cwxDao"><ref external="cwxDao"/></property>
</bean>
(CwxController)
private CwxDao cwxDao;
public void setCwxDao(CwxDao cwxDao) {
this.cwxDao = cwxDao;
}
I always get
ERROR [com.interface21.web.servlet.DispatcherServlet] - <Servlet with
name
'cwx' : initialization error>
com.interface21.beans.factory.NoSuchBeanDefinitionException: No bean
named
[cwxDao] is defined {class
com.interface21.beans.factory.xml.XmlBeanFactory:
defined beans [messageSource,viewResolver,urlMapping,cwxController]}
This is the second time I get almost useless error messages. This is one
point where EJBs are far ahead (
there is almost always an error message telling you what excactly is
wrong).
Another (dumb) question:
What is the difference between a DAO *implementation* and a business
object
and where does
e. g. Petclinic reflect this ? I'm asking this because of the diiference
between the skeletons and the
sample applications. The skeletons provide a DAO and a Business Object
using
the DAO definition,
Petclinic does not. The samples should be as close as possible to the
skeletons or the skeletons should
at least provide the java classes (shouldn't be too hard).
Thanks in advance
Lars
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click
here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|