上下文初始化失败java.lang.IllegalArgumentException

时间:2016-10-07 14:25:00

标签: java spring maven

我使用的是JAVA 8,Spring安全,hibernate和postGreSQL。我在启动Tomcat时出现此错误,登录页面打开但是没有输入它表示无效用户,并且所有信息都是正确的。我认为这是关于版本的东西,但我需要在哪里进行更改?除此之外还有其他人错了吗?

我的pom.xml

join

我的web.xml

public class ImageSliderAdapter : PagerAdapter
{
    Context _context;
    List<string> _imageUrls;

    public ImageSliderAdapter (Context context, List<string> imageUrls)
    {
        _imageUrls = imageUrls;
        _context = context;
    }

    public override bool IsViewFromObject (Android.Views.View view, Java.Lang.Object @object)
    {
        return view == ((LinearLayout)@object);
    }

    public override int Count {
        get {
            return _imageUrls.Count;
        }
    }

    public override void DestroyItem (ViewGroup container, int position, Java.Lang.Object objectValue)
    {
    }

    public override Java.Lang.Object InstantiateItem (ViewGroup container, int position)
    {

        View view = container;
        var inflater = _context.GetSystemService (Context.LayoutInflaterService) as LayoutInflater;
        view = inflater.Inflate (Resource.Layout.image_slider_item, null);
        var child = view.FindViewById<ImageView> (Resource.Id.image_slider_item);
        child.Click += (o, e) =>
        {
            //your code here
        };

        Bitmap image = null;
        Task.Run (() => {
            URL url = new URL (_imageUrls [position]);
            image = BitmapFactory.DecodeStream (url.OpenConnection ().InputStream);
        }).ContinueWith (t => {
            (_context as MainView).RunOnUiThread (() => {
                child.SetImageBitmap (image);
            });
        });

        container.AddView (view);
        return view;
    }
}

我的堆栈跟踪:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.Rastrbov</groupId>
    <artifactId>sisRastrbov</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>war</packaging>


    <build>
        <finalName>sisRastrbov</finalName>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.primefaces.themes</groupId>
            <artifactId>bootstrap</artifactId>
            <version>1.0.10</version>
            <scope>compile</scope>
        </dependency>
        <!-- núcleo do hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.1.0.Final</version>
            <scope>compile</scope>
        </dependency>

        <!-- implementação do Hibernate BeanValidator -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.1.3.Final</version>
            <scope>compile</scope>
        </dependency>


        <!-- implementação do entityManager da Jpa -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>5.1.0.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
            <version>1.6.2</version>
        </dependency>
        <!-- weld - implementação do CDI -->

        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet</artifactId>
            <version>2.3.5.Final</version>
        </dependency>

        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jandex</artifactId>
            <version>1.2.2.Final</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
            <scope>compile</scope>
        </dependency>

        <!-- Mojarra (implementação do JSF 2) -->
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.faces</artifactId>
            <version>2.2.9</version>
            <scope>compile</scope>
        </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.axis/axis -->
    <dependency>
        <groupId>org.apache.axis</groupId>
        <artifactId>axis</artifactId>
        <version>1.4</version>
    </dependency>

        <!-- omnifaces -->
        <dependency>
            <groupId>org.omnifaces</groupId>
            <artifactId>omnifaces</artifactId>
            <version>1.5</version>
            <scope>compile</scope>
        </dependency>

        <!-- Primefaces Biblioteca de componentes -->
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>5.3</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>


        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>4.0.1.RELEASE</version>
        </dependency>



        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-config -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>4.0.1.RELEASE</version>
        </dependency>



        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-core -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>4.0.1.RELEASE</version>
        </dependency>


        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.3</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
            <scope>compile</scope>
        </dependency>

        <!-- API de servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Commons Lang (utilidades) -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
            <scope>compile</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.mail/mail -->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
        </dependency>



    </dependencies>


    <repositories>
        <repository>
            <id>prime-repo</id>
            <name>PrimeFaces Maven Repository</name>
            <url>http://repository.primefaces.org</url>
            <layout>default</layout>
        </repository>
    </repositories>
</project> 

1 个答案:

答案 0 :(得分:3)

问题在这里说明:

  

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:   配置问题:您不能使用spring-security-2.0.xsd或   使用Spring的spring-security-3.0.xsd或spring-security-3.1.xsd模式   安全3.2。请将您的架构声明更新为3.2   架构。

这意味着您需要更新applicationContext.xml以使用3.2架构来实现Spring安全性。从那里寻找3.2样本和副本。

您可以复制和粘贴样本here以获取正确的声明。