You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Daniel Ellis (JIRA)" <ji...@apache.org> on 2010/07/13 15:31:51 UTC

[jira] Created: (AMQNET-262) NMS cannot be used if installed in the GAC

NMS cannot be used if installed in the GAC
------------------------------------------

                 Key: AMQNET-262
                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
             Project: ActiveMQ .Net
          Issue Type: Improvement
          Components: NMS
    Affects Versions: 1.3.0
         Environment: Windows .NET 2.0
            Reporter: Daniel Ellis
            Assignee: Jim Gomes
            Priority: Minor


If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.

{{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.

One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


ugg sandals

Posted by generationsuggs <ge...@sina.com>.
http://www.uggsandals.org/ UGG Sandals    
http://www.uggsandals.org/ UGGS For Cheap 
http://www.uggsandals.org/ Kids UGGS 
http://www.uggsandals.org/ UGGS Kids 
http://www.uggsandals.org/ Baby UGGS 
http://www.uggsandals.org/ UGG Kids 
http://www.uggsandals.org/ Black UGGS 

-- 
View this message in context: http://old.nabble.com/-jira--Created%3A-%28AMQNET-262%29-NMS-cannot-be-used-if-installed-in-the-GAC-tp29150432p29403826.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


[jira] Updated: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Daniel Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Ellis updated AMQNET-262:
--------------------------------

    Attachment: NMS GAC.patch

One solution for allowing the connectors to be loaded from the GAC.  It has minimal testing so far.

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60806#action_60806 ] 

Jim Gomes commented on AMQNET-262:
----------------------------------

After researching and thinking on this topic, I am beginning to question the use of the GAC with NMS.  One of the primary strengths of the architecture of NMS with broker specific provider implementations is that you can do simple file copies to install the assemblies.  This allows for side-by-side installation of different versions of NMS.  What is the requirement to install NMS and the provider assemblies into the GAC?  I can't see how this has any benefit, but I can see how it has several downsides.  Perhaps explaining how installing NMS+Providers into the GAC is a "good thing" would be helpful.  I'm beginning to think we are trying to find a solution to a problem that doesn't exist.

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes updated AMQNET-262:
-----------------------------

    Fix Version/s: 1.4.0

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work logged: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#action_36921 ]

Jim Gomes logged work on AMQNET-262:
------------------------------------

                Author: Jim Gomes
            Created on: 15/Jul/10 03:29 PM
            Start Date: 15/Jul/10 03:29 PM
    Worklog Time Spent: 45 minutes 
      Work Description: Applied patch and made some modifications.

Issue Time Tracking
-------------------

    Remaining Estimate: 0 minutes
            Time Spent: 45 minutes

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work logged: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#action_36931 ]

Jim Gomes logged work on AMQNET-262:
------------------------------------

                Author: Jim Gomes
            Created on: 10/Aug/10 04:45 PM
            Start Date: 10/Aug/10 04:45 PM
    Worklog Time Spent: 40 minutes 

Issue Time Tracking
-------------------

    Time Spent: 1 hour, 25 minutes  (was: 45 minutes)

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 1 hour, 25 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes resolved AMQNET-262.
------------------------------

    Resolution: Fixed

I changed the search order for loading provider assemblies.  The connection factory will first look for a custom provider configuration file before attempting to use standard provider implementations.  For those applications that want to tightly bind to a specific version of NMS + Provider by installing and accessing the assemblies via the GAC, they can deploy a custom provider config file with the strong name of the assembly.  For example, the following file named {{nmsprovider-activemq.config}} can be deployed into the application installation folder:

{code:xml|title=nmsprovider-activemq.config}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<provider assembly="Apache.NMS.ActiveMQ, Version, Culture, PublicKeyToken" classFactory="Apache.NMS.ActiveMQ.ConnectionFactory"/>
</configuration>
{code}

In the provider tag's assembly attribute, the full GAC version that the application wants to use can be specified.


> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes reopened AMQNET-262:
------------------------------


> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60826#action_60826 ] 

Timothy Bish commented on AMQNET-262:
-------------------------------------

I'd have to agree with Jim on this one, I'm not really seeing the benefits of putting NMS in the GAC.  If you can let us know your thoughts on this that would be helpful, maybe we just aren't seeing something obvious on this one.

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Daniel Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60853#action_60853 ] 

Daniel Ellis commented on AMQNET-262:
-------------------------------------

Installing NMS in the GAC is not a necessity, as I can always install the DLLs in the application folder.  In this case it would have just been more logical to store the common components in the GAC which are shared by multiple applications (in this case 6 applications on the same machine).

However, although we don't require NMS to be installed in the GAC, I do think it has highlighted a general issue with how the assemblies are loaded, and it might be better to load assemblies using the assembly name rather than the file names.

If assembly loading is left to the CLR, then assemblies are located dynamically by looking in the GAC followed by the application folder.  Details about assembly probing are here http://msdn.microsoft.com/en-us/library/yx7xezcf%28v=VS.71%29.aspx  It even has the ability to perform install-on-demand (MSI feature).  Therefore it makes sense to leave this job to the CLR, as it is much more flexible.

So in summary, I would suggest:-
  1. Store a list of known connectors, and reference the assemblies strong-name.
  2. If a connector is not a known type, then lookup the assembly name (strong or not), from the connectors config file
  3. Leave assembly loading to the CLR

One downside would be that existing connector config files may break, but this could be avoided by removing ".dll" from the end of the assembly string before loading.

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Daniel Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60688#action_60688 ] 

Daniel Ellis commented on AMQNET-262:
-------------------------------------

I first tried Assembly.Load but that failed because it will not load a file from the GAC unless the full assembly name is specified (name, version, key).  LoadWithPartialName did load the assembly from the GAC.  However, I failed to notice it was deprecated.  A quick look finds this blog entry which explains their reasoning: http://blogs.msdn.com/b/suzcook/archive/2003/05/30/57159.aspx

So either way, currently there is not a suitable solution for this, because ultimately if using the GAC, we must specify the exact version that is required, in order to handle different apps putting different versions of NMS in the GAC.

I can think of two solutions:-

1. Specify the full assembly name in the NMS config file.
2. Specify the full assembly name in the built in list of known assemblies.

And I think I would prefer option 2, because it is actually specifying which versions of NMS connectors are compatible with the core NMS interface.

E.g.  Apache.NMS 1.3.0.0 would be compatible with Apache.NMS.ActiveMQ 1.3.0.0 only.

This would mean that minor fixes should not change the "AssemblyVersion", but it would be fine to update the "AssemblyFileVersion".

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQNET-262) NMS cannot be used if installed in the GAC

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes resolved AMQNET-262.
------------------------------

    Resolution: Fixed

Thanks for the patch, Daniel.  I applied it and made a few modifications to it.  The extension needed to be added back when searching for the full filenames.  I also changed the call from Assembly.LoadWithPartialName() to Assembly.Load(), because LoadWithPartialName() is obsolete.  The functionality should be equivalent.

Please review the changes to make sure everything works as intended, and if it does, you can close this issue.

> NMS cannot be used if installed in the GAC
> ------------------------------------------
>
>                 Key: AMQNET-262
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-262
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: NMS
>    Affects Versions: 1.3.0
>         Environment: Windows .NET 2.0
>            Reporter: Daniel Ellis
>            Assignee: Jim Gomes
>            Priority: Minor
>             Fix For: 1.4.0
>
>         Attachments: NMS GAC.patch
>
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> If you install {{Apache.NMS.dll}} and {{Apache.NMS.ActiveMQ.dll}} in the GAC then NMS is not able to load {{Apache.NMS.ActiveMQ.dll}}.
> {{NMSConnectionFactory.cs}} is storing the pre-defined connection factories in _schemaProviderFactoryMap_, but is storing the DLL file names to locate the assemblies.
> One solution would be to store the _AssemblyQualifiedName_ instead and leave the assembly loading to the system.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.