File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I get the contexts in JSP as same as in standalone JavaApp

 
sang tran
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on JBuilder6 and JBoss-3.0.0.
My jndi.properties is
-----------------------java.naming.factory.initial=org.jnp.interfaces.Na ingContextFactory
java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces
-----------------------
Then in my standalone java app, I wrote:
Context context = new InitialContext()
--> it run well
but in my JSP, I got an error:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
-----------------------
Anyone can tell me why I got that error ?
Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recommend you check your CLASSPATH. Not the one you started from, but the one JBoss is actually using. They're frequently not the same, as many of us have discovered, to our sorrow.
In fact, many appservers have 4 or 5 or even more internal classpaths, depending on what part of the system you're working with.
 
Siva Jagadeesan
Ranch Hand
Posts: 160
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get context in a JSP as you do using Java App. Becoz the JSP is convereted into Servlet. So it doesn't matter if u r using JSP or a Java application. It is all the same.
But I think it is not good to call EJB from JSP. We should be using JSP only for the presentation and it should be free of any business logic or interaction with EJB
I think it will be great if you can learn about these design patterns
1) MVC
2) Session Facade
3) Business Delegate
Lov
Siva
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic