You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Stefan (JIRA)" <ji...@apache.org> on 2012/07/20 09:55:34 UTC

[jira] [Created] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

Stefan created WICKET-4663:
------------------------------

             Summary: LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
                 Key: WICKET-4663
                 URL: https://issues.apache.org/jira/browse/WICKET-4663
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.7
            Reporter: Stefan


The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:

			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4663.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5.8
                   6.0.0

Applied your suggestion in 1.5.x.
For 6.x I moved #getClassLoader() method in IClassResolver interface.
                
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>            Assignee: Martin Grigorov
>             Fix For: 6.0.0, 1.5.8
>
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

Posted by "Stefan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420658#comment-13420658 ] 

Stefan commented on WICKET-4663:
--------------------------------

Thanks!
                
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>            Assignee: Martin Grigorov
>             Fix For: 6.0.0, 1.5.8
>
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

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

Stefan updated WICKET-4663:
---------------------------

    Description: 
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:

			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}


  was:
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:
{code:java}
			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}
{code}

    
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

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

Stefan updated WICKET-4663:
---------------------------

    Description: 
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:
(code)
			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}
(code)

  was:
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:

			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}


    
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> (code)
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}
> (code)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

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

Stefan updated WICKET-4663:
---------------------------

    Description: 
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:
{code:java}
			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}
{code}

  was:
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:
{code}
			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}
{code}

    
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> {code:java}
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

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

Stefan updated WICKET-4663:
---------------------------

    Description: 
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:


			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}


  was:
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:
(code)
			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}
(code)

    
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

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

Stefan updated WICKET-4663:
---------------------------

    Description: 
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:
{code}
			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}
{code}

  was:
The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.

Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 

Then it will be something like:

			ClassLoader classLoader;
			if (Application.exists())
			{
				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
					.getApplicationSettings()
					.getClassResolver();			

				classLoader = classResolver.getClassLoader();
			}
			else
			{
				classLoader = Thread.currentThread().getContextClassLoader();
			}
			
			try
			{
				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
						ILazyInitProxy.class, IWriteReplace.class }, handler);
			}

    
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> {code}
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4663) LazyInitProxyFactory uses wrong ClassLoader in OSGi environment

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-4663:
---------------------------------------

    Assignee: Martin Grigorov
    
> LazyInitProxyFactory uses wrong ClassLoader in OSGi environment
> ---------------------------------------------------------------
>
>                 Key: WICKET-4663
>                 URL: https://issues.apache.org/jira/browse/WICKET-4663
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.7
>            Reporter: Stefan
>            Assignee: Martin Grigorov
>
> The method LazyInitProxyFactory#createProxy use Thread.currentThread().getContextClassLoader() to create a new proxy instance. It seems that this is not correct in an OSGi environment.
> Preferred is to use the ClassLoader provided by the AbstractClassResolver class (getClassResolver is not part of IClassResolver). 
> Then it will be something like:
> 			ClassLoader classLoader;
> 			if (Application.exists())
> 			{
> 				AbstractClassResolver classResolver = (AbstractClassResolver) Application.get()
> 					.getApplicationSettings()
> 					.getClassResolver();			
> 				classLoader = classResolver.getClassLoader();
> 			}
> 			else
> 			{
> 				classLoader = Thread.currentThread().getContextClassLoader();
> 			}
> 			
> 			try
> 			{
> 				return Proxy.newProxyInstance(classLoader, new Class[] { type, Serializable.class,
> 						ILazyInitProxy.class, IWriteReplace.class }, handler);
> 			}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira