我试图获得有关大型程序流程的一些信息.过去,KCachegrind曾经很擅长这一点.但是我系统上的最新版本(0.6kde)(Kubuntu 10.10)将不会显示调用树和调用者映射.它只绘制一个包含当前函数的框,但没有箭头和没有调用者.这是控制台输出:
kcachegrind(27917)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/usr/share/mime/magic"
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory
QFileSystemWatcher: failed to add paths: /home/cosmin/.config/ibus/bus
Bus::open: Can not get ibus-daemon's address.
IBusInputContext::createInputContext: no connection to ibus-daemon
CallGraphView::refresh
CallGraphView::refresh: Started process 0x1346f50, 'dot -Tplain'
CallGraphView::readDotOutput: QProcess 0x1346f50
CallGraphView::dotExited: QProcess 0x1346f50
Run Code Online (Sandbox Code Playgroud)
我安装了dot(graphviz),并且使用-g -O0编译了应用程序.
你知道问题出在哪里吗?
我有一个Parent实体与ManyToOne关系中的Child实体:
@Entity class Parent {
// ...
@ManyToOne((cascade = {CascadeType.ALL})
private Child child;
// ...
}
Run Code Online (Sandbox Code Playgroud)
该儿童有一个独特的领域:
@Entity class Child {
// ...
@Column(unique = true)
private String name;
// ...
}
Run Code Online (Sandbox Code Playgroud)
当我需要一个新孩子时,我先问ChildDAO:
Child child = childDao.findByName(name);
if(child == null) {
child = new Child(name);
}
Parent parent = new Parent();
parent.setChild(child);
Run Code Online (Sandbox Code Playgroud)
问题是,如果我喜欢上面两次(对于Child有相同的名字),并且只在最后保留Parent,我会得到一个约束异常.这似乎很正常,因为最初在数据库中没有具有指定名称的子项.
问题是,我不确定什么是避免这种情况的最佳方法.
我想使用Maven来构建和部署远程EJB.稍后,我希望能够将此EJB注入并使用到单独的WAR项目中.
所以我想我需要一个定义接口的jar文件,并在两个项目中使用jar(ejb和war).
我有一个名为example:apijar 的Maven项目中的这个接口:
package example;
import javax.ejb.Remote;
@Remote
public interface Bean {
void process();
}
Run Code Online (Sandbox Code Playgroud)
我在另一个名为example:ejbejb的Maven项目中实现了上面的接口:
package example;
import javax.ejb.Stateless;
@Stateless
public class Ejb implements Bean {
@Override
public void process() {
}
}
Run Code Online (Sandbox Code Playgroud)
ejb项目使用maven-ejb-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.1</ejbVersion>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
这两个项目依赖于javaee-api:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
现在将它们放在一起,我制作了第三个Maven项目,称为example:ear打包为ear:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>ear</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>ear</packaging>
<name>ear</name>
<dependencies>
<dependency>
<groupId>example</groupId>
<artifactId>api</artifactId>
<version>0.0.1-SNAPSHOT</version> …Run Code Online (Sandbox Code Playgroud) 我在 Ubuntu 16.04 机器上安装了 Jenkins 2.32.2,并按照其 wiki 上的描述配置了 Apache 代理。
我更改了这些行/etc/default/jenkins:
HTTP_PORT=8380
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --prefix=/jenkins"
Run Code Online (Sandbox Code Playgroud)
有了这些,我可以通过http://myhost:8380/jenkins/访问 Jenkins
对于代理,我创建了/etc/apache2/conf-available/jenkins.conf包含以下内容的文件:
ProxyPass /jenkins http://myhost:8380/jenkins nocanon
ProxyPassReverse /jenkins http://myhost:8380/jenkins
ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
# Local reverse proxy authorization override
# Most unix distribution deny proxy by default (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu)
<Proxy http://myhost:8380/jenkins*>
Order deny,allow
Allow from all
</Proxy>
Run Code Online (Sandbox Code Playgroud)
然后我启用配置(使用sudo a2enconf jenkins)并重新启动 Apache。现在我可以通过http://myhost/jenkins访问 Jenkins 。
原则上没问题,但在“管理 Jenkins”页面中,我收到一条消息:“看来您的反向代理设置已损坏。” 带有指向wiki 页面的链接,其中包含可能的解决方案。 …