agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] Accessing OpenJMS Queue from PLJava
3+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] Accessing OpenJMS Queue from PLJava
@ 2005-06-02 09:29 
  2005-06-02 09:53 ` [Pljava-dev] Accessing OpenJMS Queue from PLJava 
  0 siblings, 1 reply; 3+ messages in thread

From:  @ 2005-06-02 09:29 UTC (permalink / raw)

Hi,
 We are facing some problems in Pljava trigger.
 
Problem
---------
In our application, we have written a trigger to call a java program. In the
program the triggeredData is converted to string and writen to a OpenJMS
queue1(preconfigured) as message. We are accessing OpenJMS queue via JNDI
InitialContextFactory. The necessary jar files (jndi-1.2.1.jar,
commons-logging-1.0.4.jar, jms-1.0.2a.jar, exolabcore-0.3.7.jar,
openjms-client-0.7.6.1.jar) are installed and add to the PLjava classpath as
per the PLjava documentation. 
 
When the trigger fires, we are getting NoIntialContextException.
 
javax.naming.NoInitialContextException: Cannot instantiate class:
org.exolab.jms.jndi.InitialContextFactory [Root exception is
java.lang.ClassNotFoundException: org.exolab.jms.jndi.InitialContextFactory]
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
        at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
        at javax.naming.InitialContext.init(InitialContext.java:219)
        at javax.naming.InitialContext.<init>(InitialContext.java:195)
        at
com.ge.gis.pgtrigger.EventTrigger.checkinsert(EventTrigger.java:96)
Caused by: java.lang.ClassNotFoundException:
org.exolab.jms.jndi.InitialContextFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:219)
        at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
        ... 4 more
 
What can be the possible cause for the exception ?
 
PLjava SQL commands.
----------------------
 
select sqlj.install_jar('file:/var/lib/pljava/gis.jar','gis',true);
select sqlj.install_jar('file:/var/lib/pljava/jndi-1.2.1.jar','jndi',true);
select
sqlj.install_jar('file:/var/lib/pljava/commons-logging-1.0.4.jar','logging',
true);
select sqlj.install_jar('file:/var/lib/pljava/jms-1.0.2a.jar','jms',true);
select
sqlj.install_jar('file:/var/lib/pljava/exolabcore-0.3.7.jar','exolabcore',tr
ue);
select
sqlj.install_jar('file:/var/lib/pljava/openjms-client-0.7.6.1.jar','openjms'
,true);
select sqlj.install_jar('file:/var/lib/pljava/dom4j-1.4.jar','dom4j',true);
select
sqlj.set_classpath('public','exolabcore:openjms:jms:jndi:gis:dom4j:logging')
;
 
create or replace function public.funcinsertevent() returns trigger as
'com.ge.gis.pgtrigger.EventTrigger.checkinsert' language 'java' volatile;
create or replace function public.getnodedata() returns trigger as
'com.ge.gis.pgtrigger.NodeDataChangedTrigger.addNodeData' language 'java'
volatile; create trigger nodetrigger after insert on public.node for each
row execute procedure public.getnodedata(); create trigger trigginsertevent
after insert on public.events for each row execute procedure
public.funcinsertevent();
 
 
Thanks
Rao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20050602/999ec702/attachment.html;



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Accessing OpenJMS Queue from PLJava
  2005-06-02 09:29 [Pljava-dev] Accessing OpenJMS Queue from PLJava 
@ 2005-06-02 09:53 ` 
  0 siblings, 0 replies; 3+ messages in thread

From:  @ 2005-06-02 09:53 UTC (permalink / raw)

The jars that you list here, have you installed them using install_jar 
or are you trying to load them from disk using a classpath? The former 
is the correct approach. The classpath should *only* be used to find the 
pljava.jar.

Regards,
Thomas Hallgren

Nageshwar Rao wrote:

