现在,我确实找到了Google财经API并开始查看,但我发现了很多关于投资组合,交易,头寸和其他我一无所知的信息.
我在查看错误的文档吗?我需要做些什么来从GF获得汇率?这甚至可能吗?
编辑
让事情变得更加清晰.我对技术方面不感兴趣,也不想要任何代码.
我在Windows XP Pro上使用Glassfish 3.0.1,JVM 1.6.0_21;
我不确切知道环境中发生了什么变化,但是当我尝试部署企业应用程序(ejb模块+应用程序客户端模块)时,我就会得到这个堆栈跟踪.
没有任何东西在3820端口上运行,除了Glassfish ...我用netstat检查服务器已停止并且服务器已启动.
可能是什么原因造成的?一些内部流程冲突?
有关如何进一步调试此问题的任何提示?
WARNING: Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory
SEVERE: iiop.createsocket_exception
WARNING: Can not find resource bundle for this logger. class name that failed: org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory
SEVERE: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:106)
at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.<init>(SSLServerSocketImpl.java:106)
at com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:72)
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSSLServerSocket(IIOPSSLSocketFactory.java:402)
at org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createServerSocket(IIOPSSLSocketFactory.java:281)
at com.sun.corba.ee.impl.transport.SocketOrChannelAcceptorImpl.initialize(SocketOrChannelAcceptorImpl.java:91)
at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.getAcceptors(CorbaTransportManagerImpl.java:247)
at com.sun.corba.ee.impl.transport.CorbaTransportManagerImpl.addToIORTemplate(CorbaTransportManagerImpl.java:264)
at com.sun.corba.ee.spi.oa.ObjectAdapterBase.initializeTemplate(ObjectAdapterBase.java:131)
at com.sun.corba.ee.impl.oa.poa.POAImpl.initialize(POAImpl.java:474)
at com.sun.corba.ee.impl.oa.poa.POAImpl.makeRootPOA(POAImpl.java:323)
at com.sun.corba.ee.impl.oa.poa.POAFactory$1.evaluate(POAFactory.java:279) …Run Code Online (Sandbox Code Playgroud) 是否可以从EntityManager获取Hibernate Session对象?我想访问一些特定于hibernate的API ...
我已经尝试过类似的东西:
org.hibernate.Session hSession =
( (EntityManagerImpl) em.getDelegate() ).getSession();
Run Code Online (Sandbox Code Playgroud)
但是只要我在EJB中调用一个方法,我就会得到"在EJB上调用期间发生系统异常",并带有NullPointerException
我使用glassfish 3.0.1
我正在努力学习摇摆,我想你们可能知道一个非常好的基于开源的应用程序,我可以学习和启发.我正在寻找具有真实世界用途的东西,而不只是解释一些概念(如大多数书籍和教程中的例子).
谢谢!
我试图强制JPA/Hibernate生成并只使用小写的表名.我已经实现了这样的NamingStrategy:
public class MyNamingStrategy extends DefaultNamingStrategy {
@Override
public String classToTableName(String className) {
return super.classToTableName(className).toLowerCase();
}
}
Run Code Online (Sandbox Code Playgroud)
我通过在persistence.xml中设置此属性来应用它:
<property name="hibernate.ejb.naming_strategy" value="entities.strategy.MyNamingStrategy"/>
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我得到这个堆栈跟踪:
SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
org.hibernate.DuplicateMappingException: Same physical table name [planning] references several logical table names: [Planning], [OrderProductMan_Planning]
at org.hibernate.cfg.Configuration$MappingsImpl.addTableBinding(Configuration.java:2629)
at org.hibernate.cfg.annotations.TableBinder.buildAndFillTable(TableBinder.java:254)
at org.hibernate.cfg.annotations.TableBinder.bind(TableBinder.java:177)
Run Code Online (Sandbox Code Playgroud)
什么是
相同的物理表名称[planning]引用了多个逻辑表名称:[Planning],[OrderProductMan_Planning]
意思?
来自错误的实体,尽可能简化.如果你需要休息,请告诉我.
@Entity
public class Planning implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
private Integer qty;
@ManyToOne
private OrderProductMan orderProduct;
....
}
@Entity
@Table
public class …Run Code Online (Sandbox Code Playgroud) 我是ORM的新手,我需要一些帮助来理解一些东西.
假设我有以下标准SQL查询:
SELECT *, COUNT(test.testId) AS noTests FROM inspection
LEFT JOIN test ON inspection.inspId = test.inspId
GROUP BY inspection.inspId
Run Code Online (Sandbox Code Playgroud)
我想在JPA中使用它.
我有一个与Test实体有一对多关系的Inspection实体.(检查有很多测试)我试过在JPQL中写这个:
Query query = em.createQuery("SELECT insp, COUNT(???what???) " +
"FROM Inspection insp LEFT JOIN insp.testList " +
"GROUP BY insp.inspId");
Run Code Online (Sandbox Code Playgroud)
1)如何编写COUNT子句?我必须将count应用于测试表中的元素,但testList是一个集合,所以我不能像smth那样做COUNT(insp.testList.testId)
2)假设1已解决,将返回什么类型的对象.它肯定不是检验对象......我如何使用结果?
我正在尝试将字符串列设置为表的主键,然后将其作为外键从另一个表中引用.这可能吗?根据文件:
Laravel assumes every table has a numeric primary key (usually named “id”) and ensures the value of this column is unique for each new row added to the table. Laravel doesn’t really work well unless each table has a numeric primary key. So, for your average Laravel application, please ensure that you define a primary key using the increments() method.
Run Code Online (Sandbox Code Playgroud)
就我而言,我不想定义一个id列,因为它没用.我想要定义的字符串列将充当主键.如果可以,我可以获得示例迁移代码段吗?
我已经使用HornetQ设置了一个jms服务器作为JMS提供程序(Queue).
我有一个应用程序作为生产者,另一个(不同的计算机)作为消费者.
我知道JMS规范并不保证交付顺序,但我正在寻找一种方法:完全按照发送的顺序接收消息,即使它是特定于提供者的.
有任何想法吗?
我基本上试图从表示树结构的多维数组构建一个html ul/li嵌套列表.
以下代码工作正常,但我想改进它:
我需要一种方法来跟踪递归级别,以便我可以将不同的类应用于不同的级别,为生成的输出添加缩进等.
function buildTree($tree_array, $display_field, $children_field, $class='', $id='') {
echo "<ul>\n";
foreach ($tree_array as $row) {
echo "<li>\n";
echo $row[$display_field] . "\n";
if (isset($row[$children_field])) {
$this->buildTree($row[$children_field]);
}
echo "</li>\n";
}
echo "</ul>\n";
}
Run Code Online (Sandbox Code Playgroud)
$ tree_array如下所示:
Array
(
[0] => Array
(
[category_id] => 1
[category_name] => calculatoare
[parent_id] => 0
[children] => Array
(
[0] => Array
(
[category_id] => 4
[category_name] => placi de baza
[parent_id] => 1
)
[1] => Array
(
[category_id] => 5
[category_name] …Run Code Online (Sandbox Code Playgroud) 是否有任何eclipse快捷方式/技巧/插件/任何可以让我选择一段文本并在使用html编辑器时用任意html/xml标签包围它.