You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "Ushakov, Sergey N" <s-...@yandex.ru> on 2014/04/07 16:05:06 UTC

Re: Running EJB and non-EJB applications in one Tomcat

Hi Romain, and thank you for the guidelines.

Our impression is that our legacy webapp feels better with "our_app.tomcat-only=true" :)
But the problem with Quartz unfortunately still persists. Our app crashes with "org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '...' defined in URL [jar:file:/C:/Program%20Files/Tomcat7t/webapps/our_app/WEB-INF/lib/our_app.jar!/spring/service/Schedule.xml]: Unexpected failure during bean definition parsing; nested exception is java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.CronTriggerBean has interface org.quartz.CronTrigger as super class".

It looks like TomEE still makes its own Quartz jar available for the application despite of "our_app.tomcat-only=true"...

To be frank, it appeared hard for me to catch the meaning of your phrase "Quartz shouldn't be an issue since on trunk we now shade it because of it." Does it mean that the problem with Quartz is a known one, and it is fixed now in the snapshot builds while still persisting in release builds 1.6.0/4.6.0 ? Unfortunately we could not check this guess, as we experienced a problem with downloading https://repository.apache.org/content/groups/snapshots/org/apache/openejb/apache-tomee/1.6.1-SNAPSHOT/apache-tomee-1.6.1-20140311.041252-101-webprofile.zip , as it responded with "404 - GroupItemNotFoundException"...

Could you kindly explain the current status of the Quartz issue in more detail?

Thank you in advance,
Sergey Ushakov


