Giter VIP home page Giter VIP logo

sofa-ark's People

Contributors

aiwu4damon avatar alaneuler avatar caojie09 avatar compasty avatar dependabot[bot] avatar g-stream avatar gaosaroma avatar glmapper avatar hadoop835 avatar huangyunbin avatar hustchaya avatar hzjneverstop avatar jiangyunpeng avatar joekerouac avatar khotyn avatar lanicc avatar lbj1104026847 avatar loong-coder avatar lvjing2 avatar lylingzhen avatar nobodyiam avatar qilongzhang avatar qixiaobo avatar shenchao45 avatar straybirdzls avatar vchangpengfei avatar wuqian0808 avatar xingcici avatar yuanyuancin avatar zhengchangqing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sofa-ark's Issues

Update README

Update README, add more information about the background, the difference with other competitors

SOFAArk 启动期间 YGC 优化

写了个 SOFABoot 的工程,在没有使用 SOFAArk 之前,GC 次数为 6 次;在 使用之后(SOFAArk + rpc plugin),启动期间 YGC 上升到 12~13 次

No Ark Container jar file found error during running sample from IDE(spring boot or java app)

Describe the bug

When running sample sofa-ark-sample-springboot-ark from IDE,

Caused by: com.alipay.sofa.ark.exception.ArkException: No Ark Container Jar File Found.
	at com.alipay.sofa.ark.bootstrap.ClasspathLauncher$ClassPathArchive.getContainerArchive(ClasspathLauncher.java:102)
	at com.alipay.sofa.ark.bootstrap.AbstractLauncher.getContainerArchive(AbstractLauncher.java:131)
	at com.alipay.sofa.ark.bootstrap.AbstractLauncher.launch(AbstractLauncher.java:62)
	at com.alipay.sofa.ark.support.startup.SofaArkBootstrap.remain(SofaArkBootstrap.java:81)
	... 6 more

after I add

    <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>sofa-ark-container</artifactId>
        <version>0.5.0-SNAPSHOT</version>
    </dependency>

to the pom of sofa-ark-sample-springboot-ark everything seem work fine.

Environment

  • SOFAArk version: 0.5.0-SNAPSHOT
  • JVM version (e.g. java -version): 1.8
  • OS version (e.g. uname -a): Win10
  • Maven version:3.5
  • IDE version: IDEA2018

sofa-ark-plugin-maven-plugin中标签shades的目的是什么

Your question

发现sofa-ark-plugin-maven-plugin中有标签shades

Your scenes

plugin之间出现包依赖

Your advice

发现和excludes作用一样,可以把不必要的jar中fatjar剥离出
并且plugin还可以直接使用这个jar中的类

我的问题是
1,使用的是其他plugin中的jar还是biz中import的jar,如果是其他plugin的jar,优先级是什么呢
2,如果其他插件已经把一个类export了,但是当亲plugin没有import会发生什么事情?是使用已经export的类还是自己用当前classload重新load个?

Environment

  • SOFAArk version:
  • JVM version (1.8.0_71):
  • OS version (MINGW64_NT-10.0 ):
  • Maven version: 3.5.3
  • IDE version:NA

Support ark plugin to load resource of ark biz

Currently, we only support ark biz to load class and resource from ark plugin. However, sometime, it's necessary to load resource(NOT class) of ark biz from ark plugin, such as SPI extension. So, we should support this feature.

请问sofa-ark-maven-plugin 是否有gradle的插件?

Your question

describe your question clearly

Your scenes

describe your use scenes (why need this feature)

Your advice

describe the advice or solution you'd like

Environment

  • SOFAArk version:
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:

Simplify usage of ark plugin

Currently, a common java module can be repackaged into a ark-plugin. Project just imports this ark plugin as dependency instead of origin java module jar, then class isolation can be applied. However, as structure of jar has been changed, sometimes, project should add dependency of origin module just for compiling success. For simplify usage of ark plugin, we would adjust the structure of ark-plugin, then project just needs to import ark plugin individually.

NPE when JVM shut down.

Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to stop embedded Tomcat
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.stop(TomcatEmbeddedServletContainer.java:284)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.stopAndReleaseEmbeddedServletContainer(EmbeddedWebApplicationContext.java:306)
        ... 3 more
Caused by: java.lang.NullPointerException
        at com.alipay.sofa.ark.container.service.classloader.ClassloaderServiceImpl.isDeniedImportClass(ClassloaderServiceImpl.java:256)
        at com.alipay.sofa.ark.container.service.classloader.BizClassLoader.shouldFindExportedClass(BizClassLoader.java:130)
        at com.alipay.sofa.ark.container.service.classloader.AbstractClasspathClassloader.resolveExportClass(AbstractClasspathClassloader.java:147)
        at com.alipay.sofa.ark.container.service.classloader.BizClassLoader.loadClassInternal(BizClassLoader.java:70)
        at com.alipay.sofa.ark.container.service.classloader.AbstractClasspathClassloader.loadClass(AbstractClasspathClassloader.java:59)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:240)
        at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:366)
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.stopTomcat(TomcatEmbeddedServletContainer.java:224)
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.stop(TomcatEmbeddedServletContainer.java:276)
        ... 4 more

Support telnet command to view ark plugin

Support telnet command to view ark plugin.

The logic of the current telnet processing command is to get the ArkCommandHandler from Ark Plugin, so in order to support the telnet command to view the Ark Plugin, need to create an ark-plugin project to complete (or can also add to the jarslink-plugin).

您好,请问怎么通过类名来获取ark plugin类对象?

Your question

我想在运行时通过类名来获取类对象,使用Class.forName()报错:
"com.alipay.sofa.ark.exception.ArkLoaderException [ArkBiz Loader] Startup In IDE:Mock version : can not load class: Hessian4Service"
请问应该怎么做呢?

Proper way to switch TCCL

Currently, Ark Plugin and Ark Biz are loaded by independent classLoader,when an invocation steps into Ark Plugin from Ark Biz or inverse,we should take it clear whether it's necessary switch current thread classLoader(TCCL) . It may cause some problem, eg. #51

Why Cant I use export class in projArk?

Your question

describe your question clearly

There are projects here:
deep100, the original deep version 1
deep200, the original deep version 2
pluginB100, project that depends on deep100
pluginC200, project that depends on deep200
projArk, project that use both pluginB100 and pluginC200

Your scenes

for deep100, deep200, pluginB100, pluginC200, use mvn clean package install them.
for projArk, use mvn clean package, but report error: can't find PluginB100Activator or PluginC200Activator

describe your use scenes (why need this feature)
What's wrong with the codes or pom.xml?

Your advice

describe the advice or solution you'd like

Environment

  • SOFAArk version:
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:

打包ark plugin后,如何正常使用导出类中的spring特性

Your question

ark plugin导出类中的spring特性被屏蔽

Your scenes

对内提供了一个基础包,希望可以解决其他项目maven引入后,可能出现的依赖冲突问题。

使用sofa-ark的步骤:
1.将基础包打包成ark plugin,导出需要的类;
2.spring-boot项目引入ark plugin和sofa-ark-springboot-starter,打成ark包;
3.执行2生成的可执行包

结果:
1.不涉及到spring的类能正常通过PluginClassLoader加载;
2.使用spring相关特性的类,会出现以下几类错误和异常:
1)ArrayStoreException(Application监听器)
2)ClassCastException(Condition注解)
3)java.lang.LinkageError(get bean)

Your advice

对于需要打包成ark plugin导出的类,如果用到了spring特性,spring-boot项目引入这样的插件,有没有什么比较好的解决方案

Environment

  • SOFAArk version:0.3.0
  • JVM version (e.g. java -version):1.8.0
  • OS version (e.g. uname -a):mac High Sierra
  • Maven version:Apache Maven 3.5.3
  • IDE version:IDEA 2018.1

Biz/Plugin Classloader concurrency problem

