HTTP 404 error when using plugins

When I want to use the userImportExport plugin, I encountered the http 404 error.I already seen the User Import & Export link in adminconsole,but when I click it, the http 404 error appeared.I also tried to use the registration plugin, but the same thing appeared. Could any one help me? Thanks in advance!

I have found the problem,the plugin jars that I used ant plugins to build are not correct. The web.xml file is in the web directory(not the web/WEB-INF directory),but I don’'t know why.I used jive_messenger_src_2005-04-17 to do above things.

Hi zey,

You might want to consider updating to a more recent build of Messenger, jive_messenger_src_2005-04-17 actually is older than the official 2.1.3 version.

I’‘d be curious to hear what you think of the user import/export plugin. I know it’'s in need of some polishing so any feedback would be grealy appreciated.

Thanks,

Ryan

Hey,Ryan

Thanks for your reply,now I have begun to use the jive_messenger_src_2_1_3,but a new problem ocurred,when I put some files in the myplugin/classes directory,I can’‘t find these files in the target jar,and I don’'t know where is the classpath,if I want to load some file from the classpath,where should I put them?

Hi zey,

It’‘s good to hear that you’‘re making some progress. Despite what the documentation says, files placed in the myplugin/classes directory are not picked up during the plugin build process. I brought up this issue in this thread a couple of months back but apparently nothing was done to resolve it. I’'ll get in touch with the developers and see what can be done to fix this issue. In the mean time what you can do is jar up your files and put the jar in the myplugin/lib directory; this way the jar will get picked up and all the files inside it will be added to the classpath.

Hope that helps,

Ryan

Oh,Ryan

I’'m sorry to tell you I still have the problem though I jar my configure files and put the jar file into the myplugin/lib directory.

I want to use spring in my plugin, so I jar the applicationContext.xml into the conf.jar file,and put it into the myplugin/lib directory. Then, in my plugin file, I used

ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext(“applicationContext.xml”) to do the initial work, but I got the FileNotFoundException,

Message was edited by:

zey

Ryan,

It’‘s good to hear that you’'re making some progress.

Despite what the documentation says, files placed in

the myplugin/classes directory are not picked up

during the plugin build process.

Huh, I just checked the code and am a bit mystified. Files in the classes directory should be part of the classloader. We have the following code in PluginClassLoader:

File classesDir = new File(pluginDir, “classes”);

if (classesDir.exists()) {

list.add(classesDir.toURL());

}

Might have to do some serious debugging to find out what’'s going on…

-Matt

Hi Matt,

Huh, I just checked the code and am a bit mystified.

Files in the classes directory should be part of

the classloader. We have the following code in

PluginClassLoader:

File classesDir = new File(pluginDir,

uginDir, “classes”);

if (classesDir.exists()) {

list.add(classesDir.toURL());

}

Yes, you are correct that files in the myplugin/classes directory would be part of the classloader if those files and/or directory were actually copied over during the ant build process which they aren’‘t; you can test this by placing a file in that directory and then looking in the myplugin.jar, the file nor the directory won’'t be there. I think having that directory called “classes” is what is leading to some of the confusion.

Thanks,

Ryan

Hi Ryan,

What ablout the problem now?

In order to let my app work, I now put my conf.jar file into the

${Jive Messenger}\lib directory.But I know, it’'s really not a good idea.

BTW, can I send OOBXMessage from XMPPServer? I just find sendServerMessage(JID address, String subject, String body) and sendServerMessage(String subject, String body) in the javadoc,that means I can but only send plain text message, if I want to send a messge include a url with some description,what should I do?

Thanks!

Hi Zey,

I was going to post a follow-up message this morning but you beat me to it. Have you been able to load your applicationContext.xml file when it was packaged as a jar? I was never able to. If you check out from cvs or download the latest nightly version (2.1.4) of Messenger you can now place the applicationContext.xml file in the myplugin/classes directory and it will get bundled with the final jar. However, even without jaring the xml file I was never able to load/read it. I tried the following methods with both Spring 1.1.5 and 1.2:

URL url = this.getClass().getClassLoader().getResource("applicationContext.xml");
String[] files = {url.toString()};
ApplicationContext context = new FileSystemXmlApplicationContext(files); ApplicationContext context = new ClassPathXmlApplicationContext("classpath*:**/*applicationContext.xml");         ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

As far as sending url’‘s via the sendServerMessage() methods there isn’'t anything special you need to do. It is up to the client on how that message will be displayed.

Thanks,

Ryan

Ryan,

I usually find that a “/” is necessary when trying to load a resource from the classpath. Does something like this work?

getClass().getClassLoader().getResource("/applicationContext.xml");

-Matt

Hi Matt,

No unfortunately that doesn’‘t work. What’‘s a bit strange is that using the FileSystemXmlApplicationContext() method I’‘m able to load the context file but I get a ClassNotFoundException when I try to load the specified bean. When I use ClassPathXmlApplicationContext(“classpath**:****/**context.xml”) method I get a NoSuchBeanDefinitionException. I’'m thinking it might be a classloader issue but I was curious to know if Zey had figured out a solution before going forward.

Thanks,

Ryan

Hi Ryan,

Although it isn’'t a good solution, I already have let my app work now.

I jar the applicationContext.xml file into the conf.jar file, and put it into the

${Jive Messenger}/lib directory, in order to let spring find all the bean’‘s class that must be initialized, I put all the jar files into the ${Jive Messenger}/lib directory, include my app.jar, then, in the plugin file, you can use the spring’'s ability.

If you make your app work, please let me know.

Thanks.

Hi Zey,

That’‘s a creative solution you came up with. I’‘ll do a bit more digging and see if I can’‘t figure out something that’'s bit cleaner.

Thanks,

Ryan