小编wun*_*tee的帖子

你如何以编程方式在Java中签署jar文件?

有没有人这样做过?我在谷歌上发现的唯一参考是:http://onjava.com/onjava/2001/04/12/signing_jar.html仍然使用sun.*类会导致问题......

发现这一点,但不适用于java16:https://svn.cs.cf.ac.uk/projects/whip/trunk/whip-core/src/main/java/org/whipplugin/data/bundle/ JarSigner15.java

java jar sign

8
推荐指数
2
解决办法
4001
查看次数

Maven Thrift存储库

有谁知道Thrift库是否在任何Maven存储库中?

thrift maven

6
推荐指数
2
解决办法
7367
查看次数

XSD格式化<element> <complexType> vs <complexType /> <element />

此XSD部分来自:http://www.iana.org/assignments/xml-registry/schema/netconf.xsd

 <xs:complexType name="rpcType">
   <xs:sequence>
     <xs:element ref="rpcOperation"/>
   </xs:sequence>
   <xs:attribute name="message-id" type="messageIdType" use="required"/>
   <xs:anyAttribute processContents="lax"/>
 </xs:complexType>
 <xs:element name="rpc" type="rpcType"/>
Run Code Online (Sandbox Code Playgroud)

并且是NETCONF中函数调用的核心是XML文档的节点.我很好奇为什么它不是这样的:

 <xs:element name="rpcType">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="rpcOperation"/>
    </xs:sequence>
    <xs:attribute name="message-id" type="messageIdType" use="required"/>
    <xs:anyAttribute processContents="lax"/>
  </xs:complexType>
 </xs:element>
Run Code Online (Sandbox Code Playgroud)

理由是在#1中尝试编组bean时(在jaxb2中)我得到了异常:

[com.sun.istack.SAXException2: unable to marshal type "netconf.RpcType" as an element because it is missing an @XmlRootElement annotation]
Run Code Online (Sandbox Code Playgroud)

我一遍又一遍地阅读这篇文章,真的无法掌握差异,为什么它会#1对#2 ...

xsd jaxb

6
推荐指数
2
解决办法
3782
查看次数

Maven,如何添加repo中没有的其他库

我有一个maven项目,它有一组库依赖项,不能通过任何maven存储库获得.如何将这些库添加到pom中?我想这样做,所以当我运行'mvn eclipse:eclipse'时,它不会从eclipse类路径中删除这些库.

maven-2 pom.xml

5
推荐指数
2
解决办法
2万
查看次数

Spring security ldap:找不到元素'ldap-authentication-provider'的声明

遵循spring-security文档:http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ldap.html我正在尝试设置ldap身份验证(非常简单 - 只需要知道如果用户是否经过身份验证,则不需要权限映射)并将其放在我的applicationContext-security.xml文件中

<beans:beans xmlns="http://www.springframework.org/schema/security"
  xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/security
           http://www.springframework.org/schema/security/spring-security-3.0.xsd">      
...

<ldap-server url="ldap://adapps.company.com:389/dc=company,dc=com" />
<ldap-authentication-provider user-search-filter="(samaccountname={0})" user-search-base="dc=company,dc=com"/>
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是它看起来不像ldap-authentication-provider; 我觉得我可能会遗漏一些配置不是bean的定义.我在尝试运行应用程序时遇到的错误是:

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 27 in XML document from ServletContext resource [/WEB-INF/rvaContext-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'ldap-authentication-provider'.
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    at …
Run Code Online (Sandbox Code Playgroud)

ldap spring-security

5
推荐指数
1
解决办法
9387
查看次数

Spring安全自定义ldap身份验证提供程序

我目前的ldap身份验证上下文设置如下:

    <ldap-server url="ldap://host/dn"
        manager-dn="cn=someuser"
        manager-password="somepass" />
    <authentication-manager>
        <ldap-authentication-provider user-search-filter="(samaccountname={0})"/>
    </authentication-manager> 
Run Code Online (Sandbox Code Playgroud)

现在,我需要能够设置自定义权限映射器(它使用不同的ldap服务器) - 所以我假设我需要设置类似于(http://static.springsource.org/spring的 ldap-server)-security/site/docs/2.0.x/reference/ldap.html):

<bean id="ldapAuthProvider"
        class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
  <constructor-arg>
    <bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">
      <constructor-arg ref="contextSource"/>
      <property name="userDnPatterns">
        <list><value>uid={0},ou=people</value></list>
      </property>
    </bean>
  </constructor-arg>
  <constructor-arg>
    <bean class="org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator">
      <constructor-arg ref="contextSource"/>
      <constructor-arg value="ou=groups"/>
      <property name="groupRoleAttribute" value="ou"/>
    </bean>
  </constructor-arg>
</bean>
Run Code Online (Sandbox Code Playgroud)

但是,如何在安全上下文中将"ldapAuthProvider"引用到ldap-server?

我也使用spring-security 3,所以''不存在......

java authentication spring-security

5
推荐指数
2
解决办法
4万
查看次数

Android模拟器:设置移动设备号码?

有谁知道是否可以设置模拟器的手机号码?我无法在任何地方找到相关信息.谢谢.

android emulation

5
推荐指数
1
解决办法
2万
查看次数

Java force catch RuntimeException?

是否有可能强制java让你捕获RuntimeExceptions?具体来说,我正在使用Spring框架,整个异常层次结构基于RuntimeExceptions.很多时候我忘记尝试捕捉异常.一个具体的例子是在进行LDAP查询或SQL调用时.

java exception-handling

4
推荐指数
3
解决办法
5591
查看次数

Spring JavaMailSenderImpl javax.mail.NoSuchProviderException:smtp

我有一个非常大的项目,有大量的依赖,并在尝试发送邮件时遇到以下异常:

javax.mail.NoSuchProviderException: smtp
Run Code Online (Sandbox Code Playgroud)

我知道代码可以工作,因为它是在其他项目中使用的库的一部分.有谁知道会导致这种异常的原因是什么?我查看了所有的jar,唯一包含'javax.mail'的是'mail-1.4.4-SNAPSHOT.jar'.

是否有一些文件/类注册了'smtp'协议,它可能发生在我的类路径中的其他地方?

spring smtp jakarta-mail

4
推荐指数
1
解决办法
8958
查看次数

Android模拟器版本16.0持久/系统/存储?

在过去,我能够通过将system.img文件从基本目录(例如:$ ANDROID_HOME/platforms/android-10/images/system.img)复制到AVD目录中来创建具有持久性/系统/存储的AVD. (例如:〜/ .android/avd/wuntee.avd /)然后将/ system/partition重新安装为rw,最后修改/ system/partition上的文件.这将持久存储到AVD本地system.img文件,并在重新启动时,更改将保持不变.此过程不适用于模拟器版本16 ...

模拟器中有选项,特别是:

-sysdir <dir>                         search for system disk images in <dir>
-system <file>                        read initial system image from <file>
Run Code Online (Sandbox Code Playgroud)

我会假设将更改写回文件,但没有运气.有没有人经历过这个,并有一个解决方法(没有unyaffs的.img文件)?这是Android /模拟器开发人员故意做的吗?

android system emulation disk-partitioning

4
推荐指数
1
解决办法
672
查看次数