小编pau*_*aul的帖子

java.lang.SecurityException:类"XYZ"的签名者信息与同一包中其他类的签名者信息不匹配

我有一个applet,它在浏览器中运行,并从Javascript调用.有两个类:PortalLauncherParamSplitter,它们都在默认包中.JavaScript调用的方法PortalLauncher这反过来又调用一个函数ParamSplitter.小程序在一个签名的jar中.

这大部分时间都有效.但是,一些用户不时会遇到问题.在当天的某个时间(即不在第一次访问时),抛出以下异常:

java.lang.SecurityException: class "ParamSplitter"'s signer information does not
    match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(Unknown Source)
    at java.lang.ClassLoader.preDefineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at PortalLauncher.openFile(PortalLauncher.java:313)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) …
Run Code Online (Sandbox Code Playgroud)

java applet securityexception

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

NHibernate中的GUID比较QueryOver会引发错误

我试图获取所有ProductCheckedOutToGuid为空或为当前用户的GUID.我试过使用以下QueryOver:

    public IEnumerable<IProduct> GetProducts(IUser user, Expression<Func<IProduct, bool>> predicate)
    {
        return Context.GetSession().QueryOver<Product>()
            .Where(x => (x.CheckedOutByGuid == null) || Guid.Equals(user.UserGuid, x.CheckedOutByGuid)
            .OrderBy(x => x.Version).Desc
            .OrderBy(x => x.DisplayName).Asc.List();
    }
Run Code Online (Sandbox Code Playgroud)

但是我收到一个错误:

Atf.NUnit.Model.TestDatabase.TestModule1():
System.Exception : Unrecognised method call: System.Object:Boolean Equals(System.Object, System.Object)
Run Code Online (Sandbox Code Playgroud)

这个错误的原因是什么?我尝试删除,(x.CheckedOutByGuid == null)以便不需要OR但仍然得到相同的错误.

UPDATE

正如建议的那样@Andrew Whitaker,我换了一行

   .Where(x => (x.CheckedOutByGuid == null) || (user.UserGuid == x.CheckedOutByGuid))
Run Code Online (Sandbox Code Playgroud)

这现在导致以下异常:

Atf.NUnit.Model.TestDatabase.TestModule1():
NHibernate.QueryException : could not resolve property: user of: Atf.Model.Internal.Product
bei NHibernate.Persister.Entity.AbstractPropertyMapping.ToType(String propertyName) in p:\nhibernate-core\src\NHibernate\Persister\Entity\AbstractPropertyMapping.cs:Zeile 37.
bei NHibernate.Persister.Entity.AbstractEntityPersister.GetSubclassPropertyTableNumber(String propertyPath) in …
Run Code Online (Sandbox Code Playgroud)

nhibernate queryover

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

什么个人数据不应该在网上发布?

我被要求创建一种家庭网站,亲戚可以发布各种家庭成员(主要是祖先)的论文和照片.

面对大量的个人信息,如出生日期,出生地,结婚日期等,我想知道应该在网上提供多少这样的信息.我将在网站上设置密码保护,因此它不会对所有人完全开放.

你对此有何看法?

  • 是否足以隐藏生活者的个人信息并为死者展示一切?
  • 你如何成功地驯服那些想要在技术上尽一切可能做到的事情而不是做"适当"的极客?
  • 是否存在此类问题的清单?

social privacy genealogy web

3
推荐指数
1
解决办法
430
查看次数

如何在CI构建中更改POM版本?

我可能完全错误地解决了这个问题,但是这里......

我们希望使用 Gitlab 和 Nexus 实现development-> releases/x.y.z->master工作流程。这些工件应分别标记为x.y.z-SNAPSHOTx.y.z-rcx.y.z

在 中ci-build.yml,我尝试根据当前分支修改 POM,以便创建正确标记的工件。问题显然是,更改将比当前构建提交提前一次提交,并且构建中使用的 POM 具有原始版本。

例如

  • 发布分支是从开发创建的
  • POM 有 2.3.4-SNAPSHOT,在 期间ci-build,修改为 2.3.4-rc 并提交并推送到 git
  • 执行后续的构建和部署操作,但这会将 2.3.4-SNAPSHOT 包部署到 Nexus,而不是所需的 2.3.4-rc

我的问题如下:

我可以修改 POM 并在后续所有阶段使用更新后的 POM 吗ci-build

(我不认为这是正确的程序,但这是我的团队领导所要求的,所以我正在尝试实施它......)

maven gitlab gitlab-ci

3
推荐指数
1
解决办法
5460
查看次数

app.config中的ConnectionStrings.安全性怎么样?

将连接字符串与密码放在app.config文件中真的很好吗?

在我看来,app.config没有以任何方式加密,并且可以轻松读取密码信息.

我有一个应用程序访问数据库,目标最终用户没有身份验证.使用组用户/密码.仅当当前Windows用户位于Active Directory组中时,才会启动该应用程序.因此,一旦进入应用程序,用户就可以使用组用户连接到数据库.

处理此类连接字符串的正确方法是什么?在源代码中隐藏它们?

注意这是一个独立的应用程序 - 而不是ASP,IIS等

这对我有用

(感谢Jon Galloway - http://weblogs.asp.net/jgalloway/archive/2008/04/13/encrypting-passwords-in-a-net-app-config-file.aspx)

private void EncryptConfigSection()
{
    Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
    ConfigurationSection section = config.AppSettings;
    if (section != null)
    {
        if (!section.SectionInformation.IsProtected)
        {
            if (!section.ElementInformation.IsLocked)
            {
                section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
                section.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Full);
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这通过在应用程序第一次运行时加密exe配置文件来实现.我没有找到一种方法在安装过程中执行此操作,因此配置文件完全可读,直到第一次启动应用程序.也许有人有个主意......

.net connection-string app-config

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

为什么 getGeneratedKeys() 在 INSERT 后不返回任何结果?

我有一个表,其中有一列被定义为自动生成键。执行以下代码时,我希望生成一个新密钥,但事实并非如此。插入了一行,但 ResultSet 为ps.getGeneratedKeys()空。

我正在使用 DB2:SQLLIB_ADCL_V97FP1。

        conn = getConnection();
        conn.setAutoCommit(false);
        String query = 
            "INSERT INTO MyTable " +
            "  (messe_nr, land5, variable_nr, bezeichnung_en, bezeichnung_de) " +
            "VALUES (?,?,?,?,?)";

        PreparedStatement ps = conn.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);
        ps.setInt(1, fair.getFairId());
        ps.setString(2, variable.getCountryCode());
        ps.setInt(3, variable.getSort());
        ps.setString(4, variable.getLabel_en());
        ps.setString(5, variable.getLabel_de());

        log.debug(query);
        int count = ps.executeUpdate();
        if(count == 1) {
            ResultSet rs = ps.getGeneratedKeys();
            if(rs.next()) {
                variable.setId(rs.getBigDecimal(1).intValue());
            } else {
                log.error("Could not get autogen key after variable insert");
                throw new AVMSException(1500);
            }
            rs.close();
        }
        log.debug("inserted " + …
Run Code Online (Sandbox Code Playgroud)

sql jdbc

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

在VMWare上运行Sharepoint 2003?

我们的生产Sharepoint服务器为大约800个用户提供服务,并在物理双核机器上与其SQL Server一起运行.

网络人员现在尽可能多地放在VMWare上.Sharepoint服务器和SQL Server将放在不同的服务器上.

有没有人有在VM上运行生产级别Sharepoint服务器的经验?

sql-server virtualization vmware sharepoint virtual-machine

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

如何在OSGi包中设置连接池?

在为Websphere平台开发Web应用程序多年之后,我最近一直在研究OSGi,特别是与RAP(RichAjayPlatform)项目有关.

过去,我已经能够使用JNDI查找访问EAR中定义的连接池.

如何在OSGi环境中创建连接池并访问它们?我创建了一个包含jdbc驱动程序的DB2包,但我不确定如何创建池.以前,这是EAR中的一个配置,Websphere处理它.

那里有任何示例,教程吗?

db2 osgi connection-pooling

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

如何将 CommandParameter 绑定到 DataTemplate 中父控件的 x:name?

我的 View XAML 中有以下内容

<GroupBox Grid.Row="0" Header="Aktionen bei Prüfung Aufbau">
    <ContentControl Content="{Binding BuildUpActions}" ContentTemplate="{StaticResource FullActionListTemplate}" x:Name="BuildUp"/>
</GroupBox>

<GroupBox Grid.Row="1" Header="Aktionen bei Prüfung Abbau">
    <ContentControl Content="{Binding TearDownActions}" ContentTemplate="{StaticResource FullActionListTemplate}" x:Name="TearDown"/>
</GroupBox>
Run Code Online (Sandbox Code Playgroud)

DataTemplate 在单独的资源中定义

<DataTemplate x:Key="FullActionListTemplate">
    <DockPanel LastChildFill="True">
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Content="Neuer Ausgang" Style="{StaticResource ButtonRowStyle}"
                    Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TabControl}}, Path=DataContext.NewFullIOCommand}" 
                    CommandParameter="{Binding **?HOW?**}"
                    />
            <more buttons here...>
        </StackPanel>
        <ContentControl Content="{Binding}" >

        </ContentControl>
    </DockPanel>
</DataTemplate>
Run Code Online (Sandbox Code Playgroud)

命令在 ViewModel 中定义

    public ICommand NewFullIOCommand
    {
        get
        {
            if (this._newFullIOCommand == null)
            {
                this._newFullIOCommand = …
Run Code Online (Sandbox Code Playgroud)

wpf binding datatemplate

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