Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Instantiation of bean failed

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Instantiation of bean failed

    Hi, I'm trying to get a java daemon running. It was written in a Linux environment and I'm trying to get it to run in XP. The problem is probably with a missing dependency, but I'm very new to java and really don't know what the error message means or where to look for answers.

    Here is the code:
    package com.dss.xrp.smtp.bootstrap;
     
    import org.springframework.context.support.AbstractApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
     
    import com.dss.xrp.smtp.SmtpServer;
     
    public class Bootstrap {
     
        public static void main(String[] args) {
     
            AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
                    "smtp-server-context.xml");
            ctx.start();
            SmtpServer svr = (SmtpServer) ctx.getBean("dssServer");
            svr.start();
        }
     
    }
    and here is the error message:

    .
    .
    .

    betha-smtp.jar;D:\dss\smtp\lib\subethasmtp.jar;D:\dss\sm tp\conf\smtp2mq com.ds
    s.xrp.smtp.bootstrap.Bootstrap
    FowrdingListener
    Runtime environment is 0( Production )
    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce pti
    on: Error creating bean with name 'subethaServer' defined in class path resource
    [smtp-server-context.xml]: Instantiation of bean failed; nested exception is or
    g.springframework.beans.BeanInstantiationException : Could not instantiate bean c
    lass [org.subethamail.smtp.server.SMTPServer]: Constructor threw exception; nest
    ed exception is java.lang.NoClassDefFoundError: net/sourceforge/retroweaver/runt
    ime/java/lang/Enum
    at org.springframework.beans.factory.support.Construc torResolver.autowir
    eConstructor(ConstructorResolver.java:254)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.autowireConstructor(AbstractAutowireCapabl eBeanFactory.java:925)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.createBeanInstance(AbstractAutowireCapable BeanFactory.java:835)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.doCreateBean(AbstractAutowireCapableBeanFa ctory.java:440)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory$1.run(AbstractAutowireCapableBeanFactory.j ava:409)
    .
    .
    ... 19 more
    Caused by: java.lang.ClassNotFoundException: net.sourceforge.retroweaver.runtim
    .java.lang.Enum
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    ... 39 more
    I'd appreciate some guidance
    Last edited by peejayuk; August 15th, 2011 at 09:26 AM. Reason: Additional error message detail may be useful


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Instantiation of bean failed

    ClassNotFoundException - meaning the virtual machine cannot find a class. Maker sure all required libraries on are the classpath

Similar Threads

  1. [SOLVED] What do I need to do to use a bean in Netbeans 7 apart from defining it?
    By Lord Voldemort in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: July 31st, 2011, 12:29 AM
  2. Instantiation troubles
    By hello_world in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 16th, 2011, 08:24 PM
  3. ActionServlet Instantiation
    By tcstcs in forum Web Frameworks
    Replies: 0
    Last Post: April 5th, 2011, 06:12 AM
  4. converting HashMap to a Bean
    By achsu in forum Collections and Generics
    Replies: 0
    Last Post: February 2nd, 2011, 09:13 PM
  5. Servlet Writing to Object or Bean
    By kurt-hardy in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: January 12th, 2011, 11:27 AM