>
> My code resides in deploy directory along with the jpos configuration
> files which hold information regarding Q2 server.
>
Why do you put your code in the deploy directory? Are you talking about
the deploy/lib directory? is your code placed inside a jar? is Spring
starting Q2 or the other way around? Where are the Spring-related jars
located?
If you are building your application using jPOS' or jPOS-EE's ant build
file, you can create a modules/spring/lib and place all your jars there
before calling 'ant'.
in your jPOS or jPOS-EE root directory, try
mkdir -p modules/payautomata/lib
place all your addon jars into that lib directory (i.e. Hibernate, Spring, etc.)
call 'ant'
Ant will move all the jars from all modules into build/lib, and it will
create a build/jpos.jar (or build/jposee.jar). The trick is that inside
that jar, the MANIFEST.MF will contain the proper Class-Path.
>
> P.S-Your hi message was conveyed :)
>
:) Great
You are on your own here, but I would first try turning verbose logging
on in java to see what is being loaded when under your IDE and then
compare the output generated out of java under Q2. There must be a
difference, but it will be hard to spot - you have some work to do.
Find out first where the 'missing' class(es) are loaded from when run on
your IDE, and check that directory or jar is available to Q2.
You might need to raise the issue on a Spring mailing list, but if the
issue is your classpath or environment, they are not going to be able to
help you either.
>
> Require some assistance here :) ----> :( (Since a long time)
We can all see that, unfortunately you may not be seeking assistance in
the correct place and only you have your environment.
--
Mark
> It simply means none of the bean definition are getting read from
> spring config file.
I know nothing about what you are doing, but perhaps that will help...
I googled for "+spring +FileSystemXmlApplicationContext" :-
The 3rd hit (out over 12000) points to example code for "Spring Load
Resource from file, classpath and URL" :-
http://www.java2s.com/Code/Java/Spring/SpringLoadResourcefromfileclasspathandURL.htm
==
http://tinyurl.com/5enhjg
The FileSystemXmlApplicationContext expects a String or String[] of
config locations to load and monitor.
*If* you are using relative paths, then perhaps the active runtime
directory under your IDE is different to that when running under Q2 -
this is very likely!
I suggest you try and specify fully qualified file names into your
FileSystemXmlApplicationContext constructor. Otherwise you are
dependant on the directory in which java is asked to run your code.
To see what is perhaps wrong, I would include some code like :-
public void initService () throws ConfigurationException {
configFiles = cfg.getAll("config");
if ( configFiles.length < 1 )
throw new ConfigurationException ("config property
not specified");
// Dump file actual file locations.
for (String c:configFiles) {
File tf = new File(c);
System.out.println("Spring config file expected at
:"+tf.getAbsolutePath());
}
appContext = new FileSystemXmlApplicationContext( configFiles );
}
compile and run it under your IDE and Q2, see in System.out what files
you are actually trying to use and then make sure they actually exist.
The only configuration location you have shown us so far is :-
"com/../../Springmappings/spring.xml"
so I think this might be your problem. If it is, where do you want me
to send my invoice? I can also accept paypal too.
8)
I am surprised that if FileSystemXmlApplicationContext is passed a
missing file it doesn't throw an Exception. I can't see one mentioned
in this thread though?
--
Mark
> As i pass the ISOMsg convert it
> into a bean and the call the bean from spring.xml file declared in
> spring-context it raises this wierd error which states class cast
> exception cannot cast DaoImpl to DaoImpl though both are same
> classes.,
Are they both loaded by the same Classloader though? If not, they will
be seen as different classes?
Perhaps tracking (java -verbose) you can see if the DaoImpl (or
whatever) is load twice by two Classloaders?
Can the Classloader used to load a class be determined at runtime? I
would think so, but do not know the steps. Find out how and log the
detail for the class you are setting and the same detail for the object
you are trying to cast. See if they are the same!
>
> Hence it is definetely not a spring issue it seems someway or other it
> is jpos and spring not working in a cordial manner
I don't think it is that clear. This is an environmental or java 'rule'
that is stopping it working because there is a rule you are breaking.
The java behaviour is 'by design' you need to work out how to conform to
all the rules.
http://www.onjava.com/pub/a/onjava/2005/01/26/classloading.html
discusses the intricacies of the process and the bottom of the first
page describes the 'issue' you might be experiencing.
Of course the solution is yours to work out.
--
Mark
...Because you have the environment and set-up in which the issue is
occurring.
I wanted to qualify my statement, it sounded too harsh.
8)
--
Mark