31.03.2014, 15:57, "Romain Manni-Bucau" <rm...@gmail.com>:
> Hi
>
> in system.proeprties you can put tomcat-only=true or [app
> name].tomcat-only=true. This will prevent tomee to manage this app.
>
> About classloader you can force some classes/packages to be loaded
> from the webapp using openejb.classloader.forced-load =
> org.,com.,net.,... but this can break tomee so to do with caution.
> Quartz shouldn't be an issue since on trunk we now shade it because of
> it.
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
> 2014-03-31 13:10 GMT+02:00 Ushakov, Sergey N <s-...@yandex.ru>:
>
>>  Hi,
>>
>>  sorry if asking something trivial, but I could not find anything on my topic neither in the documentation ( http://openejb.apache.org/documentation.html ) nor in the archive. The only similar topic I could find was some four years old, with no final solution mentioned: http://openejb.979440.n4.nabble.com/How-can-OpenEJB-ignore-old-webapps-in-Tomcat-td1051311.html
>>
>>  We are looking for a possibility to run our EJB application together with legacy non-EJB one in one Tomcat. The legacy one has quite a lot of vintage dependencies like Spring 1.2.9 and Hibernate 2.1.7 and complains from the very beginning on incompatible quartz class structure changes. We would like to isolate it from OpenEJB infrastructure, so it would feel itself like in a plain Tomcat. Or maybe have some very limited and controllable common dependencies with the new OpenEJB app.
>>
>>  Is it possible to configure either TomEE of Tomcat+OpenEJB to achieve this sort of webapp isolation?
>>
>>  Thanks in advance for any ideas,
>>  Sergey

Re: Running EJB and non-EJB applications in one Tomcat

Posted by Chuck Davis <cj...@gmail.com>.
Thanks Andy.  I changed to the remote tomee client with http per following
code.  I'm obviously not connecting all the dots somewhere because I just
get the following message:

org.apache.openejb.client.ClientRuntimeException: Invalid response from
server: -1

IF I discover how this works, THEN I may be able to suggest how the docs may
have been more helpful.  But right now I'm just confused.

CODE SECTION FOLLOWS

	private void fetchDatabaseConnection()  throws ConnectionException {
		Properties p = new Properties();
		p.put("java.naming.factory.initial",
"org.openejb.client.RemoteInitialContextFactory");
//		p.put("java.naming.provider.url", "ejbd://192.168.3.93:4201");	// this
works when openejb is started
		p.put("java.naming.provider.url", "http://192.168.3.93:8080/tomee/ejb");
// user and pass optional
//		p.put("java.naming.security.principal", "chuck");
//		p.put("java.naming.security.credentials", "dosomething");

		InitialContext ctx = null;
		try {
			ctx = new InitialContext(p);
		} catch (NamingException ex) {
			Logger.getLogger(ClientConstants.class.getName()).log(Level.SEVERE, null,
ex);
		}
		try {
			myBean = (NetworkLedgerServerRemote)
ctx.lookup("NetworkLedgerServerRemote");
		} catch (NamingException ex) {
			Logger.getLogger(ClientConstants.class.getName()).log(Level.SEVERE, null,
ex);
		}
		
 		if(myBean == null) {
			System.out.println("myBean is null after lookup");
		}
	}



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-EJB-and-non-EJB-applications-in-one-Tomcat-tp4668479p4669016.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running EJB and non-EJB applications in one Tomcat

Posted by agumbrecht <ag...@tomitribe.com>.
Chuck that sounds great and will be really appreciated if you manage to fit
that in!

I am currently working at geting the site documentation in better shape and
will be happy to collaborate with you on a better 'getting started' doc.

Andy.



-----
    -- 
    Andy Gumbrecht

    http://www.tomitribe.com
    agumbrecht@tomitribe.com
    https://twitter.com/AndyGeeDe

    TomEE treibt Tomitribe ! | http://tomee.apache.org
--
View this message in context: http://openejb.979440.n4.nabble.com/Running-EJB-and-non-EJB-applications-in-one-Tomcat-tp4668479p4669052.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running EJB and non-EJB applications in one Tomcat

Posted by Chuck Davis <cj...@gmail.com>.
Hey Andy:

Thanks for your help.  I got it working last night just before went to bed
and tested a bit further this a.m.  I'm thinking about doing a little
tutorial for other new users to help them get going.  All the terminology is
not immediately obvious to those of us who are new to the whole JEE thingy
-- for example one thing that hung me up was why use the localhost to
connect a remote client using http.  It's not the first time I've run into
info about using remote ejb but the tutorial connects to localhost --
completely useless for those of us just trying to learn which end is up.

Anyway, thanks for the assist.  All's well that ends well!

CD



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-EJB-and-non-EJB-applications-in-one-Tomcat-tp4668479p4669049.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running EJB and non-EJB applications in one Tomcat

Posted by Andy Gumbrecht <ag...@tomitribe.com>.
No problem Chuck, I wasn't trying to be pushy, it just makes for better 
reading and searching.

The related docs are here http://tomee.apache.org/documentation.html - 
EJB Clients. What do you think I could improve on the site to have 
helped you find that easier?

I'm going to change the order of the descriptions, as TomEE is most 
likey to be the use case now.

I'll also add this additonal info to the documentation, but you can also 
run the EJB deamon in TomEE:

1. By adding the following in conf/system.properties (or as system 
property):

openejb.service.manager.class = 
org.apache.openejb.server.SimpleServiceManager

2. Enabling the conf/conf.d/ejbd.properties (You'll probably need to 
restart the server, as this file is generated).

Andy.

-- 
   Andy Gumbrecht

   http://www.tomitribe.com
   agumbrecht@tomitribe.com
   https://twitter.com/AndyGeeDe

   TomEE treibt Tomitribe! | http://tomee.apache.org


Re: Running EJB and non-EJB applications in one Tomcat

Posted by Chuck Davis <cj...@gmail.com>.
Thanks, Andy.  I thought the question was very related so jumped in.  Sorry
to confuse things.

I had not seen in any of the documentation that Tomee had the http protocol
upgrade feature so appreciate that information.



--
View this message in context: http://openejb.979440.n4.nabble.com/Running-EJB-and-non-EJB-applications-in-one-Tomcat-tp4668479p4668986.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running EJB and non-EJB applications in one Tomcat

Posted by agumbrecht <ag...@tomitribe.com>.
Chuck,

Next time please start a new thread for your question, but here is the
answer

Properties p = new Properties();
p.put("java.naming.factory.initial",
"org.apache.openejb.client.RemoteInitialContextFactory");
p.put("java.naming.provider.url", "*http://127.0.0.1:8080/tomee/ejb*");

Not the URL is different.

Andy.



-----
    -- 
    Andy Gumbrecht

    http://www.tomitribe.com | agumbrecht@tomitribe.com | https://twitter.com/AndyGeeDe

    Tomitribe treibt TomEE! | http://tomee.apache.org
--
View this message in context: http://openejb.979440.n4.nabble.com/Running-EJB-and-non-EJB-applications-in-one-Tomcat-tp4668479p4668974.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Running EJB and non-EJB applications in one Tomcat

Posted by Romain Manni-Bucau <rm...@gmail.com>.
yes you got the point, maybe try:
http://repository.apache.org/content/groups/snapshots/org/apache/openejb/apache-tomee/1.6.1-SNAPSHOT/apache-tomee-1.6.1-20140407.041557-129-webprofile.zip
(or any zip from
https://repository.apache.org/content/groups/snapshots/org/apache/openejb/apache-tomee/1.6.1-SNAPSHOT/)
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-04-07 16:05 GMT+02:00 Ushakov, Sergey N <s-...@yandex.ru>:
> Hi Romain, and thank you for the guidelines.
>
> Our impression is that our legacy webapp feels better with "our_app.tomcat-only=true" :)
> But the problem with Quartz unfortunately still persists. Our app crashes with "org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '...' defined in URL [jar:file:/C:/Program%20Files/Tomcat7t/webapps/our_app/WEB-INF/lib/our_app.jar!/spring/service/Schedule.xml]: Unexpected failure during bean definition parsing; nested exception is java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.CronTriggerBean has interface org.quartz.CronTrigger as super class".
>
> It looks like TomEE still makes its own Quartz jar available for the application despite of "our_app.tomcat-only=true"...
>
> To be frank, it appeared hard for me to catch the meaning of your phrase "Quartz shouldn't be an issue since on trunk we now shade it because of it." Does it mean that the problem with Quartz is a known one, and it is fixed now in the snapshot builds while still persisting in release builds 1.6.0/4.6.0 ? Unfortunately we could not check this guess, as we experienced a problem with downloading https://repository.apache.org/content/groups/snapshots/org/apache/openejb/apache-tomee/1.6.1-SNAPSHOT/apache-tomee-1.6.1-20140311.041252-101-webprofile.zip , as it responded with "404 - GroupItemNotFoundException"...
>
> Could you kindly explain the current status of the Quartz issue in more detail?
>
> Thank you in advance,
> Sergey Ushakov
>
>
> 31.03.2014, 15:57, "Romain Manni-Bucau" <rm...@gmail.com>:
>> Hi
>>
>> in system.proeprties you can put tomcat-only=true or [app
>> name].tomcat-only=true. This will prevent tomee to manage this app.
>>
>> About classloader you can force some classes/packages to be loaded
>> from the webapp using openejb.classloader.forced-load =
>> org.,com.,net.,... but this can break tomee so to do with caution.
>> Quartz shouldn't be an issue since on trunk we now shade it because of
>> it.
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>> 2014-03-31 13:10 GMT+02:00 Ushakov, Sergey N <s-...@yandex.ru>:
>>
>>>  Hi,
>>>
>>>  sorry if asking something trivial, but I could not find anything on my topic neither in the documentation ( http://openejb.apache.org/documentation.html ) nor in the archive. The only similar topic I could find was some four years old, with no final solution mentioned: http://openejb.979440.n4.nabble.com/How-can-OpenEJB-ignore-old-webapps-in-Tomcat-td1051311.html
>>>
>>>  We are looking for a possibility to run our EJB application together with legacy non-EJB one in one Tomcat. The legacy one has quite a lot of vintage dependencies like Spring 1.2.9 and Hibernate 2.1.7 and complains from the very beginning on incompatible quartz class structure changes. We would like to isolate it from OpenEJB infrastructure, so it would feel itself like in a plain Tomcat. Or maybe have some very limited and controllable common dependencies with the new OpenEJB app.
>>>
>>>  Is it possible to configure either TomEE of Tomcat+OpenEJB to achieve this sort of webapp isolation?
>>>
>>>  Thanks in advance for any ideas,
>>>  Sergey