When load class, we do not add any lock because of the parent URLClassloader has lock:

 protected Class<?> loadClass(String name, boolean resolve)
        throws ClassNotFoundException
    {
        synchronized (getClassLoadingLock(name)) {
            // First, check if the class has already been l

However when resolve local class, we use find class instead of load class

protected Class<?> resolveLocalClass(String name) {
        try {
            return super.findClass(name);
        } catch (ClassNotFoundException e) {
            // ignore
        }
        return null;
    }

This may cause define class duplicated in multi-thread scenario

Add Integration CI Test

Currently we only have unit test, this is not enough, when there are huge code changes, we have to do much manual test to guarantee code stability.

This can be done on next milestone

plugin依赖biz下的特定资源文件如何解决

如特定plugin依赖项目名称(配置到资源文件里)进行监控操作,而这个文件又不可能放到该插件里,或为每次使用该插件的项目开发一个单独的只用来提供这个资源的附属插件,有解决办法吗?看文档是biz单项依赖plugin的,但对于极端情况怎么解决

Change rule of importing and exporting pacakge

Now, SOFAArk support the behavior of importing and exporting package; the following configuration

<export>
    <packages>
        <package>a.b</package>
    </packages>
</export>

, means that all classes start with a.b would be exported, e.g. a.b.C, or a.b.d.E. Sometimes, we find it's not very convenient.

With full consideration,in SOFAArk 0.3.0, we would change the rule of exporting and importing behavior. It's so pity that it would NOT be compatible with previous version. No matter import or export package, we define two pattern of configuration.

  • package-level configuration, e.g. a.b, it just represents classes with accurate package name equals to a.b;

  • package-level configuration, e.g. a.b.*, it represents classes whose package name starts with a.b

These two rule would also be applied to denyImportPackages

Ark-Plugin 的使用是否会导致中间件的 starter 的 AutoConfiguration 等机制失效

Your question

Ark-Plugin 的使用是否会导致中间件的 starter 的 AutoConfiguration 等机制失效.

我想知道这是否是因为 ark plugin 包结构变化以后, 导致 spi 机制和 spring 的扫包机制失效了, 所以我们在用 sofa-boot 的时候不能再使用那些 sofa-boot 的配置方式, 只能通过原生的 rpc api 来启动.

此外我观察到 sofa-boot 项目的 ark 测试例子中也是没有使用 sofa-boot 的配置方式的, 是否是这个原因呢?

Your scenes

测试 boot-rpc 的 ark 版本

        <dependency>
            <groupId>com.alipay.sofa</groupId>
            <artifactId>rpc-sofa-boot-starter</artifactId>
            <classifier>ark-plugin</classifier>
        </dependency>

发现使用 starter 的非 ark 版本能正常运行的 rpc demo , 如果改为使用 ark 版本会无法运行, 会报一些异常, 例如:

com.alipay.sofa.runtime.api.ServiceRuntimeException: Can't find BindingConverter of type binding.bolt

我的 rpc 配置如下

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:sofa="http://sofastack.io/schema/sofaboot"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
            http://sofastack.io/schema/sofaboot   http://sofastack.io/schema/sofaboot.xsd"
       default-autowire="byName">

    <bean id="personServiceImpl" class="com.zim.test.sofa.sofaboottest.bean.PersonServiceImpl"/>

    <sofa:service ref="personServiceImpl" interface="com.zim.test.sofa.sofaboottest.bean.PersonService">
        <sofa:binding.bolt/>
        <sofa:binding.rest/>
        <sofa:binding.dubbo/>
    </sofa:service>


    <sofa:reference id="personReferenceBolt" interface="com.zim.test.sofa.sofaboottest.bean.PersonService">
        <sofa:binding.bolt/>
    </sofa:reference>

    <sofa:reference id="personReferenceRest" interface="com.zim.test.sofa.sofaboottest.bean.PersonService">
        <sofa:binding.rest/>
    </sofa:reference>

    <bean id="personFilter" class="com.zim.test.sofa.sofaboottest.bean.PersonServiceFilter"/>

</beans>

以及, 集成测试用例

@RunWith(ArkBootRunner.class)
//@RunWith(SpringRunner.class)
@SpringBootTest(classes = SofaBootTestApplication.class)
public class SofaBootTestApplicationTests {

    @Autowired
    private PersonService personReferenceBolt;

    @Autowired
    private PersonService personReferenceRest;

    @Test
    public void contextLoads() {
        System.out.println(personReferenceBolt.sayName("abc"));
        System.out.println(personReferenceRest.sayName("123"));
    }

}

Environment

  • SOFAArk version: 0.3.0
  • SOFABoot-dependencies version: 2.4.0
  • JVM version (e.g. java -version): 1.8.0_171
  • OS version (e.g. uname -a): windows 7
  • Maven version: 3.3.9
  • IDE version: idea 2018.1

Support Ark Biz deployer extension

Currently, Ark Biz is deployed by ark container in DeployBizStage . we plan to provider a BizDeployer SPI, so ark plugin can implement it and custom the manner of biz deployment.

在0.4.1-SNAPSHOT版本中provided的包的依赖还会打包到biz的lib中

Your question

在0.4.1-SNAPSHOT版本中provided的包不会打到biz的lib中,但是这个包的依赖还会打到biz的lib中.这个正常吗?这些依赖包存在冲突是要手动排除吗?

Environment

  • SOFAArk version:0.4.1-SNAPSHOT
  • JVM version (e.g. java -version):1.8
  • OS version (e.g. uname -a):windows10
  • Maven version:3.5
  • IDE version:eclipse

Rules check for import/export class/resource

Currently if one plugin export and import the same class/resource, some unexpected results will occur. We should figure out rules check for such scenarios.

And on OSGI, it will check whether import class is exported by some other bundle, if not ,then will get error as "missing contrains..." . When figure out rules, we should also take this into consideration.

Rules can be checked on build stage or on runtime stage or both.

Support ARK Plugin when maven ark-plugin in ` <dependencyManagement>`

  • Support
    <dependencyManagement>
            <dependency>
            <groupId>com.alipay.sofa</groupId>
            <artifactId>runtime-sofa-boot-starter</artifactId>
            <classifier>ark-plugin</classifier>
            <version>1.0.1</version>
        </dependency>
    </dependencyManagement>
  • If this function not supported,then using spring-boot-maven-plugin the Fat Jar will be larger and larger.Actually spring-boot-maven-plugin don't care the ark-plugin dependency in classpath or not.

useFastExceptions is invalid in JarURLConnection.

The useFastExceptions in com.alipay.sofa.ark.loader.jar.JarURLConnection is used to throw a generic static exception when a URL cannot be connected. This optimization is used during class loading to save creating lots of exceptions which are then swallowed. However,it's actually invalid because classloader isolation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.