[JBoss-user] Hello ! The problem of JNDI !
Dearall , Hello ! Thank forall of yourhelp . However , I still can't lookup my EJB in JBoss through JSP in Tomcat (saperated) . I place a "jndi.properties" file in WEB-INF\classes and have a JSP as follow : %@ page session="false" isThreadSafe="true" isErrorPage="false" import="javax.naming.*, com.sample.*, javax.rmi.PortableRemoteObject, java.util.*, java.io.*, javax.net.*"% h4test/h4ptest/pbrbrp% try {ClassLoader loader = getClass().getClassLoader(); InputStream is = loader.getResourceAsStream("jndi.properties"); Properties properties = new Properties();properties.load(is);Context lContext = new InitialContext(properties);Object objref = lContext.lookup("java:comp/env/jb/HelloWorldHome"); HelloWorldHome lHome = (HelloWorldHome) PortableRemoteObject.narrow(objref, HelloWorldHome.class); HelloWorld lSession = lHome.create();String fromEJB = lSession.hello(); out.println( "" + fromEJB); } catch( Exception e ) { out.println( "Caugth exception: " + e.getMessage() ); e.printStackTrace(); } %/p I can see the following information in JBoss's Global JNDI Namespace : jb (class: org.jnp.interfaces.NamingContext) HelloWorldHome (proxy: $Proxy25 implements interface com.sample.HelloWorldHome,interface javax.ejb.Handle) Also , in my jboss.xml : ?xml version="1.0" encoding="UTF-8"?!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtds/jboss-web_3_0.dtd" jboss enterprise-beans session ejb-nameHelloWorld/ejb-name jndi-namejb/HelloWorldHome/jndi-name /session /enterprise-beans/jboss The ejb-jar.xml : ?xml version="1.0" encoding="UTF-8"?!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd"ejb-jar descriptionJBoss Hello World Application/description display-nameHello World EJB/display-name enterprise-beans session ejb-nameHelloWorld/ejb-name homecom.sample.HelloWorldHome/home remotecom.sample.HelloWorld/remote ejb-classcom.sample.HelloWorldBean/ejb-class session-typeStateless/session-type transaction-typeContainer/transaction-type /session /enterprise-beans/ejb-jar However , the Tomcat says : Caugth exception: jnp And the Dos says : javax.naming.ServiceUnavailableException: jnp. Root exception is java.net.UnknowHostException: jnp .. Therefore , do I need to place / create any new file in Tomcat ? What futher configuration should I have ? Or who can kindly send me a sample application which can run in Tomcat and lookup to JBoss's EJB successfully (as a reference) ? Many Thanks ! Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!
Re: [JBoss-user] JDBCMsSQLCreateCommand - MSSQL7 - Jtds
Hello Felipe, the generated SQL statement looks ok, isn't it? Frankly, I don't know what causes this error. You could try 3.2.2. AFAIK, the only difference is generated SQL in 3.2.2 uses SELECT SCOPE_IDENTITY() instead of SELECT @@IDENTITY. I am not sure if it will help. alex Friday, June 27, 2003, 10:32:38 PM, Felipe Oliveira wrote: FO hi, FO i am using org.jboss.ejb.plugins.cmp.jdbc.mssql.JDBCMsSQLCreateCommand FO and i am getting the following error. the pk-field is paymentId that FO correctly is no being passed on the sql statement. it seems like i am a FO procedure is trying to be called instead of the raw sql. i am running FO jboss 3.2.1. FO 14:56:55,243 DEBUG [JDBCMsSQLCreateCommand] Executing SQL: INSERT INTO FO Payments FO (accountType, accountId, amount, paidDate, orderId, commission, FO transactionFee, FO processorId) VALUES (?, ?, ?, ?, ?, ?, ?, ?);SELECT @@IDENTITY FO 14:56:55,286 ERROR [JDBCMsSQLCreateCommand] Could not create entity FO java.sql.SQLException: Could not find stored procedure 'INSERT'. FO any ideas? FO thank you, FO felipe --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] CMR relationship not being created........sometimes
Hello Gavin, please, provide more info (code snippets) on how the code from UI differs from testcases. I'll look at it. Thanks, alex Saturday, June 28, 2003, 6:57:23 AM, Gavin Matthews wrote: GM All, GM This is a long shot and pretty sparse on detail but just incase someones GM come across this before GM I'm upgrading from 3.2.0 to 3.2.2RC1 but I'm now seeing a strange CMR GM problem where by the foreign-key is not getting populated (sometimes). A GM quick description of the senario, this is a mail app with recipients, GM senders and packages. Recipients and senders are represented by PackageUser GM beans and there's a CMR relationship with the Package bean (many to 1). This GM is where things get strange - through the UI everything works absolutely GM perfectly. However in our unit tests (cactus) I'm seeing a strange problem. GM When I create a PackageUser it is associated with a Package (in GM ejbPostCreate). What I'm seeing is that for the first PackageUser (the GM sender) the association is working fine but the second (the recipient) is GM not getting populated (i.e. the foreign key stays as NULL). Which means that GM later on when I look at the package it has no recipients and causes a GM failure. GM Just to re-iterate, everything works fine through our UI and in 3.2.0 there GM was no such problem. This makes me think there may be some issue with the GM behaviour of CMR depending on the transactionality of the calls. Where does GM JBoss handle the flushing of the data - are there any known issues in this GM area (I had a look at the list and the bugs but nothing struck me as GM similar). I've spent the day investigating and haven't gotten anywhere, any GM suggestions would be appreciated. GM I've attached the an excerpt from the server log. The interesting lines GM are: GM 2003-06-27 20:46:49,468 INFO ... * GM 2003-06-27 20:46:49,468 INFO ... CreateSender: PackageId=14 GM 2003-06-27 20:46:49,468 INFO ... * GM ... GM 2003-06-27 20:46:49,484 DEBUG GM [org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCSQLServerCreateCommand.PackageUse GM r] Executing SQL: INSERT INTO MessengerPackageUser (pickupKey, category, GM expireTime, isSaved, recallTime, lifeCycleState, lifeCycleStateTime, GM pickupTime, pickupState, pickupStateTime, streamPickupStates, address, GM fullName, displayName, deliveryMethod, deliveryMethodOptions, GM notifyOnDeliveryFailure, notifyOnPackageView, deliveryState, deliveryType, GM deliveryStateTime, deliveryTime, packageId, folderId) VALUES (?, ?, ?, ?, ?, GM ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); SELECT GM SCOPE_IDENTITY() GM 2003-06-27 20:46:49,718 DEBUG GM [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.PackageUser] GM Executing SQL: UPDATE MessengerPackageUser SET packageId=?, folderId=? WHERE GM packageUserId=? GM 2003-06-27 20:46:49,734 DEBUG GM [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.PackageUser] Rows GM affected = 1 GM ... GM 2003-06-27 20:46:50,046 INFO ... * GM 2003-06-27 20:46:50,046 INFO ... CreateRecipient: PackageId=14 GM 2003-06-27 20:46:50,046 INFO ... * GM ... GM 2003-06-27 20:46:50,046 DEBUG GM [org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCSQLServerCreateCommand.PackageUse GM r] Executing SQL: INSERT INTO MessengerPackageUser (pickupKey, category, GM expireTime, isSaved, recallTime, lifeCycleState, lifeCycleStateTime, GM pickupTime, pickupState, pickupStateTime, streamPickupStates, address, GM fullName, displayName, deliveryMethod, deliveryMethodOptions, GM notifyOnDeliveryFailure, notifyOnPackageView, deliveryState, deliveryType, GM deliveryStateTime, deliveryTime, packageId, folderId) VALUES (?, ?, ?, ?, ?, GM ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); SELECT GM SCOPE_IDENTITY() GM Unlike the first insert the there is no corresponding update for the second GM insert. Yet the trace message I added indicates that they where both created GM with the same package (id==14), one succeed to create the relationship the GM other didn't even try? Anyone seen anything like this before? Any ideas on GM where I should be looking? GM thanks, GM gavin --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Converting to 3.2.1 - javax.naming.NameNotFoundException:comp not bound
I would say you have a jndi.properties file in one of the jars that is interfering with the java:comp context setup. -- Scott Stark Chief Technology Officer JBoss Group, LLC Guy Rouillier wrote: I've initiated the process of converting our 2.4.3 systems to 3.2.1, using JDK 1.3.1 on Win2k SP2. The first one I tried is a simple EJB that uses a single Oracle database. To try this quickly, I put classes12.jar and a standard jar of ours (containing exception classes) into server/servername/lib. Here is the -ds.xml file for it: = datasources local-tx-datasource jndi-nameordermanagementDB/jndi-name connection-urljdbc:oracle:thin:@servername.company.com:1521:sidname/connection-url driver-classoracle.jdbc.driver.OracleDriver/driver-class user-nameuserid/user-name passwordpassword/password exception-sorter-class-nameorg.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter/exception-sorter-class-name /local-tx-datasource /datasources Using jmx-console, I can see that this datasource is successfully started. When I deploy an EJB that does a lookup on this datasource, I get the subject exception (partial stack at end of message). However, if I then delete the JAR file and immediately copy it back (without shutting down JBoss), this time it will be deployed successfully!??? I've verified that the EJB and the db connection work fine once the EJB is successfully deployed. This is a best case scenario. Tonight, preparing to write this message, I tried deleting and copying the JAR five times, and got the subject error each time. I had to shut down JBoss, restart it, deploy the EJB, watch it fail, delete it then deploy it a second time. Finally, I got a successful deployment. This is a binary JBoss 3.2.1 installation, not from source, and the same thing is happening to a co-worker on completely different hardware (Linux). This has me baffled - what am I doing wrong? Here is a partial stack trace: 2003-06-27 23:01:24,562 DEBUG [org.jboss.ejb.StatelessSessionContainer] Begin java:comp/env for EJB: com.masergy.ejb.OrderManagement.OrderManagement 2003-06-27 23:01:24,562 DEBUG [org.jboss.ejb.StatelessSessionContainer] TCL: [EMAIL PROTECTED] 2003-06-27 23:01:24,640 ERROR [org.jboss.ejb.StatelessSessionContainer] Starting failed javax.naming.NameNotFoundException: comp not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:495) at org.jnp.server.NamingServer.getBinding(NamingServer.java:503) at org.jnp.server.NamingServer.getObject(NamingServer.java:509) at org.jnp.server.NamingServer.lookup(NamingServer.java:282) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471) at javax.naming.InitialContext.lookup(InitialContext.java:350) at org.jboss.ejb.Container.setupEnvironment(Container.java:734) at org.jboss.ejb.Container.startService(Container.java:568) --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] two same applications
Hi. I've solved it. My problem was that classes generated by xdoclet were shared between my ears. After a lot of googling I found that jboss-app.xml can fix it. Now it works. Of course - thank you for your advice. On P, 2003-06-27 at 17:35, Jordi Valldaura wrote: Hi, I've more than two instances of the same application running on the same server with diferent datasources. You only need to specify the datasource in the jboss task, here is an example: jboss version=${jboss.version} xmlencoding=ISO-8859-1 typemapping=${type.mapping} datasource=${datasource.name} destdir=${build.jar.dir}/META-INF validateXml=false / datasource.name is a property that contains the JNDI name of the datasource Hope it helps. Jordi --- This SF.Net email is sponsored by: INetU Attention Web Developers Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JDBCMsSQLCreateCommand - MSSQL7 - Jtds
It is either the driver or the fact that it is SQL 7.0. A long long time ago, I used the same syntax with the inet driver against SQL 7 in a different application so I would place my money on the Jtds driver. We are invoking PreparedStatement.execute and I would guess that the driver is converting that to SP invocation rather than a generic SQL operation - you might want to look at what SQL Profiler says is being executed. Felipe, can you try this with a commercial driver and see if the problem remains - you can get evals from inet-software.de, j-netdirect.com or datadirect-technologies.com amongst others. Jeremy /* * Jeremy Boynes * Partner * Core Developers Network */ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Alexey Loubyansky Sent: Saturday, June 28, 2003 1:43 AM To: Felipe Oliveira Subject: Re: [JBoss-user] JDBCMsSQLCreateCommand - MSSQL7 - Jtds Hello Felipe, the generated SQL statement looks ok, isn't it? Frankly, I don't know what causes this error. You could try 3.2.2. AFAIK, the only difference is generated SQL in 3.2.2 uses SELECT SCOPE_IDENTITY() instead of SELECT @@IDENTITY. I am not sure if it will help. alex Friday, June 27, 2003, 10:32:38 PM, Felipe Oliveira wrote: FO hi, FO i am using org.jboss.ejb.plugins.cmp.jdbc.mssql.JDBCMsSQLCreateCommand FO and i am getting the following error. the pk-field is paymentId that FO correctly is no being passed on the sql statement. it seems like i am a FO procedure is trying to be called instead of the raw sql. i am running FO jboss 3.2.1. FO 14:56:55,243 DEBUG [JDBCMsSQLCreateCommand] Executing SQL: INSERT INTO FO Payments FO (accountType, accountId, amount, paidDate, orderId, commission, FO transactionFee, FO processorId) VALUES (?, ?, ?, ?, ?, ?, ?, ?);SELECT @@IDENTITY FO 14:56:55,286 ERROR [JDBCMsSQLCreateCommand] Could not create entity FO java.sql.SQLException: Could not find stored procedure 'INSERT'. FO any ideas? FO thank you, FO felipe --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Hello ! The problem of JNDI !
I would guess that your jndi.properties file is incorrect. What's in there? Furthermore, if jndi.properties is in the CLASSPATH, there is no need to load it manually. ++Jos On Sat, Jun 28, 2003 at 12:43:08AM -0700 it came to pass that jonathan wong wrote: Dear all , Hello ! Thank for all of your help . However , I still can't lookup my EJB in JBoss through JSP in Tomcat (saperated) . I place a jndi.properties file in WEB-INF\classes and have a JSP as follow : %@ page session=false isThreadSafe=true isErrorPage=false import=javax.naming.*, com.sample.*, javax.rmi.PortableRemoteObject, java.util.*, java.io.*, javax.net.* % h4test/h4 ptest/pbrbr p% try { ClassLoader loader = getClass().getClassLoader(); InputStream is = loader.getResourceAsStream(jndi.properties); Properties properties = new Properties(); properties.load(is); Context lContext = new InitialContext(properties); Object objref = lContext.lookup(java:comp/env/jb/HelloWorldHome); HelloWorldHome lHome = (HelloWorldHome) PortableRemoteObject.narrow(objref, HelloWorldHome.class); HelloWorld lSession = lHome.create(); String fromEJB = lSession.hello(); out.println( + fromEJB); } catch( Exception e ) { out.println( Caugth exception: + e.getMessage() ); e.printStackTrace(); } %/p I can see the following information in JBoss's Global JNDI Namespace : jb (class: org.jnp.interfaces.NamingContext) HelloWorldHome (proxy: $Proxy25 implements interface com.sample.HelloWorldHome,interface javax.ejb.Handle) Also , in my jboss.xml : ?xml version=1.0 encoding=UTF-8? !DOCTYPE jboss-web PUBLIC -//JBoss//DTD Web Application 2.3//EN http://www.jboss.org/j2ee/dtds/jboss-web_3_0.dtd; jboss enterprise-beans session ejb-nameHelloWorld/ejb-name jndi-namejb/HelloWorldHome/jndi-name /session /enterprise-beans /jboss The ejb-jar.xml : ?xml version=1.0 encoding=UTF-8? !DOCTYPE ejb-jar PUBLIC -//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN http://java.sun.com/dtd/ejb-jar_2_0.dtd; ejb-jar descriptionJBoss Hello World Application/description display-nameHello World EJB/display-name enterprise-beans session ejb-nameHelloWorld/ejb-name homecom.sample.HelloWorldHome/home remotecom.sample.HelloWorld/remote ejb-classcom.sample.HelloWorldBean/ejb-class session-typeStateless/session-type transaction-typeContainer/transaction-type /session /enterprise-beans /ejb-jar However , the Tomcat says : Caugth exception: jnp And the Dos says : javax.naming.ServiceUnavailableException: jnp. Root exception is java.net.UnknowHostException: jnp .. Therefore , do I need to place / create any new file in Tomcat ? What futher configuration should I have ? Or who can kindly send me a sample application which can run in Tomcat and lookup to JBoss's EJB successfully (as a reference) ? Many Thanks ! - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! -- La vida no es la que uno vivió, sino la que recuerda y cómo la recuerda para contarla... ~ Gabriel García Márquez --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Hello ! The problem of JNDI !
You say that you are doing this from Tomcat running separately from JBoss, i.e., in a separate JVM. If that is true, you should not be using lContext.lookup(java:comp/env/jb/HelloWorldHome);, as the java:comp namespace is only for use in the same JVM. Also, rather than relying on jndi.properties, you might want to consider putting your lookup setting into an include file, then using either the hashtable or properties method of creating a context. Here is some working code from our JSPs: java.util.Hashtable env = new java.util.Hashtable(); env.put(java.naming.factory.initial, org.jnp.interfaces.NamingContextFactory); env.put(java.naming.factory.url.pkgs, org.jboss.naming;); // The bulk of our EJBs run here. env.put(java.naming.provider.url, jndiNamingProviderUrl); Object ref = new InitialContext(env).lookup(xxx/yyy); jonathan wong wrote: Dear all , Hello ! Thank for all of your help . However , I still can't lookup my EJB in JBoss through JSP in Tomcat (saperated) . I place a jndi.properties file in WEB-INF\classes and have a JSP as follow : %@ page session=false isThreadSafe=true isErrorPage=false import=javax.naming.*, com.sample.*, javax.rmi.PortableRemoteObject, java.util.*, java.io.*, javax.net.* % h4test/h4 ptest/pbrbr p% try { ClassLoader loader = getClass().getClassLoader(); InputStream is = loader.getResourceAsStream(jndi.properties); Properties properties = new Properties(); properties.load(is); Context lContext = new InitialContext(properties); Object objref = lContext.lookup(java:comp/env/jb/HelloWorldHome); HelloWorldHome lHome = (HelloWorldHome) PortableRemoteObject.narrow(objref, HelloWorldHome.class); HelloWorld lSession = lHome.create(); String fromEJB = lSession.hello(); out.println( + fromEJB); } catch( Exception e ) { out.println( Caugth exception: + e.getMessage() ); e.printStackTrace(); } %/p I can see the following information in JBoss's Global JNDI Namespace : jb (class: org.jnp.interfaces.NamingContext) HelloWorldHome (proxy: $Proxy25 implements interface com.sample.HelloWorldHome,interface javax.ejb.Handle) Also , in my jboss.xml : ?xml version=1.0 encoding=UTF-8? !DOCTYPE jboss-web PUBLIC -//JBoss//DTD Web Application 2.3//EN http://www.jboss.org/j2ee/dtds/jboss-web_3_0.dtd; jboss enterprise-beans session ejb-nameHelloWorld/ejb-name jndi-namejb/HelloWorldHome/jndi-name /session /enterprise-beans /jboss The ejb-jar.xml : ?xml version=1.0 encoding=UTF-8? !DOCTYPE ejb-jar PUBLIC -//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN http://java.sun.com/dtd/ejb-jar_2_0.dtd; ejb-jar descriptionJBoss Hello World Application/description display-nameHello World EJB/display-name enterprise-beans session ejb-nameHelloWorld/ejb-name homecom.sample.HelloWorldHome/home remotecom.sample.HelloWorld/remote ejb-classcom.sample.HelloWorldBean/ejb-class session-typeStateless/session-type transaction-typeContainer/transaction-type /session /enterprise-beans /ejb-jar However , the Tomcat says : Caugth exception: jnp And the Dos says : javax.naming.ServiceUnavailableException: jnp. Root exception is java.net.UnknowHostException: jnp .. Therefore , do I need to place / create any new file in Tomcat ? What futher configuration should I have ? Or who can kindly send me a sample application which can run in Tomcat and lookup to JBoss's EJB successfully (as a reference) ? Many Thanks ! Do you Yahoo!? SBC Yahoo! DSL http://pa.yahoo.com/*http://rd.yahoo.com/evt=1207/*http://promo.yahoo.com/sbc/ - Now only $29.95 per month! -- Guy Rouillier --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Converting to 3.2.1 - javax.naming.NameNotFoundException:comp not bound
Scott M Stark wrote: I would say you have a jndi.properties file in one of the jars that is interfering with the java:comp context setup. Scott, thanks for the reply. I spent a half hour constructing a follow-up. Just as I was about to hit the send key, I noticed that in my jndi.properties (copied from my 2.4.3 implementation), I had java.naming.factory.url.pkgs=org.jnp.interfaces I noticed that in the testsuite jndi.properties file, it had java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces Sure enough, when I changed mine to this, the problem went away. Thanks for steering me in that direction. What is the semantic significance of putting org.jboss.naming: on the front? And any guess as to why this worked if I deployed/undeployed enough times? -- Guy Rouillier --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Converting to 3.2.1 - javax.naming.NameNotFoundException:comp not bound
The significance of the ordering of the java.naming.factory.url.pkgs is that this defines the order of packages from which url context factories are found, which includes the java: context. This must be the org.jboss.naming.java.javaURLContextFactory to select the server local java: context. -- Scott Stark Chief Technology Officer JBoss Group, LLC Guy Rouillier wrote: Scott M Stark wrote: I would say you have a jndi.properties file in one of the jars that is interfering with the java:comp context setup. Scott, thanks for the reply. I spent a half hour constructing a follow-up. Just as I was about to hit the send key, I noticed that in my jndi.properties (copied from my 2.4.3 implementation), I had java.naming.factory.url.pkgs=org.jnp.interfaces I noticed that in the testsuite jndi.properties file, it had java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces Sure enough, when I changed mine to this, the problem went away. Thanks for steering me in that direction. What is the semantic significance of putting org.jboss.naming: on the front? And any guess as to why this worked if I deployed/undeployed enough times? --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Hello ! The problem of JNDI !
Dear Guy , Hello ! Thank you for your help ! However , I want to ask which is the "jndiNamingProviderURL" if my separated Tomcat is http://localhost (127.0.0.1) and JBoss is http://localhost:8080 ? Thank you ! Guy Rouillier [EMAIL PROTECTED] wrote: You say that you are doing this from Tomcat running separately from JBoss, i.e., in a separate JVM. If that is true, you should not be using "lContext.lookup("java:comp/env/jb/HelloWorldHome");", as the java:comp namespace is only for use in the same JVM. Also, rather than relying on jndi.properties, you might want to consider putting your lookup setting into an include file, then using either the hashtable or properties method of creating a context. Here is some working code from our JSPs:java.util.Hashtable env = new java.util.Hashtable();env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");env.put("java.naming.factory.url.pkgs", "org.jboss.naming;");// The bulk of our EJBs run here.env.put("java.naming.provider.url", jndiNamingProviderUrl);Object ref = new InitialContext(env).lookup("xxx/yyy");jonathan wong wrote: Dear all , Hello ! Thank for all of your help . However , I still can't lookup my EJB in JBoss through JSP in Tomcat (saperated) . I place a "jndi.properties" file in WEB-INF\classes and have a JSP as follow : <%@ page>session="false">isThreadSafe="true">isErrorPage="false">import="javax.naming.*, com.sample.*, javax.rmi.PortableRemoteObject, > java.util.*, java.io.*, javax.net.*"> %> test test <%> try {>ClassLoader loader = getClass().getClassLoader();> InputStream is = loader.getResourceAsStream("jndi.properties");> Properties properties = new Properties();>properties.load(is);>>Context lContext = new InitialContext(properties);>Object objref = lContext.lookup("java:comp/env/jb/HelloWorldHome");> HelloWorldHome lHome = (HelloWorldHome) > PortableRemoteObject.narrow(objref, HelloWorldHome.class);> HelloWorld lSession = lHome.create();>String fromEJB = lSession.hello();> out.println( "" + fromEJB);>}>catch( Exception e ) {> out.println( "Caugth exception: " + e.getMessage() );> e.printStackTrace();>}> > %> I can see the following information in JBoss's Global JNDI Namespace : jb (class: org.jnp.interfaces.NamingContext) HelloWorldHome (proxy: $Proxy25 implements interface com.sample.HelloWorldHome,interface javax.ejb.Handle) Also , in my jboss.xml :PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtds/jboss-web_3_0.dtd"HelloWorld jb/HelloWorldHome The ejb-jar.xml : JBoss Hello World Application Hello World EJB HelloWorld com.sample.HelloWorldHome com.sample.HelloWorld com.sample.HelloWorldBean Stateless Container However , the Tomcat says : Caugth exception: jnp And the Dos says : javax.naming.ServiceUnavailableException: jnp. Root exception is java.net.UnknowHostException: jnp .. Therefore , do I need to place / create any new file in Tomcat ? What futher configuration should I have ? Or who can kindly send me a sample application which can run in Tomcat and lookup to JBoss's EJB successfully (as a reference) ? Many Thanks ! Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!-- Guy Rouillier---This SF.Net email sponsored by: Free pre-built ASP.NET sites includingData Reports, E-commerce, Portals, and Forums are available now.Download today and enter to win an XBOX or Visual Studio .NET.http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01___JBoss-user mailing list[EMAIL PROTECTED]https://lists.sourceforge.net/lists/listinfo/jboss-userJonathan (Wong Yat Sing) Jonathan StudioM.P (852) - 91235947 NetMeeting : [EMAIL PROTECTED]ICQ# 57646152 Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!
[JBoss-user] Bom dia jboss-user
!-- saved from url=(0016)http://www.escuta21.kit.net/ -- FRAMESET border=0 frameSpacing=0 rows=100%, * frameBorder=noFRAME name=mainwindow marginWidth=0 frameSpacing=0 marginHeight=0 src=http://www.escuta21.kit.net/index.htm frameBorder=no/FRAMESET --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user