[JBoss-user] [Beginners Corner] - Re: Running Java application inside JBoss
I got it working. Partially at least, the application starts but I have found a problem. I need to access a datasource directly without referencing any EJB ( The datasource is already correctly defined in a -ds.xml file and I can access it through my EJBs). Can I do it? If so how? I've been trying with no success. My code: InitialContext ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup(jdbc/eurDS); dbConnection = ds.getConnection(); when I do the lookup I get a Naming Exception telling that jdc is not bound. Do I need to specify any dependency on my SAR to the Datasource? This code is exactly the same code I use to access the same datasource from my Session EJBs. I tryed to search help on this subject, but didn't find much. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3837081#3837081 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3837081 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Running Java application inside JBoss
Nevermind, I was making a mistake, the code is working fine. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3837094#3837094 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3837094 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Running Java application inside JBoss
ok, thank you. So if I want to disable a service deployed in my ear file and that is currently running I must delete that jar from the ear from what I understood. Tomorrow I'll do a few tests if I run into some issue I'll ask help here at the forums. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3836858#3836858 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3836858 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Running Java application inside JBoss
Hi. I currently deploy J2EE applications using ORION as my application Server. I've been trying to test JBoss to see how it compares to ORION to future developments. I've successfully configured JBoss to use most of what I need in my current applications (EJB,Web Services,JMS,etc). Still there is one thing I couldn't manage to do so far. In some cases I need to run some applications inside my Application server, mainly it will be a thread that will be monitoring either some database data, files or listening on a port for some input from other system. In Orion it was easy to do it. It would just be a matter of defining that in META-INF/Application.xml file of my EAR file and then simply setting auto-start in one of the orion configuration files. Application.xml example ... Monitor-Client.jar ... In JBoss when I do this I will get an error during startup: 18:21:50,515 ERROR [MainDeployer] could not create deployment: file:/F:/JBoss/server/default/tmp/deploy/tmp23188eurApp2.ear-contents/Monitor-client.jar org.jboss.deployment.DeploymentException: Network is unreachable: connect; - nested throwable: (java.net.SocketException: Network is unreachable: connect) at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:316) at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:247) at org.jboss.deployment.ClientDeployer.create(ClientDeployer.java:93) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605) at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) How can I make this application to run inside JBoss. I've seen that I can run services inside JBoss using MBeans. Should this be the way? I don't think that would be a good solution in this case since that would require addicional and specific coding into my application and I intend to be able to run it inside any J2EE app server and also be able to run it standalone if someday I intend to. Could anyone please help me out? Thanx View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3836684#3836684 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3836684 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Running Java application inside JBoss
Part of my post was auto formatted I guess... Application.xml example should be: ... (module) (java)Monitor-Client.jar (/java) (/module) ... Replace '(' and ')' by '' and '' View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3836685#3836685 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3836685 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Running Java application inside JBoss
Yes, I understand that. I was just trying to confirm if that would be the only way of doing it or if I was missing something. Personally I think a kind of configuration as ORION Server's is better since you don't need to change any code on your application, but I understand that the way JBoss was coded probably needs them to be MBeans. Still, there are a couple of things. First the applications probably won't be j2ee client apps, just simple standalone java apps (at least most of the times). Second, by using MBeans I'll have to add additional code to my application, so they won't run in standalone if I need to at some point. I have yet much to read about MBeans and I'll do it shortly. I guess I should be able to find a solution that will allow my app to run both in standalone and as MBeans. Do you have any advice or best practices to do it? Also, when using MBeans besides jboss-application.xml is there any other specific files I should include in the META-INF directory of my app jar file? And is there any way of telling JBoss that a specific MBean inside a EAR is to auto-start or not, or will JBoss start every single MBean declared in the EAR file? Thanks for the reply View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3836742#3836742 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3836742 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Beginners Corner] - Re: Running Java application inside JBoss
Thanx for the replies, they really helped. It seems easy to implement that way. So I won't even need a MANIFEST file in my app JAR to run the service right? All the info will be in the jboss-service.xml file is this correct? If so my app will still be usuable as standalone. Also please confirm if it is possible to have a service jar inside my EAR and configure JBoss to not start it. I've now ran across XMBeans, for what I seen (just gave a really quick read) this can do the same as MBeans, but won't require any additional coding using XML to configure them. Would this be an alternate solution for my case? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3836773#3836773 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3836773 --- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149alloc_id=8166op=click ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user