all groups > vj# > january 2004 >
You're in the vj# group:
What code access security permisssions does vjslib need?
vj#:
Hi, I have a J# class library which I call from Reporting Services. Inside the RS configuraration file I defined a custom code access group, as follows: <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="OpenForecastCodeGroup"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\OpenForecast.dll"/> </CodeGroup> The call fails with the exception below. What set of permissions does the J# library need to execute successfully? I ran PermView but got no results. Exception: System.Security.SecurityException: Request for the permission of type com.ms.vjsharp.util.VJSPermission, vjslib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a failed. at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken) at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride) at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) at System.Security.CodeAccessPermission.Demand() at java.lang.System.getProperty(String key, String def) at java.lang.System.getProperty(String key) at net.sourceforge.openforecast.DataSet.ToString() in C:\Books\RS\Code\OpenForecast\DataSet.java:line 384 at System.Diagnostics.TraceListener.WriteLine(Object o) at System.Diagnostics.TraceInternal.WriteLine(Object value) at System.Diagnostics.Trace.WriteLine(Object value) at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 43 at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, Double sales, Parameters reportParameters, TextBox txtRange) -- Teo Lachev
Teo, How is your J# code getting called. I see that in your code group you use a URL as the membership condition. I'm thinking that maybe that membership condition is not getting satisfied because of how the J# code is getting loaded and executed. Please explain how this code is getting called. Thanks, Michael Green Microsoft Developer Support
You might want to take a look at the ‘Using Strong-Named Assemblies’ topic in SQL Reporting Services BOL. The following is an excerpt from that topic which may be useful. Using the AllowPartiallyTrustedCallersAttribute You can use the AllowPartiallyTrustedCallersAttribute to allow strong-named assemblies to be called by Report Designer or the report server in report expressions. If a custom assembly that you or a third-party create is strong-named, using the AllowPartiallyTrustedCallersAttribute is the recommended way in which strong-named assemblies can be incorporated into your reports. Security Note Before deploying an assembly that contains the AllowPartiallyTrustedCallersAttribute to your report server, you should review what operations and resources its public members can access. Always perform a security review before deploying custom assemblies to your report server. I hope this is helpful, Michael Green Microsoft Developer Support -------------------- | From: "Teo Lachev" <teo@online.hp.com> | Subject: What code access security permisssions does vjslib need? | Date: Thu, 29 Jan 2004 17:13:10 -0500 | Lines: 43 | X-Priority: 3 | X-MSMail-Priority: Normal | X-Newsreader: Microsoft Outlook Express 6.00.3790.0 | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 | Message-ID: <OanzVUr5DHA.2300@TK2MSFTNGP10.phx.gbl> | Newsgroups: microsoft.public.dotnet.vjsharp | NNTP-Posting-Host: 209.101.193.66 | Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08 .phx.gbl!TK2MSFTNGP10.phx.gbl | Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.vjsharp:5272 | X-Tomcat-NG: microsoft.public.dotnet.vjsharp | | Hi, | | I have a J# class library which I call from Reporting Services. Inside the | RS configuraration file I defined a custom code access group, as follows: | <CodeGroup class="UnionCodeGroup" version="1" | PermissionSetName="FullTrust" Name="OpenForecastCodeGroup"> | <IMembershipCondition class="UrlMembershipCondition" version="1" | Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting | Services\ReportServer\bin\OpenForecast.dll"/> | </CodeGroup> | | The call fails with the exception below. What set of permissions does the J# | library need to execute successfully? I ran PermView but got no results. | | Exception: System.Security.SecurityException: Request for the permission of | type com.ms.vjsharp.util.VJSPermission, vjslib, Version=1.0.5000.0, | Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a failed. | at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet | grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, | PermissionToken permToken) | at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, | CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, | Int32 unrestrictedOverride) | at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, | StackCrawlMark& stackMark) | at System.Security.CodeAccessPermission.Demand() | at java.lang.System.getProperty(String key, String def) | at java.lang.System.getProperty(String key) | at net.sourceforge.openforecast.DataSet.ToString() in | C:\Books\RS\Code\OpenForecast\DataSet.java:line 384 | at System.Diagnostics.TraceListener.WriteLine(Object o) | at System.Diagnostics.TraceInternal.WriteLine(Object value) | at System.Diagnostics.Trace.WriteLine(Object value) | at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 | numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 43 | at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, | Double sales, Parameters reportParameters, TextBox txtRange) | | -- | Teo Lachev | | | |
Michael, Are you saying that I need to convert my C# and J# assemblies to strong-named assemblies? [quoted text, click to view] "Michael Green" <mikegreonline@microsoft.com> wrote in message news:HUH#huA8DHA.1992@cpmsftngxa07.phx.gbl... > You might want to take a look at the ‘Using Strong-Named Assemblies’ topic > in SQL Reporting Services BOL. The following is an excerpt from that topic > which may be useful. > > Using the AllowPartiallyTrustedCallersAttribute > You can use the AllowPartiallyTrustedCallersAttribute to allow strong-named > assemblies to be called by Report Designer or the report server in report > expressions. If a custom assembly that you or a third-party create is > strong-named, using the AllowPartiallyTrustedCallersAttribute is the > recommended way in which strong-named assemblies can be incorporated into > your reports. > > Security Note Before deploying an assembly that contains the > AllowPartiallyTrustedCallersAttribute to your report server, you should > review what operations and resources its public members can access. Always > perform a security review before deploying custom assemblies to your report > server. > > I hope this is helpful, > > Michael Green > Microsoft Developer Support > -------------------- > | From: "Teo Lachev" <teo@online.hp.com> > | Subject: What code access security permisssions does vjslib need? > | Date: Thu, 29 Jan 2004 17:13:10 -0500 > | Lines: 43 > | X-Priority: 3 > | X-MSMail-Priority: Normal > | X-Newsreader: Microsoft Outlook Express 6.00.3790.0 > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 > | Message-ID: <OanzVUr5DHA.2300@TK2MSFTNGP10.phx.gbl> > | Newsgroups: microsoft.public.dotnet.vjsharp > | NNTP-Posting-Host: 209.101.193.66 > | Path: > cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08 > phx.gbl!TK2MSFTNGP10.phx.gbl > | Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.vjsharp:5272 > | X-Tomcat-NG: microsoft.public.dotnet.vjsharp > | > | Hi, > | > | I have a J# class library which I call from Reporting Services. Inside the > | RS configuraration file I defined a custom code access group, as follows: > | <CodeGroup class="UnionCodeGroup" version="1" > | PermissionSetName="FullTrust" Name="OpenForecastCodeGroup"> > | <IMembershipCondition class="UrlMembershipCondition" version="1" > | Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting > | Services\ReportServer\bin\OpenForecast.dll"/> > | </CodeGroup> > | > | The call fails with the exception below. What set of permissions does the > J# > | library need to execute successfully? I ran PermView but got no results. > | > | Exception: System.Security.SecurityException: Request for the permission > of > | type com.ms.vjsharp.util.VJSPermission, vjslib, Version=1.0.5000.0, > | Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a failed. > | at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet > | grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, > | PermissionToken permToken) > | at System.Security.CodeAccessSecurityEngine.Check(PermissionToken > permToken, > | CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, > | Int32 unrestrictedOverride) > | at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission > cap, > | StackCrawlMark& stackMark) > | at System.Security.CodeAccessPermission.Demand() > | at java.lang.System.getProperty(String key, String def) > | at java.lang.System.getProperty(String key) > | at net.sourceforge.openforecast.DataSet.ToString() in > | C:\Books\RS\Code\OpenForecast\DataSet.java:line 384 > | at System.Diagnostics.TraceListener.WriteLine(Object o) > | at System.Diagnostics.TraceInternal.WriteLine(Object value) > | at System.Diagnostics.Trace.WriteLine(Object value) > | at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 > | numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line > 43 > | at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, > | Double sales, Parameters reportParameters, TextBox txtRange) > | > | -- > | Teo Lachev > | > | > | > | >
There are a couple of things to know here: First off J# code currently is not able to be called from partially trusted code (i.e. anything that does not have full trust). Secondly in order to for your code to be called from Reporting Services your assemblies they must be marked with the AllowPartiallyTrustedCallers and be strong named. So you won't be able to call J# assemblies from Reporting Services (even if there is a C# assembly in between). There is no "conversion" involved in strong naming an assembly. All you need to do is generate a key pair with the sn.exe tool and then use the [assembly: AssemblyKeyFile("")] directive to specify your key pair (.snk file). I hope this is helpful, Michael Green Microsoft Developer Support
Michael, Thanks for perservering. Reporting Services does allow calling "weekly"-named assemblies. Anyway, I tried the strong-named approach and AllowPartiallyTrustedCaller attribute to no avail. The exception now is: Exception: System.TypeInitializationException: The type initializer for "java.lang.System" threw an exception. ---> java.lang.UnsatisfiedLinkError: ? --- End of inner exception stack trace --- at java.lang.System.arraycopy(Object src, Int32 src_position, Object dst, Int32 dst_position, Int32 length) at java.util.ArrayList.add(Int32 ix, Object e) at java.util.ArrayList.add(Object e) at net.sourceforge.openforecast.DataSet.add(DataPoint dataPoint) in C:\Books\RS\Code\OpenForecast\DataSet.java:line 125 at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 39 at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, Double sales, Parameters reportParameters, TextBox txtRange) If I replace the java library with C# assembly (which I don't want to do), the calls completes successfully even if both assemblies are weekly-named. What is UnsatisfiedLinkError? Regards, Teo [quoted text, click to view] "Michael Green" <mikegreonline@microsoft.com> wrote in message news:gnWpo$M8DHA.2992@cpmsftngxa07.phx.gbl... > There are a couple of things to know here: > > First off J# code currently is not able to be called from partially trusted > code (i.e. anything that does not have full trust). > Secondly in order to for your code to be called from Reporting Services > your assemblies they must be marked with the AllowPartiallyTrustedCallers > and be strong named. > > So you won't be able to call J# assemblies from Reporting Services (even if > there is a C# assembly in between). > > There is no "conversion" involved in strong naming an assembly. All you > need to do is generate a key pair with the sn.exe tool and then use the > [assembly: AssemblyKeyFile("")] directive to specify your key pair (.snk > file). > > I hope this is helpful, > > Michael Green > Microsoft Developer Support >
After adding UnmanagedCode permission, now the error message is bit more informative: Exception: System.TypeInitializationException: The type initializer for "java.lang.System" threw an exception. ---> java.lang.UnsatisfiedLinkError: Unable to load DLL (vjsnativ). --- End of inner exception stack trace --- at java.lang.System.arraycopy(Object src, Int32 src_position, Object dst, Int32 dst_position, Int32 length) at java.util.ArrayList.add(Int32 ix, Object e) at java.util.ArrayList.add(Object e) at net.sourceforge.openforecast.DataSet.add(DataPoint dataPoint) in C:\Books\RS\Code\OpenForecast\DataSet.java:line 125 at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 39 at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, Double sales, Parameters reportParameters, TextBox txtRange) Which begs the same question. What permissions does vjsnativ need so I can assert it in my J# code? [quoted text, click to view] "Teo Lachev" <teo@online.hotmail.com> wrote in message news:OQmfyHZ8DHA.3380@tk2msftngp13.phx.gbl... > Michael, > > Thanks for perservering. Reporting Services does allow calling > "weekly"-named assemblies. Anyway, I tried the strong-named approach and > AllowPartiallyTrustedCaller attribute to no avail. The exception now is: > > Exception: System.TypeInitializationException: The type initializer for > "java.lang.System" threw an exception. ---> java.lang.UnsatisfiedLinkError: > ? > --- End of inner exception stack trace --- > at java.lang.System.arraycopy(Object src, Int32 src_position, Object dst, > Int32 dst_position, Int32 length) > at java.util.ArrayList.add(Int32 ix, Object e) > at java.util.ArrayList.add(Object e) > at net.sourceforge.openforecast.DataSet.add(DataPoint dataPoint) in > C:\Books\RS\Code\OpenForecast\DataSet.java:line 125 > at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 > numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 39 > at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, > Double sales, Parameters reportParameters, TextBox txtRange) > > > If I replace the java library with C# assembly (which I don't want to do), > the calls completes successfully even if both assemblies are weekly-named. > What is UnsatisfiedLinkError? > > Regards, > > Teo > > "Michael Green" <mikegreonline@microsoft.com> wrote in message > news:gnWpo$M8DHA.2992@cpmsftngxa07.phx.gbl... > > There are a couple of things to know here: > > > > First off J# code currently is not able to be called from partially > trusted > > code (i.e. anything that does not have full trust). > > Secondly in order to for your code to be called from Reporting Services > > your assemblies they must be marked with the AllowPartiallyTrustedCallers > > and be strong named. > > > > So you won't be able to call J# assemblies from Reporting Services (even > if > > there is a C# assembly in between). > > > > There is no "conversion" involved in strong naming an assembly. All you > > need to do is generate a key pair with the sn.exe tool and then use the > > [assembly: AssemblyKeyFile("")] directive to specify your key pair (.snk > > file). > > > > I hope this is helpful, > > > > Michael Green > > Microsoft Developer Support > > > >
Getting closer. After some more trials and errors I get now: Exception: System.Security.SecurityException: Request for the permission of type com.ms.vjsharp.util.VJSPermission, vjslib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a failed. at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken) at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride) at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) at System.Security.CodeAccessPermission.Demand() at java.lang.System.getProperty(String key, String def) at java.lang.System.getProperty(String key) at net.sourceforge.openforecast.DataSet.ToString() in C:\Books\RS\Code\OpenForecast\DataSet.java:line 384 at System.Diagnostics.TraceListener.WriteLine(Object o) at System.Diagnostics.TraceInternal.WriteLine(Object value) at System.Diagnostics.Trace.WriteLine(Object value) at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 45 at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, Double sales, Parameters reportParameters, TextBox txtRange) How shoud I declare the VJSPermission in the configuration file? This is what I tried but it doesn't work: <SecurityClass Name="VJSPermission" Description="com.ms.vjsharp.util.VJSPermission, vjslib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <PermissionSet class="NamedPermissionSet" version="1" Unrestricted="true" Name="MyPermissionSet"> <IPermission class="VJSPermission" version="1" Flags="FullTrust" /> </PermissionSet> Then, <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="MyPermissionSet" Name="OpenForecast"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\OpenForecast.dll"/> </CodeGroup> [quoted text, click to view] "Teo Lachev" <teo@online.hotmail.com> wrote in message news:uSMh0Ca8DHA.2044@TK2MSFTNGP10.phx.gbl... > After adding UnmanagedCode permission, now the error message is bit more > informative: > > Exception: System.TypeInitializationException: The type initializer for > "java.lang.System" threw an exception. ---> java.lang.UnsatisfiedLinkError: > Unable to load DLL (vjsnativ). > --- End of inner exception stack trace --- > at java.lang.System.arraycopy(Object src, Int32 src_position, Object dst, > Int32 dst_position, Int32 length) > at java.util.ArrayList.add(Int32 ix, Object e) > at java.util.ArrayList.add(Object e) > at net.sourceforge.openforecast.DataSet.add(DataPoint dataPoint) in > C:\Books\RS\Code\OpenForecast\DataSet.java:line 125 > at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 > numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 39 > at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, > Double sales, Parameters reportParameters, TextBox txtRange) > > Which begs the same question. What permissions does vjsnativ need so I can > assert it in my J# code? > > "Teo Lachev" <teo@online.hotmail.com> wrote in message > news:OQmfyHZ8DHA.3380@tk2msftngp13.phx.gbl... > > Michael, > > > > Thanks for perservering. Reporting Services does allow calling > > "weekly"-named assemblies. Anyway, I tried the strong-named approach and > > AllowPartiallyTrustedCaller attribute to no avail. The exception now is: > > > > Exception: System.TypeInitializationException: The type initializer for > > "java.lang.System" threw an exception. ---> > java.lang.UnsatisfiedLinkError: > > ? > > --- End of inner exception stack trace --- > > at java.lang.System.arraycopy(Object src, Int32 src_position, Object dst, > > Int32 dst_position, Int32 length) > > at java.util.ArrayList.add(Int32 ix, Object e) > > at java.util.ArrayList.add(Object e) > > at net.sourceforge.openforecast.DataSet.add(DataPoint dataPoint) in > > C:\Books\RS\Code\OpenForecast\DataSet.java:line 125 > > at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 > > numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line > 39 > > at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, > > Double sales, Parameters reportParameters, TextBox txtRange) > > > > > > If I replace the java library with C# assembly (which I don't want to do), > > the calls completes successfully even if both assemblies are weekly-named. > > What is UnsatisfiedLinkError? > > > > Regards, > > > > Teo > > > > "Michael Green" <mikegreonline@microsoft.com> wrote in message > > news:gnWpo$M8DHA.2992@cpmsftngxa07.phx.gbl... > > > There are a couple of things to know here: > > > > > > First off J# code currently is not able to be called from partially > > trusted > > > code (i.e. anything that does not have full trust). > > > Secondly in order to for your code to be called from Reporting Services > > > your assemblies they must be marked with the > AllowPartiallyTrustedCallers > > > and be strong named. > > > > > > So you won't be able to call J# assemblies from Reporting Services (even > > if > > > there is a C# assembly in between). > > > > > > There is no "conversion" involved in strong naming an assembly. All you > > > need to do is generate a key pair with the sn.exe tool and then use the > > > [assembly: AssemblyKeyFile("")] directive to specify your key pair (.snk > > > file). > > > > > > I hope this is helpful, > > > > > > Michael Green > > > Microsoft Developer Support > > > > > > > > >
I wasn't able to figure it out but removing the Diagnostic.Trace.WriteLine calls seems to fix the problem. Those calls were outputting some custom structures by iterating through their elements. Now the report works with only FullTrust permissions to both binaries. Thanks for all of your help Michael and Lars. Regards, Teo [quoted text, click to view] "Teo Lachev" <teo@online.hotmail.com> wrote in message news:uxL1Eba8DHA.1592@TK2MSFTNGP10.phx.gbl... > Getting closer. After some more trials and errors I get now: > > Exception: System.Security.SecurityException: Request for the permission of > type com.ms.vjsharp.util.VJSPermission, vjslib, Version=1.0.5000.0, > Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a failed. > at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet > grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, > PermissionToken permToken) > at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, > CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, > Int32 unrestrictedOverride) > at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, > StackCrawlMark& stackMark) > at System.Security.CodeAccessPermission.Demand() > at java.lang.System.getProperty(String key, String def) > at java.lang.System.getProperty(String key) > at net.sourceforge.openforecast.DataSet.ToString() in > C:\Books\RS\Code\OpenForecast\DataSet.java:line 384 > at System.Diagnostics.TraceListener.WriteLine(Object o) > at System.Diagnostics.TraceInternal.WriteLine(Object value) > at System.Diagnostics.Trace.WriteLine(Object value) > at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 > numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line 45 > at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, > Double sales, Parameters reportParameters, TextBox txtRange) > > How shoud I declare the VJSPermission in the configuration file? This is > what I tried but it doesn't work: > > <SecurityClass Name="VJSPermission" > Description="com.ms.vjsharp.util.VJSPermission, vjslib, Version=1.0.5000.0, > Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> > > <PermissionSet > > class="NamedPermissionSet" > > version="1" > > Unrestricted="true" > > Name="MyPermissionSet"> > > <IPermission > > class="VJSPermission" > > version="1" > > Flags="FullTrust" > > /> > > </PermissionSet> > > Then, > > <CodeGroup class="UnionCodeGroup" version="1" > PermissionSetName="MyPermissionSet" Name="OpenForecast"> > > <IMembershipCondition class="UrlMembershipCondition" version="1" > Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting > Services\ReportServer\bin\OpenForecast.dll"/> > > </CodeGroup> > > > > > > "Teo Lachev" <teo@online.hotmail.com> wrote in message > news:uSMh0Ca8DHA.2044@TK2MSFTNGP10.phx.gbl... > > After adding UnmanagedCode permission, now the error message is bit more > > informative: > > > > Exception: System.TypeInitializationException: The type initializer for > > "java.lang.System" threw an exception. ---> > java.lang.UnsatisfiedLinkError: > > Unable to load DLL (vjsnativ). > > --- End of inner exception stack trace --- > > at java.lang.System.arraycopy(Object src, Int32 src_position, Object dst, > > Int32 dst_position, Int32 length) > > at java.util.ArrayList.add(Int32 ix, Object e) > > at java.util.ArrayList.add(Object e) > > at net.sourceforge.openforecast.DataSet.add(DataPoint dataPoint) in > > C:\Books\RS\Code\OpenForecast\DataSet.java:line 125 > > at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 > > numberForecastedPoints) in c:\books\rs\code\awrslibrary\rslibrary.cs:line > 39 > > at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, > > Double sales, Parameters reportParameters, TextBox txtRange) > > > > Which begs the same question. What permissions does vjsnativ need so I can > > assert it in my J# code? > > > > "Teo Lachev" <teo@online.hotmail.com> wrote in message > > news:OQmfyHZ8DHA.3380@tk2msftngp13.phx.gbl... > > > Michael, > > > > > > Thanks for perservering. Reporting Services does allow calling > > > "weekly"-named assemblies. Anyway, I tried the strong-named approach and > > > AllowPartiallyTrustedCaller attribute to no avail. The exception now is: > > > > > > Exception: System.TypeInitializationException: The type initializer for > > > "java.lang.System" threw an exception. ---> > > java.lang.UnsatisfiedLinkError: > > > ? > > > --- End of inner exception stack trace --- > > > at java.lang.System.arraycopy(Object src, Int32 src_position, Object > dst, > > > Int32 dst_position, Int32 length) > > > at java.util.ArrayList.add(Int32 ix, Object e) > > > at java.util.ArrayList.add(Object e) > > > at net.sourceforge.openforecast.DataSet.add(DataPoint dataPoint) in > > > C:\Books\RS\Code\OpenForecast\DataSet.java:line 125 > > > at AWC.RS.Library.RsLibrary.GetForecastedSet(Double[] dataSet, Int32 > > > numberForecastedPoints) in > c:\books\rs\code\awrslibrary\rslibrary.cs:line > > 39 > > > at CustomCodeProxy.GetValue(Int32 productCategoryID, DateTime orderDate, > > > Double sales, Parameters reportParameters, TextBox txtRange) > > > > > > > > > If I replace the java library with C# assembly (which I don't want to > do), > > > the calls completes successfully even if both assemblies are > weekly-named. > > > What is UnsatisfiedLinkError? > > > > > > Regards, > > > > > > Teo > > > > > > "Michael Green" <mikegreonline@microsoft.com> wrote in message > > > news:gnWpo$M8DHA.2992@cpmsftngxa07.phx.gbl... > > > > There are a couple of things to know here: > > > > > > > > First off J# code currently is not able to be called from partially > > > trusted > > > > code (i.e. anything that does not have full trust). > > > > Secondly in order to for your code to be called from Reporting > Services > > > > your assemblies they must be marked with the > > AllowPartiallyTrustedCallers > > > > and be strong named. > > > > > > > > So you won't be able to call J# assemblies from Reporting Services > (even > > > if > > > > there is a C# assembly in between). > > > > > > > > There is no "conversion" involved in strong naming an assembly. All > you > > > > need to do is generate a key pair with the sn.exe tool and then use > the > > > > [assembly: AssemblyKeyFile("")] directive to specify your key pair > (.snk > > > > file). > > > > > > > > I hope this is helpful, > > > > > > > > Michael Green > > > > Microsoft Developer Support > > > > > > > > > > > > > > > >
Don't see what you're looking for? Try a search.
|
|
|