> Hi,
>
>  We are facing some problems in Pljava trigger.
>
>  
>
> Problem
>
> ---------
>
> In our application, we have written a trigger to call a java program. 
> In the program the triggeredData is converted to string and writen to 
> a OpenJMS queue1(preconfigured) as message. We are accessing OpenJMS 
> queue via JNDI InitialContextFactory. The necessary jar files 
> (jndi-1.2.1.jar, commons-logging-1.0.4.jar, jms-1.0.2a.jar, 
> exolabcore-0.3.7.jar, openjms-client-0.7.6.1.jar) are installed and 
> add to the PLjava classpath as per the PLjava documentation.
>
>  
>
> When the trigger fires, we are getting NoIntialContextException.
>
>  
>
> javax.naming.NoInitialContextException: Cannot instantiate class: 
> org.exolab.jms.jndi.InitialContextFactory [Root exception is 
> java.lang.ClassNotFoundException: 
> org.exolab.jms.jndi.InitialContextFactory]
>
>         at 
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
>
>         at 
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
>
>         at javax.naming.InitialContext.init(InitialContext.java:219)
>
>         at javax.naming.InitialContext.<init>(InitialContext.java:195)
>
>         at 
> com.ge.gis.pgtrigger.EventTrigger.checkinsert(EventTrigger.java:96)
>
> Caused by: java.lang.ClassNotFoundException: 
> org.exolab.jms.jndi.InitialContextFactory
>
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
>
>         at java.security.AccessController.doPrivileged(Native Method)
>
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>
>         at java.lang.Class.forName0(Native Method)
>
>         at java.lang.Class.forName(Class.java:219)
>
>         at 
> com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
>
>         at 
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
>
>         ... 4 more
>
>  
>
> What can be the possible cause for the exception ?
>
>  
>
> PLjava SQL commands.
>
> ----------------------
>
>  
>
> select sqlj.install_jar('file:/var/lib/pljava/gis.jar','gis',true);
>
> select 
> sqlj.install_jar('file:/var/lib/pljava/jndi-1.2.1.jar','jndi',true);
>
> select 
> sqlj.install_jar('file:/var/lib/pljava/commons-logging-1.0.4.jar','logging',true);
>
> select sqlj.install_jar('file:/var/lib/pljava/jms-1.0.2a.jar','jms',true);
>
> select 
> sqlj.install_jar('file:/var/lib/pljava/exolabcore-0.3.7.jar','exolabcore',true);
>
> select 
> sqlj.install_jar('file:/var/lib/pljava/openjms-client-0.7.6.1.jar','openjms',true);
>
> select 
> sqlj.install_jar('file:/var/lib/pljava/dom4j-1.4.jar','dom4j',true);
>
> select 
> sqlj.set_classpath('public','exolabcore:openjms:jms:jndi:gis:dom4j:logging');
>
>  
>
> create or replace function public.funcinsertevent() returns trigger as 
> 'com.ge.gis.pgtrigger.EventTrigger.checkinsert' language 'java' 
> volatile; create or replace function public.getnodedata() returns 
> trigger as 'com.ge.gis.pgtrigger.NodeDataChangedTrigger.addNodeData' 
> language 'java' volatile; create trigger nodetrigger after insert on 
> public.node for each row execute procedure public.getnodedata(); 
> create trigger trigginsertevent after insert on public.events for each 
> row execute procedure public.funcinsertevent();
>
>  
>
>  
>
> Thanks
>
> Rao
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Pljava-dev mailing list
>Pljava-dev at gborg.postgresql.org
>http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>  
>






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] Accessing OpenJMS Queue from PLJava
@ 2005-06-02 10:59 
  0 siblings, 0 replies; 3+ messages in thread

From:  @ 2005-06-02 10:59 UTC (permalink / raw)

Nageshwar Rao wrote:

>Hi,
>Thanks for quick reply. At the first instance we did with install_jar ,we
>got the problem ,then we tried added to the classpath then also it did not
>recognize, resulting in problem.
>
>Is this right way to set the classpath or do we need to do for individual
>install_jar.
>
>sqlj.set_classpath('public','exolabcore:openjms:jms:jndi:gis:dom4j:logging')
>;
>  
>
This setting seems to be correct. There can be only one classpath per 
schema so you should never set it for each install_jar.  I'm not sure 
why this is happening. Can you try to unwind the exception and print the 
stacktrace of the innermost cause? Perhaps there's more too it than just 
a "ClassNotFoundException".

Your are 100% sure that the missing class is in the exolabcore jar?
Can you create an InitialContext in a normal Java app using the exact 
correspondance to the above classpath?

Regards,
Thomas Hallgren






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-06-02 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-02 09:29 [Pljava-dev] Accessing OpenJMS Queue from PLJava 
2005-06-02 09:53 ` 
2005-06-02 10:59 [Pljava-dev] Accessing OpenJMS Queue from PLJava 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox